/*  
 *  (c) 2009 Mehdy DREF
 *
 *  this library is freely distributable under the terms of an MIT-style license.
 *
 *--------------------------------------------------------------------------*/
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("GameZone 2001jeux","http://gamezone.2001jeux.com",""); }
else { window.external.AddFavorite("http://gamezone.2001jeux.com","GameZone 2001jeux"); } }

function fav(a,b) {

if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel(b,a,""); }
else {window.external.AddFavorite(a,b); } }
	
function verifMail()
	{
	a = document.verif.mail.value;
	valide1 = false;
	
	for(var j=1;j<(a.length);j++){
		if(a.charAt(j)=='@'){
			if(j<(a.length-4)){
				for(var k=j;k<(a.length-2);k++){
					if(a.charAt(k)=='.') valide1=true;
				}
			}
		}
	}
	if(valide1==false) alert("Veuillez saisir une adresse email valide.");
	return valide1;
	}


function affichForm0(n) {
url="play.php?num="+n
window.open(url,"blank","resizable=no");
}
function affichForm1() {
url="recomail.php"
window.open(url,"blank","channelmode=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,menubar=0,resizable=0,width=280,height=500,left=30,top=30");
}
function affichForm2(n,m) {
url="recomail.php?num="+n+"&jname="+m 
window.open(url,"blank","channelmode=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,menubar=0,resizable=0,width=280,height=500,left=30,top=30");
}
function affichForm3(n) {
url="marking.php?num="+n
window.open(url,"blank","channelmode=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,menubar=0,resizable=0,width=380,height=150,left=500,top=500");
}
function affichForm4() {
url="mdp.html"
window.open(url,"blank","channelmode=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,menubar=0,resizable=0,width=320,height=500,left=30,top=30");
}
function affichForm5(n,m) {
url="recomail.php?num="+n+"&jname="+m+"&kzin=1" 
window.open(url,"blank","channelmode=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,menubar=0,resizable=0,width=280,height=500,left=30,top=30");
}
function affichForm6(n) {
url="marking.php?num="+n+"&kzin=1"
window.open(url,"blank","channelmode=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,menubar=0,resizable=0,width=380,height=150,left=500,top=500");
}

//nous appliquons simplement une couleur d'arrière plan aux objets traités, 
function couleur(obj) {
     obj.style.backgroundColor = "#FFFFFF";
}

function check() {

	var msg = "";

if (document.formulaire.width_game.value == "")	{
		msg += "Veuillez choisir une taille\n";
		document.formulaire.width_game.style.backgroundColor = "#F3C200";
}

if (document.formulaire.height_game.value == "")	{
		msg += "Veuillez choisir une taille\n";
		document.formulaire.height_game.style.backgroundColor = "#F3C200";
}

if (document.formulaire.description_game.value == "")	{
		msg += "Veuillez choisir une description\n";
		document.formulaire.description_game.style.backgroundColor = "#F3C200";
}

if (document.formulaire.url_game.value == "")	{
		msg += "Veuillez choisir une url\n";
		document.formulaire.url_game.style.backgroundColor = "#F3C200";
}



if (document.formulaire.img1_game.value == "")	{
		msg += "Veuillez choisir une image\n";
		document.formulaire.img1_game.style.backgroundColor = "#F3C200";
		
}else{
	var str = document.formulaire.img1_game.value.split(".");
	if(str[1] != "jpg" && str[1] != "JPG" ){
			msg += "Le format de l'image doit etre le jpg veuillez renommer votre fichier\n";
		document.formulaire.img1_game.style.backgroundColor = "#F3C200";
	}
}



if (document.formulaire.name_game.value == "")	{
		msg += "Veuillez saisir le nom du jeu\n";
		document.formulaire.name_game.style.backgroundColor = "#F3C200";
}

/*if (document.formulaire.captcha.value == "")	{
		msg += "Veuillez saisir le code\n";
		document.formulaire.captcha.style.backgroundColor = "#F3C200";
}*/

	if (msg == "") return(true);
	else	{
		alert(msg);
		return(false);
	}
	//alert("rouge");
}
	
function checkMessage() {
	
	var msg = "";


if (document.formulaire.pseudo_message.value == "")	{
		msg += "Veuillez choisir un pseudo\n";
		document.formulaire.pseudo_message.style.backgroundColor = "#F3C200";
}

if (document.formulaire.message_message.value == "")	{
		msg += "Veuillez rediger un message\n";
		document.formulaire.message_message.style.backgroundColor = "#F3C200";
}


if (document.formulaire.message_message.value.length < 10)	{
		msg += "Veuillez rediger un message de plus de 10 caracteres\n";
		document.formulaire.message_message.style.backgroundColor = "#F3C200";
}

/*if (document.formulaire.captcha.value == "")	{
		msg += "Veuillez saisir le code\n";
		document.formulaire.captcha.style.backgroundColor = "#F3C200";
}*/

	if (msg == "") return(true);
	else	{
		alert(msg);
		return(false);
	}
	alert("rouge");
}

