// Common JS

// Menu Items
var sgSMP = new Array();
sgSMP['sponsors'] = new Array();
sgSMP['sponsors'][0] = new Array('Shops', 'sponsors-and-exhibitors/show-shops');
sgSMP['sponsors'][1] = new Array('Manufacturers', 'sponsors-and-exhibitors/show-manufacturers');
sgSMP['sponsors'][2] = new Array('Resorts', 'sponsors-and-exhibitors/show-resorts');
sgSMP['sponsors'][3] = new Array('Clubs', 'sponsors-and-exhibitors/show-clubs');
sgSMP['sponsors'][4] = new Array('Sponsors', 'sponsors-and-exhibitors/show-sponsors');
sgSMP['sponsors'][5] = new Array('Other Vendors', 'sponsors-and-exhibitors/show-vendors');



// Trigger sIFR
function sgLoadSIFR() {
	
	$('#contentEditable h1, #contentEditable h2').addClass('sgSifrMain');
	$('#contentSidebar h1').addClass('sgSifrSide');
	
	/*
	SG_SITE_DIR + "script/sIFR/trade-gothic-bold-m" + SG_MOD_TIME +".swf"
	*/
	
	if(typeof sIFR == "function") {
	  sIFR.replaceElement(named({sSelector:"h1.sgSifrMain, h2.sgSifrMain", sFlashSrc:SG_SITE_DIR + "script/sIFR/trade-gothic-bold.swf", sColor:"#2e3192", sLinkColor:"#666666", sBgColor:"#e4f4fd", sHoverColor:"#CCCCCC", sFlashVars:"textalign=left", sCase:"upper", sWmode:"transparent"}));
	  
	  sIFR.replaceElement(named({sSelector:"h1.sgSifrSide", sFlashSrc:SG_SITE_DIR + "script/sIFR/trade-gothic-bold.swf", sColor:"#ffffff", sLinkColor:"#666666", sBgColor:"#4f6db5", sHoverColor:"#CCCCCC", sFlashVars:"textalign=left", sCase:"upper", sWmode:"transparent"}));
	
	};	
	
}

function sgHideFlash() {
	var sgUA = navigator.userAgent;
	
	if (sgUA.indexOf('PPC Mac') != -1 && sgUA.indexOf('Firefox/3') != -1) {
		$('embed').each(function() {
			if (!$(this).parent('div').hasClass('sgSwfWrap'))	{
				var w = $(this).attr('width');
				var h = $(this).attr('height');
				$(this).wrap('<div class="sgSwfWrap" style="width:' + w + 'px;height:' + h + 'px;"></div>');
			}
			$(this).hide();
		});
	}
}

function sgShowFlash() {
	$('div.sgSwfWrap embed').show();
}

// Hover Tables Style
function initHoverTables() {

	$('table.neatHoverTable tbody tr').each(function(i) {
		if (i%2 == 0) $(this).addClass('rowEven');
		$(this).hover(
			function() {$(this).addClass('highlight-on'); },
			function() {$(this).removeClass('highlight-on'); }
		);
	 });	
}


// Load Events
$(document).ready(function() {
	initHoverTables();
});
window.onload = function() {
	sgLoadSIFR();	
}