//functions JS pour la Homepage

function inscription()
{
	
	
	var browserName=navigator.appName; 
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:480, height:450, url: "inscription.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:480, height:450,opacity:0.9, url: "inscription.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	//Dialog.info("",{className: "alphacube", title: "",url: "inscription.php", width:500,opacity:0.8, height:450, opacity:0.90,  showEffectOptions: {duration:1.5}});
	
	}
}

function passperdu()
{
	var browserName=navigator.appName; 
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:400, height:200, url: "membres/passperdu.php",minimizable:false,maximizable:false,showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:400, height:200,opacity:0.9, url: "membres/passperdu.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}
}

function validation()
{
	var browserName=navigator.appName; 
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:400, height:200, url: "membres/validation.php",minimizable:false,maximizable:false,showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:400, height:200,opacity:0.9, url: "membres/validation.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}
}

function histoire()
{
	var browserName=navigator.appName; 
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:500, height:530, url: "histoire/histoire1.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:500, height:520,opacity:0.9, url: "histoire/histoire1.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	//Dialog.info("",{className: "alphacube", title: "",url: "histoire/histoire1.php", width:500,opacity:0.8, height:450, opacity:0.90,  showEffectOptions: {duration:1.5}});
	
	}
	
}

function screenshots()
{
		var win = new Window({className: "alphacube", title: "", width:650, height:530, url: "screenshots.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
		win.showCenter(true);
}

function mentions()
{
	var browserName=navigator.appName; 
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:500, height:530, url: "mentions.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:500, height:520,opacity:0.9, url: "mentions.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	
	}
	
}

function equipe()
{
	var browserName=navigator.appName;
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:500, height:350, url: "equipe.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:500, height:350,opacity:0.9, url: "equipe.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
		win.showCenter(true);

	}

}
function changelog()
{
    var win ;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
       win = new Window({className: "alphacube", title: "", width:550, height:500, url: "changelog.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
	}else{
	   win = new Window({className: "alphacube", title: "", width:550, height:500,opacity:0.9, url: "changelog.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
	}
win.showCenter(true);
}
function contact()
{
	var browserName=navigator.appName; 
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:500, height:470, url: "contact.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:500, height:470,opacity:0.9, url: "contact.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}}); 
		win.showCenter(true);
	
	}
	
}

function soutien()
{
	var browserName=navigator.appName;
	if(browserName == "Microsoft Internet Explorer")
	{
		var win = new Window({className: "alphacube", title: "", width:400, height:350, url: "soutien.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
		win.showCenter(true);
	}else{
		var win = new Window({className: "alphacube", title: "", width:400, height:350,opacity:0.9, url: "soutien.php",minimizable:false,maximizable:false, showEffectOptions: {duration:1.5}});
		win.showCenter(true);

	}

}



function verif_login()
{
	
	var login = $F('pseudo');
	var password = $F('mdp');
	var retourAjax = false;

	if(login == ""|| password=="")
	{	
		Dialog.info("<br><br>Veuillez renseigner votre Pseudo et Mot de passe...<br><br>",{className: "alphacube",closable:true, title: "Identification &eacute;chou&eacute;e", width:300, height:100});
		return retourAjax;
		
	}
	else
	{
                //fonction qui v�rifie presence login ds la BD
                var url = 'ajax/verif_autorisation.php';
                new Ajax.Request(
                url,
                {
                      method: 'post',
                      asynchronous:false,
                      postBody: 'login='+login+'&password='+password,
                      onComplete: function(originalRequest){
                          reponse = originalRequest.responseText;
                          
                          if(reponse== "nok")
                          {
                            Dialog.info("<br><br>Ce pseudo n'existe pas...<br><br>",{className: "alphacube",closable:true, title: "Identification &eacute;chou&eacute;e", width:300, height:100});
                            retourAjax = false;
                          }
                          else if(reponse=="pbpass")
                          {
                             Dialog.info("<br><br>V&eacute;rifiez le mot de passe...<br><br>",{className: "alphacube",closable:true, title: "Identification &eacute;chou&eacute;e", width:300, height:100});
                             retourAjax = false;
                          }
                          else if(reponse=="valid")
                          {
                             Dialog.info("<br><br>Veuillez valider votre compte en cliquant sur le lien contenu dans l'email.<br><br>",{className: "alphacube",closable:true, title: "Identification &eacute;chou&eacute;e", width:300, height:100});
                             retourAjax = false;
                          }
						  else if(reponse=="bloque")
                          {
                             Dialog.info("<br><br>Votre compte &agrave; &eacute;t&eacute; bloqu&eacute; par un administrateur.<br/>Prenez contact avec eux pour d�bloquer votre compte.<br><br>",{className: "alphacube", title: "Identification &eacute;chou&eacute;e",closable:true, width:300, height:100});
                             retourAjax = false;
                          }
						  else if(reponse=="protec")
                          {
                             Dialog.info("<br><br>Votre compte est en mode vacances !<br/>Veuillez patienter pendant le d&eacute;lai minimal de 5 jours avant de vous reconnecter !<br><br>",{className: "alphacube",closable:true, title: "Identification &eacute;chou&eacute;e", width:300, height:100});
                             retourAjax = false;
                          }
						  else if(reponse=="noprotec")
                          {
                             Dialog.info("<br><br>Votre compte vient de quitter le mode vacances !<br><br>",{className: "alphacube",closable:true, title: "Identification &eacute;chou&eacute;e", width:300, height:100});
                             retourAjax = true;
                          }
                          else if(reponse=="ok")
                          {
                            retourAjax = true;
                          }
                      }
                      
                });
                
                       
               
		return retourAjax;
		
		
	}//fin else
}

