// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }

    return vars;
}

function openFullWindow(url) {
	var w = screen.width;
	var h = screen.height;
	
	leftPosition = 0;
	topPosition = 0;
	
	if (h<800)
	{
		var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no';
	} else
	{
		var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no';
	}
	var popup = window.open(url,'remote',windowprops);
	popup.moveTo(0,0)
	popup.resizeTo(screen.width,screen.height);
	popup.focus();
}

function resize(h)
{
	var cnt = window.document.getElementById('content');
	
	if(h == 0)
	{
		cnt.style.height= '100%';  
	} 
	else
	{
		cnt.style.height= h + 'px';
	}
}

function displaySite(locale) {
	
	var ua = $.browser;
	var include = true;
	
	if ( ua.mozilla && ua.version.slice(0,3) >= "2" ) {
		include = false;
	}
	
	/**
	if ( ua.webkit ) {
		include = false;
	}
	
	ua.chrome = /chrome/.test(navigator.userAgent.toLowerCase()); 
   	if ( ua.chrome ) {
		include = false;
	}
	**/
	
	
	
	
	var flashvars = {
	    server: server,
		domain: domain,
		locale: locale,
		online: "1",
		title: sitename,
		color0: color0,
		color1: color1
	};
	if(include) {
		var params = {
			bgcolor: "#ffffff",
			allowfullscreen: "true",
			allowscriptaccess: "always",
			wmode: "opaque",
			menu: "false"
		};
	} else {
	   	var params = {
			bgcolor: "#ffffff",
			allowfullscreen: "true",
			allowscriptaccess: "always",
			menu: "false"
		};
	}
	var attributes = {
		id: "content",
		name: "content"
	};
	
	swfobject.embedSWF(server + "data/swf/main.swf", "content", "100%", "100%", "10.0.0", server + "data/swf/expressInstall.swf", flashvars, params, attributes, callbackFn)
}
   
function callbackFn(e) {
	//alert(e.id);
}

function displayFooter(fontAlign)
{
   var flashvars = {
		footer: footer,
		font: fontfooter,
		antialias:"1",
		color: htmlfooterColor,
		size: fontsize,
		align: (fontAlign == undefined) ? "center" : fontAlign
	};
	var params = {
	    bgcolor: "#ffffff",
		allowscriptaccess: "always",
		menu: "false",
	    wmode: "transparent"
	};
	var attributes = {}
	swfobject.embedSWF(server + "data/swf/footer.swf", "footer", "100%", "100%", "9.0.0", "data/expressinstall.swf", flashvars, params, attributes);
}
