/* Fonctions en javascript pour Absolu-Puzzle.com*/
//fonction qui permet d'ouvrir la page d'aide dans une fenetre redimensionnée

//dans le moteur de recherche vide le champ nom_puzzle si on rempli le champ numero_puzzle
function vide_champs(champ_select)
{
 	if (champ_select == "rech_num")
	{
		document.forms["recherche"].elements["rech_form"].value="";
	}
	if (champ_select == "rech_form")
	{
		document.forms["recherche"].elements["rech_num"].value="";
	}
}

function ouvre_aide(arg)
{
	lien = "./aide/index.php"+arg;
	window.open( lien, "aide", "toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no, copyhistory=no, width=550, height=550, left=300, top=50");
}
//fonction qui permet d'ouvrir la page des scores puzzle dans une fenetre redimensionnée
function ouvre_scores(arg,arg1,arg2)
{
	lien = "./scores/scores_puzzle.php?ref="+arg+"&niveau="+arg1+"&niveau_nom="+arg2+"";
	window.open( lien, "Scores", "toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no, copyhistory=no, width=500, height=550, left=300, top=50");
}
function ouvre_demo() 
{
	titre="Puzzle";
  
  	ff=window.open("","Puzzle","width=500,height=389,left=10,top=10,scrollbars=no") ;
 
  	ff.document.write('<head><title>' + titre + '<\/title><link rel="stylesheet" type="text/css" href="./css/style.css"><\/head>');
 	ff.document.write('<body style="margin:0px;"><img src="./images/demo_puzzle.jpg" width="500" height="389" border=0 alt="Démo du puzzle"/><\/body>');
}
/*function ouvre_puzzle ( numero )
{
	if ( navigator.appName == 'Netscape' )   //pour netscape
	{
		var targeturl="./puzzle_prech.php?IdPuzzle="+numero
		newwin=window.open("","prechargement","fullscreen=no,scrollbars=yes,status=no,resizable=yes")
		
		window.moveTo(0,0)
		if (document.layers)
		{
			if (newwin.outerHeight<screen.availHeight||newwin.outerWidth<screen.availWidth)
			{
				newwin.outerHeight = screen.availHeight;
				newwin.outerWidth = screen.availWidth;
			}
		}
		
	}
	else    //pour IE et les autres navigateurs
	{
		//permet d'afficher la fenetre qui prend toute la dimension de l'ecran suivant la resolution
		var targeturl="./puzzle_prech.php?IdPuzzle="+numero
		newwin=window.open("","prechargement","location=no,hotkeys=no,directories=no,menubar=no,scrollbars=yes,toolbar=no,status=no")
		if (document.all)
  		{
			newwin.moveTo(0,0)
   			newwin.resizeTo(screen.availWidth,screen.availHeight)
  		}
	}	
		
	newwin.location = targeturl;
}*/ 
function ouvre_puzzle(numero) 
{
	f2=window.open('./puzzle_prech.php?IdPuzzle='+numero,'plein','top=0,left=0,width='+screen.width
     +',height='+screen.height+',scrollbars=yes,menubar=no,resize=no');
 }  