/* ##########################################
 * #	FONCTIONS DIVERSES					#
 * #	Mis a jour le 26 juin 2007			#
 * ##########################################
 * 
 * 
 * 
 * 
 * 
 * 
 */

/*
 * FONCTION DE POPUP SANS LES SCROLL BAR
 */
function popup(target,width,height){
   if(window.innerWidth){
	   LeftPosition =(window.innerWidth-width)/2;
	   TopPosition =((window.innerHeight-height)/4)-50;
    }
   else{
	   LeftPosition =(parseInt(window.screen.width)-width)/2;
	   TopPosition=((parseInt(window.screen.height)-height)/2)-50;
    }
 	//attribut: no scrollBar
   attr = 'resizable=no,scrollbars=no,location=no,width=' + width + ',height=' +
   height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
   TopPosition + '';
  
   popWin=open(target, 'GLENAT', attr);
 }
 
  
 /*
  * FONCTION POPUP AVEC SCROLLBAR
  */ 
 function popup2(target,width,height){
   if(window.innerWidth){
	   LeftPosition =(window.innerWidth-width)/2;
	   TopPosition =((window.innerHeight-height)/4)-50;
    }
   else{
	   LeftPosition =(parseInt(window.screen.width)-width)/2;
	   TopPosition=((parseInt(window.screen.height)-height)/2)-50;
    }
   //attribut: Scrollable
   attr = 'resizable=no,scrollbars=yes,location=no,width=' + width + ',height=' +
   height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
   TopPosition + '';
  
   popWin=open(target, 'GLENAT', attr);
 }
 
 /*
 * FONCTION DE POPUP simple POUR OUVRIR LES LIVRE 
 */
function openGlenat(URL){
	attr = 'resizable=yes,toolbar=yes' ;
	new_win = window.open(URL, 'GLENAT', attr);
}  

/*
 * FONCTION Qui va fermer la fenetre html d'appel du script
 * utilisé pour fermé l'OEKAKI
 */
function CloseWindow(){
	window.opener = self;
  	window.close();
}
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
 /*
  * FONCTION POUR GERER LE SWITCH DE QUESTIONS DANS LA FAQ
  */
function setFAQ(maReponse,maQuestion,nbFaq){		
	for(var i=1; i<(nbFaq+1);i++){				
		var divFaq=document.getElementById('faq_reponse'+i);				
		divFaq.style.display='none';		
	}
	var divVisible=document.getElementById(maReponse);				
	divVisible.style.display='block';						
	document.getElementById("current_question").innerHTML=document.getElementById(maQuestion).innerHTML	;	
}

/*
 * FONCTION DE SUBMIT DE LA NEWSLETTER
 */
function submitNewsletter(){
	var myForm=document.getElementById("formNewsletter");
	var email=document.getElementById("newsletterEmail").value;
	
	var url="http://v2.mlmgr.com/forms.pl?splio-0="+email+"&couleur=%23e7ddb7&splio-list=11020&splio-12=La+lettre+Gl%E9nat+BD&splio-12=La+lettre+Gl%E9nat+Manga";
	var url="http://s3s.fr/form?univers=glenat&cssurl="+escape("http://www.glenatmanga.com/css/form.css")+"&email="+email+"&listes[]=1";
	popup2(url,'600','450');		
}
/*
 * FONCTION DE SOUMISSION DE FORMULAIRE
 */
function submitForm(idForm) {
	var myForm=document.getElementById(idForm);
	myForm.submit();
}
/*
 * FONCTION POUR ENLEVER LE CADRE D'ALERTE DES INPUTS ( monGlenat )
 */
function reInitMyInput(myInput){
	var monInput=document.getElementById(myInput)
	monInput.style.backgroundColor='white';

}
