/*
if (!window.opener) 
	if (location.href.indexOf("jeutest1.html") == -1) 
		if (location.href.indexOf("jeutest2.html") == -1) 
			if (location.href.indexOf("jeutest3.html") == -1) 
				location.href = "index.php";
*/
//Debut SMSLive
function ouvreLive(id){
 var left;
 var URL;
 URL="http://composants.rentabiliweb.com/SMSLive.php?idP="+id;left = ((screen.width - 320) / 2);
 win = window.open(URL, "Micropaiement", "toolbar=0,scrollbars=0,location=0,status=0,menubar=0,directories=0,resizable=0,width=310,height=191,left="+left+",top=40")
}
//Fin SMSLive
function resizeIt(newWidth,newHeight){
    if (window.navigator.userAgent.indexOf("MSIE")!=-1 && window.navigator.userAgent.indexOf("Windows")!=-1) {
		document.resize_object.setAttribute('width',newWidth);
        	document.resize_object.setAttribute('height',newHeight);
    } else {
		document.resize_embed.setAttribute('width',newWidth);
	        document.resize_embed.setAttribute('height',newHeight);
    }
}
function resize(){
	var cWidth;
	var cHeight;
	var x;
	var y;
	if (typeof(window.innerWidth) == 'number') {
    	//Non-IE
	    cWidth = window.innerWidth;
    	cHeight = window.innerHeight;
	} else {
		cWidth = document.body.clientWidth;
		cHeight = document.body.clientHeight;
	}
	if ((cHeight<550 || cWidth<750) && screen.width>800) {
		resizeIt(750,550);
		self.window.resizeTo(758,627);
	} else {
		//resizeIt(cWidth,(cWidth*550/750));
		//resizeIt((cHeight*750/550), cHeight);
		x=(cHeight*750/550);
		if (x+20>cWidth) { x=cWidth; y=(cWidth*550/750); }
		else { x=(cHeight*750/550); y=cHeight; }
		resizeIt(x, y);
	}
}
function checkload() {
	var percent=0;
	if (document.getElementById) percent = document.resize_object.PercentLoaded(); //ie6
	else if (document.layers) percent = window.document.resize_embed.PercentLoaded();
	else percent = 100;
	if (percent>0) document.title = "Jeu - Chargement en cours " + percent + " pour cent chargés";
	if (percent<100) setTimeout('checkload()', 500);
	else document.title = "Jeu - Acrostiches parce que jouer à plusieurs c mieux !!!";
}
function embedswf(Fich,Port,Salle,Action,Url) {
	//var Url="http://www.acrostiches.com/jeu-de-lettres/";
	//var Url="http://localhost/jeu-de-lettres/";
	document.writeln(
	'<object id="resize_object" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
	' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"' +
	' width="750" height="550" align="middle">' +
	'<param name="movie" value="'+ Url + Fich +'?paramport='+ Port +'&paramsalle='+ Salle +'&paramact='+ Action +'" />' +
	'<param name="menu" value="false" />' +
	'<param name="quality" value="high" />' +
	'<param name="scale" value="noborder" />' +
	'<param name="devicefont" value="true" />' +
	'<param name="bgcolor" value="#ffffff" />' +
	'<param name="AllowScriptAccess" value="always" />' +
	'<embed id="resize_embed" src="'+ Url + Fich +'?paramport='+ Port + '&paramsalle='+ Salle +'&paramact=' + Action +'" ' +
	' menu="false" quality="high" scale="noborder"' +
	' devicefont="true" bgcolor="#ffffff" AllowScriptAccess="always" width="750" height="550" align="middle" ' +
	' swLiveConnect="true" type="application/x-shockwave-flash" ' +
	' type="application/x-shockwave-flash" ' +
	' pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
	'</object>');
	if (document.getElementById) document.getElementById('resize_object').focus(); //ie6
	else if (document.layers) window.document.resize_embed.focus();
}