/*

	Filename             sitewide.js
	Detail               Site functionality
	Author:              thunder::tech inc.
	License:             CLIENT is defined as the owner of online property from which this file resides or this code is referenced in.
						 ADDITIONAL PARTY is defined as anyone other than thunder::tech or CLIENT.
						 No right is granted to ADDITIONAL PARTY to sell, distribute, modify or otherwise transfer the following source code without explicit written permission by CLIENT or thunder::tech.

*/

/*  ================================
     Sitewide JavaScript
    ================================ */

thunder.client.modes.slideTreeMenu.over = function (obj) {

    var height = 0;
    $(obj).find('.thunder-nav-spinner a').each(function (i, item) {
        height += $(item).outerHeight();
    });

    height += 40;
    $(obj).children('.thunder-nav-spinner').animate({ 'height': height }, { duration: thunder.client.modes.slideTreeMenu.transition, queue: false });
}

thunder.client.project.pageLoaded = function () {
    if ($('.thunder-tree-menu').length > 0) { thunder.client.modify.treeMenu(false, true, [thunder.client.modes.fadeHeadingsTreeMenu, thunder.client.modes.slideTreeMenu]); }
    thunder.client.modify.selfLabelFields();
    thunder.client.workarounds.alphaImages();
    thunder.client.workarounds.labelAsBrowser();
}

$(thunder.client.project.pageLoaded);



//home page new branding welcome
var brandwelcome = null;
newBrandOpening = function () {
    brandwelcome = $(this).jBox({ 'showClose': false, 'fadeInDelay': 700, 'border': '2px solid #818a8f', 'fixedWidth': 620 });
	
	var randomNumber = Math.random();

	//document.write(randomNumber + "<br />");
	
	if (randomNumber > 0.5){
	brandwelcome.showWindow('<div id="msgbox" style="text-align:center;"><div style="width:600px;margin:auto auto;"><a onclick="brandwelcome.close();" style="text-align:center;display:block;cursor:pointer;">Enter Site</a><br style="clear:both;"/><a href="http://ev6.evenue.net/cgi-bin/ncommerce3/SEGetEventInfo?ticketCode=GS%3ACSU%3ABB11%3AMB12%3A&linkID=global-csu&shopperContext=&pc=&caller=&appCode=&groupCode=MBB&cgc"><div style="text-align:center;cursor:pointer;"><iframe  frameborder="0"  style="width:562px;height:430px;text-align:center;" src="/media/splash.htm"/></div></a></div></div>');
	}
	else {
	brandwelcome.showWindow('<div id="msgbox" style="text-align:center;"><div style="width:600px;margin:auto auto;"><a onclick="brandwelcome.close();" style="text-align:center;display:block;cursor:pointer;">Enter Site</a><br style="clear:both;"/><a href="http://ev6.evenue.net/cgi-bin/ncommerce3/SEGetEventList?groupCode=BULL&linkID=global-csu&shopperContext=&caller=&appCode"><div style="text-align:center;cursor:pointer;"><iframe  frameborder="0"  style="width:562px;height:430px;text-align:center;" src="/media/splash2.htm"/></div></a></div></div>');
	}

    //brandwelcome.showWindow('<div id="msgbox" style="text-align:center;"><div style="width:600px;margin:auto auto;"><a onclick="brandwelcome.close();" style="text-align:center;display:block;cursor:pointer;">Enter Site</a><br style="clear:both;"/><a href="http://ev6.evenue.net/cgi-bin/ncommerce3/SEGetEventInfo?ticketCode=GS%3ACSU%3ABB11%3AMB12%3A&linkID=global-csu&shopperContext=&pc=&caller=&appCode=&groupCode=MBB&cgc"><div style="text-align:center;cursor:pointer;"><iframe  frameborder="0"  style="width:562px;height:430px;text-align:center;" src="/media/splash.htm"/></div></a></div></div>');

}


$(document).ready(function () {
    if ($(".bottomAd").length > 0) {
        if ($(".bottomAd").html() == "") {
            $(".bottomAd").css("display", "none");
            $(".page-home").css("height", "675px");
        }
    }
});
