/* Adding a class to the HTML tag to preload styles before the DOM is ready */

if (document.documentElement && document.getElementById) {
    var docClass = document.documentElement.className != null ? document.documentElement.className : document.documentElement.getAttribute('class');
    docClass =  docClass !='' ? docClass + ' jsEnabled' : 'jsEnabled';
    document.documentElement.setAttribute('class',docClass);
    document.documentElement.className = docClass; //For IE
}

/* Popup windows */
function popWindow(url) {
	newwindow=window.open(url,'name','location=1,status=1,scrollbars=1,height=800,width=725');
	if (window.focus) {newwindow.focus()}
	return false;
}

$(document).ready(function () {	
	//*****************************************************//
	//*** Internet Explorer 6 image replacement scripts ***//
	if ($.support.opacity == false && $.browser.msie && $.browser.version == "6.0"){
		var bgPNGS = $('div, a').filter(function(){ 
		   return $(this).css('backgroundImage').indexOf('.png')+1;
		}); 
		bgPNGS.each(function(i){
			src = $(this).css("backgroundImage");
			src = src.replace("url(", "");
			src = src.replace(")", "");
			$(this).css({"background-image": "url(/library/images/common/pngfix_transparent.gif)"});
			$(this).css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + src + ", sizingMethod='crop')");
		});
	}

	// Sound events
	playSound(sectionName);		
	
	// Sound events
	$("div.signUp a").hover(
		function(){
			playSound("signup");
		},
		function(){}
	);
	
	// Sound events
	$("div.signUpFR a").hover(
		function(){
			playSound("signup");
		},
		function(){}
	);
	
	// Sound events
	$("div.signUpDE a").hover(
		function(){
			playSound("signup");
		},
		function(){}
	);	
});

function playSound(soundFileName) {
	var flashvars = {};
	var attributes = {};
	var params = {
		menu: "false",
		allowFullScreen: "true",
		allowScriptAccess: "always",
		scale: "noscale",
		wmode: "transparent"
	};
		swfobject.embedSWF("../library/flash/"+soundFileName+".swf", "flashsounds", "1", "1", "9.0.0", "/library/flash/expressInstall.swf", flashvars, params, attributes);
}