var cerrutiWindow = null;
var legalsWindow = null;
// FLASH PLUGIN TEST
function windowOnload() {
	var 

MM_contentVersion = 8;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if (plugin)
	{
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i)
		{
			if (isNaN(parseInt(words[i]))) continue;
			var MM_PluginVersion = words[i]; 
		}
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1))
	{
		/*document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('<\/SCR' + 'IPT\> \n');*/
		// temporary disabled IE flash detection
		var MM_FlashCanPlay = 1;
	}
	if ( MM_FlashCanPlay )
	{
		//window.location.replace("welcome.html");
	}
	else
	{ 
		//window.location.replace("HowTo/download_flash.htm");
		alert('flash version problem');
	}
}
function launchSite()
{
	$('#footer').fadeIn();	
	$('#image').fadeIn();	
	//launchSiteURL();
}
function launchSiteFullURL(gotURL)
{
	cerrutiWindow = window.open(gotURL,"cerrutiWindow",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	if (!cerrutiWindow || cerrutiWindow == null ) {
		alert("Please desactivate your popup blocker\n to access site.");
	}
	else
	{
		cerrutiWindow.document.bgColor = "black";
		cerrutiWindow.focus();
	}
}

function launchSiteURL(gotURL)
{
	url = "main.php"; //http://www.cerruti.com/
	if (gotURL=='fr') url = "main_fr.php";
	if (gotURL!=undefined && gotURL!="") url=url+"?jump="+gotURL;
	cerrutiWindow = window.open(url,"cerrutiWindow",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	if (!cerrutiWindow || cerrutiWindow == null ) {
		alert("Please desactivate your popup blocker\n to access site.");
	}
	else
	{
		cerrutiWindow.document.bgColor = "black";
		cerrutiWindow.focus();
	}
}

function LaunchSiteOld(pGo) {
	url = "http://www.cerruti.com/main.php";
	if (pGo != "undefined") {
		gourl = pGo;
	}
	else if (document.location.search.indexOf('gotourl=') >= 0)
	{
		fromPos = document.location.search.indexOf('gotourl=')+4;
		toPos = (document.location.search.indexOf('&',fromPos) >= 0) ? document.location.search.indexOf('&',fromPos) : document.location.search.length;
		gourl = document.location.search.substr(fromPos, toPos-fromPos);
	}
	else
	{
		gourl = "undefined";
	}
	if (gourl != "undefined")
	{
		url += "?gotourl="+gourl;
	}
	cerrutiWindow = window.open(url,"cerrutiWindow",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	cerrutiWindow.document.bgColor = "black";
	if (!cerrutiWindow) {
		alert("Please desactivate your popup blocker\n to access site.");
	}
	cerrutiWindow.focus();
}
function window_open(url) {
	option="height=520,width=770,top=10,left=10,toolbar=1,scrollbars=yes,location=1,status=1,menubar=1,resizable=yes";
	window.open(url,'',option);
}
