function init(){
	if( !isDefinedCookie('firstTime') ){
		loadReq();
		setCookie( 'firstTime', 1 );
	}
	else{
		loadHomePage();
	}
} 

function loadReq(){
	if( navigator.appVersion.indexOf('MSIE 6.0') != -1  ){
		document.getElementById('content').style.display = 'none';
	}
	document.getElementById('contentReqContainer').style.display = '';
}

function loadHomePage(){
	document.getElementById('contentReqContainer').style.display = 'none';
	document.getElementById('content').style.display = '';
	
	var so = new SWFObject("assets/swfs/shell.swf?t=" + new Date().getTime(), "flash_content", "100%", "100%", "9", "#000000");
	so.useExpressInstall("assets/swfs/expressinstall.swf");
	so.addParam("menu", "false");
	so.addParam("scale", "noscale");
	so.addParam("base", "assets/swfs/");	
	so.addParam("allowScriptAccess", "always");
	
	
	so.write("content");
}

function getJavascriptVariable(variable){
	return eval(variable);
}

function getQueryVariable(variable) 
{
	var query = window.location + "";
	var vars = query.split("?")[1].split("&");

	for (var i=0;i<vars.length;i++) 
	{
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
		}
	}
}

// BTN
function btnChangeSrc( eBtn, src ){
	eBtn.src = src;
}

// COOKIES
function setCookie(c_name,value,expiredays){
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name){
    if (document.cookie.length>0){
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!=-1){ 
            c_start=c_start + c_name.length+1; 
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
            return unescape(document.cookie.substring(c_start,c_end));
        }
    }
    return "";
}

function isDefinedCookie( c_name ){
	return !(getCookie(c_name) == null || getCookie(c_name) == "");
}