// pacth if javascript up main background to -44px on top
jQuery("head").append("<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/common/js.css\" media=\"screen\" />");
//document.write("<lin"+"k type=\"text/css\" rel=\"stylesheet\" href=\"/css/common/js.css\" media=\"screen\" />");

// function tag Google Analytics
function sendTag(Categorie, Action, Label) {
	try {
		pageTracker._trackEvent(Categorie, Action, Label);
	} catch(exc) {
		//…
	}
}

function popit(type,page,largeur,hauteur,popupname){
	if(!popupname || popupname ==''){
		popupname = "pop_up"
	}
	var top		= (screen.height-hauteur)/2;
	var left	= (screen.width-largeur)/2;
	switch(type){
		case 1 :
			var fenetre = window.open(page,popupname,"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",resizable=yes,scrollbars=yes");
			break;
		case 2 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",scrollbars=yes,status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes");
			break;
		case 3 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",scrollbars=no,status=no,toolbar=no,resizable=no,menubar=no,location=no");
			break;
		case 4 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",scrollbars=yes,status=no,toolbar=no,resizable=yes,menubar=no,location=no");
			break;
		case 5 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",resizable=yes,scrollbars=yes");
			break;
		case 0:
		default :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top=0,left=0,width="+screen.width+", height="+screen.height+",scrollbars=yes,status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes");
			break;
	}
	fenetre.focus();
}

// Functions for FLASH SWF
function popupCredits(){
	popit(3,'/credits.html',350,600,'');
	return false;
}
function externalUrl(url){
	document.location=url;
}
function popitGamme(url){
	document.location=url;
	//window.open(url);	
	//popit(0, url, 'la_gamme'+Math.round((Math.random()*10000000000000)), 'top=0,left=0,width='+screen.width+', height='+screen.height+',scrollbars=yes,status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes');
}

function timerRedirect(temps,myUrl){
	counter=setTimeout("redirect('"+myUrl+"')", temps*1000);
}

function redirect(myUrl){
	document.location.href = myUrl;
}

function JC_submit(data){
	jQuery('#jeuconcours_form #asplayed').val(data);
	jQuery('#jeuconcours_form').submit();
}
