var delivnom = "";
var delivprenom = "";
var delivadresse = "";
var delivcodepost = "";
var delivville = "";
var delivpays = "";


function InitSaveVariables(form) {
delivnom = form.delivnom.value;
delivprenom = form.delivprenom.value;
delivadresse = form.delivadresse.value;
delivcodepost = form.delivcodepost.value;
delivville = form.delivville.value;
delivpays = form.delivpays.value;
}

function ShipToBillPerson(form) {
if (form.copy.checked) {
InitSaveVariables(form);
form.delivnom.value = form.clubnom.value;
form.delivprenom.value = form.clubprenom.value;
form.delivadresse.value = form.clubadresse.value;
form.delivcodepost.value = form.clubcodepost.value;
form.delivville.value = form.clubville.value;
form.delivpays.value = form.clubpays.value;
}
else {
form.delivnom.value = delivnom;
form.delivprenom.value = delivprenom;
form.delivadresse.value = delivadresse;
form.delivcodepost.value = delivcodepost;
form.delivville.value = delivville;
form.delivpays.value = delivpays;
   }
}






function bookLocator(){
  var loc = 0;
  var codeString = new RegExp("\\d{5}", "g"); 
    if ((document.locator.postkey.value=="")||document.locator.postkey.value.search(codeString) == -1){
     loc=1;
     window.alert("Attention, tout code postal comprend 5 chiffres\t\t\n");
		 document.locator.postkey.focus();
     return;
  }
  if (loc==0){
   document.locator.submit();
     }
  return;
}



function replaceChars(entry) {
out = "'"; // replace this
add = ""; // with this
temp = "" + entry; // temporary holder

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
 resche(temp);
}
 
 
  



  function emptycart() {
	 if (confirm(' Are you sure to EMPTY ALL data on your shopping cart? Y/C','')){
	  self.location.href="http://www.savoirgagner.com/editions.php?ch=catlog&funct=addtocart&shot=resetcart";
		}else { return; }
}




function calcul(url,wid,hei,scroll){
  if(scroll==1) bars='yes';
	else bars='no';
  popwindow= open(url, "popwin","width=" + wid + "px,height==" + hei + "px,top=0,left=0;fullscreen=no,scrollbars==" + bars + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes");
}
function run(url) {
    setTimeout("top.location.href='" + url + "'",1500);
}



function resche(doit){
  var resc =0;
		  var sesrString =  /^[_0-9 a-z-éçèâàäùüîïûùµêëöô]*[_0-9 a-z-éçèâàäùüîïûùµêëöô]$/i;
      if ((doit=="")|| doit.search(sesrString) == -1){
     resc=1;
     window.alert("Pour rechercher...\n* il faut au moins un critère de recherche\n* pas de guillants\t\t\n");
		 document.resch.searchakey.focus();
     return;
  }
  if (resc==0){
   document.resch.submit();
     }
  return;
}



var isNav, isIE, intervalID3, intervalID4,flashTimer
var coll = ""
var styleObj = ""

if (parseInt(navigator.appVersion) >= 4){
if (navigator.appName =="Netscape") {
	  isNav= true
	}else{
	  isIE= true
	  coll = "all."
	  styleObj = ".style"
	}
}




var no=0;
var ap=0;
var re=0;

function stockcounter(no,ap,re){
var eal= ap+1;
stk=0;
  tedtogo="document.buy_"+no+".submit"; 


   if (re == ""){
	   stk=1;
     window.alert("\tSavoir Gagner\n\n To make a purchase you must state how many you would like to buy");
     return;
  }

   if (re >= eal){
	   stk=1;
	<!--	 window.alert(re+'>'+ap);  -->
     window.alert("\tSavoir Gagner\n\n You have requested to buy " + re + " livres !\n\nThis is more than we currently have available in stock online.\n\n To make a large order please contact the staff at Savoir Gagner \n\n \tor\n\n  Keep your request below "+ ap +" livres");
     return;
  }
  if (stk==0){
	
   tedtogo();
     }
  return;
	}

	
	
  var suzie;
	var insto;
	 stok=0;
	function verchange(id,suzie,insto){
 
	 
	  <!-- window.alert(insto);-->
		 	 
   if (suzie == ""){
	  stok=1;
     window.alert("\tSavoir Gagner\n\n To make a purchase you must state how many you would like to buy");
     return;
  }

   if (suzie > insto){
	   stok=1;
		  window.alert("\tSavoir Gagner\n\n You have requested to buy " + suzie + " livres !\n\nThis is more than we currently have available in stock online.\n\n To make a large order please contact the staff at Savoir Gagner \n\n \tor\n\n  Keep your request below "+ insto +" livres");
     self.location='editions.php?ch=catlog&funct=caddy&caddy=voir&act=viewcart';
		 return;
  }
	
  if (stok==0){
  	self.location='editions.php?ch=catlog&funct=addtocart&shot=update&id='+id+'&sl='+suzie+'';
     }
  return;
	}
	 
	
	
	
	
	
  var fluzie;
	var instob;
	 strok=0;
	function buychange(pid,fluzie,instob){
 
			 	 
   if (fluzie == ""){
	  strok=1;
     window.alert("\tSavoir Gagner\n\n To make a purchase you must state how many you would like to buy");
     return;
  }

   if (fluzie > instob){
	   strok=1;
		  window.alert("\tSavoir Gagner\n\n \n To make a large order please contact the staff at Savoir Gagner \n\nKeep your request below "+ instob +" livres");
     return;
  }
	
  if (strok==0){
  	self.location='editions.php?ch=catlog&funct=opts';
     }
  return;
	}
	
	
	<!--********************  Histoire Vraie Check **********************-->
	<!--********************  Histoire Vraie Check **********************-->
	<!--********************  Histoire Vraie Check **********************-->
	<!--********************  Histoire Vraie Check **********************-->
function histvraiecheck(){


  var histf = 0;
 	var histflatString =  /^[0-9a-z]*[0-9a-z]$/i;
	var histString =  /^[0-9]*[0-9]$/i;
 var histemailLine =  /^([_0-9a-z\.-])+@([_0-9a-z\.-])+[a-z]{2,3}$/i;

 
  if ((document.hist.livreNom.value == "")){
    histf=1;
     window.alert("Oh!!! et vous oubliez votre nom?!?! \n");
     document.hist.livreNom.focus();
     return;
  }
	
		  if (document.hist.livreEmail.value.search(histemailLine) == -1){
     clubf=1;
     window.alert("Pouvez -vous vérifier que votre adresse courriel soit correcte? merci\n");
     document.hist.livreEmail.focus();
     return;
  }

		  if (document.hist.livreSujet.value == ""){
     histf=1;
     window.alert(" Votre sujet ou titre du histoire SVP.\n");
     document.hist.livreSujet.focus();
     return;
  }
	
		 if (document.hist.livreMessage.value == ""){
     histf=1;
     window.alert("Votre texte SVP. \n");
     document.hist.livreMessage.focus();
     return;
  }
	



  if (histf==0){
   document.hist.submit();
     }
  return;
}
 
 <!--*******************************************************************-->

	



<!--********************  Club Check **********************-->
<!--********************  Club Check **********************-->
<!--********************  Club Check **********************-->

function clubregocheck(){


  var clubf = 0;
  var flatString =  /^[0-9a-z]*[0-9a-z]$/i;
	var numString =  /^[0-9 .]*[0-9 .]$/i;
 var emailLine =  /^([_0-9a-z\.-])+@([_0-9a-z\.-])+[a-z]{2,3}$/i;
 var codeString = new RegExp("\\d{5}", "g");
 
 
 
 <!--********************  check delviery **********************-->
 
 
 
	
	  if (document.clubform.delivnom.value == ""){
     clubf=1;
     window.alert("Oh!!! et vous oubliez votre nom?!?!. \n\n");
     document.clubform.delivnom.focus();
     return;
  }
	
  if (document.clubform.delivprenom.value == ""){
     clubf=1;
     window.alert("Oh!!! et vous oubliez votre prenom \n\nSAVOIR GAGNER\n"); 
		  document.clubform.delivprenom.focus();
		 return;
  }
	
  if (document.clubform.delivadresse.value == ""){
     clubf=1;
     window.alert("Oh! la commande nous l'envoyons au ciel, au Père Noêl? \n\nSAVOIR GAGNER\n");
     document.clubform.delivadresse.focus();
     return;
  }
	
	      
    if (document.clubform.delivcodepost.value==""){
     clubf=1;
     window.alert("Attention, tout code postal comprend 5 chiffres\n\nSAVOIR GAGNER\n");
     document.clubform.delivcodepost.focus();
     return;
  }
	    if (document.clubform.delivville.value==""){
		  clubf=1;
     window.alert("Sans la ville ou le village nous risquons fort un retour à l'envoyeur !!!\n\nCe serait dommage, non ?\n");
     document.clubform.delivville.focus();
     return;
  }
	    if (document.clubform.delivpays.value==""){
		  clubf=1;
     window.alert("Certes, nous sommes en Europe mais dans quel pays ?\n");
     document.clubform.delivpays.focus();
     return;
  }
	
	
 
 
  <!--********************  check facturation **********************-->
 
  
 
 
  if (document.clubform.clubnom.value == ""){
     clubf=1;
     window.alert("Oh!!! et vous oubliez votre nom?!?!. \n\n");
     document.clubform.clubnom.focus();
     return;
  }
	
  if (document.clubform.clubprenom.value == ""){
     clubf=1;
     window.alert("Oh!!! et vous oubliez votre prenom \n\nSAVOIR GAGNER\n"); 
		  document.clubform.clubprenom.focus();
		 return;
  }
	
  if (document.clubform.clubadresse.value == ""){
     clubf=1;
     window.alert("Oh! la commande nous l'envoyons au ciel, au Père Noêl? \n\nSAVOIR GAGNER\n");
     document.clubform.clubadresse.focus();
     return;
  }
	
	      
    if (document.clubform.clubcodepost.value==""){
     clubf=1;
     window.alert("Attention, tout code postal comprend 5 chiffres\n\nSAVOIR GAGNER\n");
     document.clubform.clubcodepost.focus();
     return;
  }
	
	     if (document.clubform.clubville.value==""){
		  
     clubf=1;
     window.alert("Sans la ville ou le village nous risquons fort un retour à l'envoyeur !!!\n\nCe serait dommage, non ?\n");
     document.clubform.clubville.focus();
     return;
  }
	   
		 
		 if (document.clubform.clubpays.value==""){
		 clubf=1;
     window.alert("Certes, nous sommes en Europe mais dans quel pays ?\n");
     document.clubform.clubpays.focus();
     return;
  }
	
	if (document.clubform.clubtel.value.search(numString) == -1){
     clubf=1;
     window.alert("Cela peut vous sembler indiscret, mais en cas de contre - temps, c'est bien commode, non ?\nPouvez - vous vérifier que votre téléphone soit correcte?\nSavoir Gagner \n");
     document.clubform.clubtel.focus();
     return;
  }
	
		  if (document.clubform.clubmail.value.search(emailLine) == -1){
     clubf=1;
     window.alert("Indispensable pour suivre votre commande.\n\nPouvez -vous vérifier que votre adresse courriel soit correcte? merci\nSavoir Gagner ");
     document.clubform.clubmail.focus();
     return;
  }
	
	
  if (clubf==0){
   document.clubform.submit();
     }
  return;
}
 
 <!--*******************************************************************-->

 







<!--********************  Club Check **********************-->
<!--********************  Club Check **********************-->
<!--********************  Club Check **********************-->

function clubrego(){


  var clubin = 0;
  var clubfString =  /^[_0-9 a-z-âçàäüûùµéèëêöô]*[_0-9 a-z-âéçèàäüûùëêöô]$/i;
	var flatString =  /^[0-9a-z]*[0-9a-z]$/i;
	var numString =  /^[0-9 .]*[0-9 .]$/i;
 var emailLine =  /^([_0-9a-z\.-])+@([_0-9a-z\.-])+[a-z]{2,3}$/i;
 var codeString = new RegExp("\\d{5}", "g");
 
 
 	
 
 
  <!--********************  check facturation **********************-->
 
  
 
 
  if (document.clubins.clubnom.value == ""){
     clubin=1;
     window.alert("Oh!!! et vous oubliez votre nom?!?!. \n\n");
     document.clubins.clubnom.focus();
     return;
  }
	
  if (document.clubins.clubprenom.value == ""){
     clubin=1;
     window.alert("Oh!!! et vous oubliez votre prenom \n\nSAVOIR GAGNER\n"); 
		  document.clubins.clubprenom.focus();
		 return;
  }
	
  if (document.clubins.clubadresse.value == ""){
     clubin=1;
     window.alert("Oh! la commande nous l'envoyons au ciel, au Père Noêl? \n\nSAVOIR GAGNER\n");
     document.clubins.clubadresse.focus();
     return;
  }
	
	      
    if (document.clubins.clubcodepost.value==""){
     clubin=1;
     window.alert("Attention, tout code postal comprend 5 chiffres\n\nSAVOIR GAGNER\n");
     document.clubins.clubcodepost.focus();
     return;
  }
	
	
	 if (document.clubins.clubville.value == ""){	
		  clubin=1;
     window.alert("Sans la ville ou le village nous risquons fort un retour à l'envoyeur !!!\n\nCe serait dommage, non ?\n");
     document.clubins.clubville.focus();
     return;
  }
	
	 	 if (document.clubins.clubpays.value == ""){
		 clubin=1;
     window.alert("Certes, nous sommes en Europe mais dans quel pays ?\n");
     document.clubins.clubpays.focus();
     return;
  }
	
	
	
	if (document.clubins.clubtel.value.search(numString) == -1){
     clubin=1;
     window.alert("Cela peut vous sembler indiscret, mais en cas de contre - temps, c'est bien commode, non ?\nPouvez - vous vérifier que votre téléphone soit correcte?\nSavoir Gagner \n");
     document.clubins.clubtel.focus();
     return;
  }
	
		  if (document.clubins.clubmail.value.search(emailLine) == -1){
     clubin=1;
     window.alert("Indispensable pour suivre votre commande.\n\nPouvez -vous vérifier que votre adresse courriel soit correcte? merci\nSavoir Gagner ");
     document.clubins.clubmail.focus();
     return;
  }
	
	
	
  if (clubin==0){
   document.clubins.submit();
     }
  return;
}
 
 <!--*******************************************************************-->

 




<!--******** open Print windows *************** -->
<!--******** open Print windows *************** -->
<!--******** open Print windows *************** -->
<!--******** open Print windows *************** -->
<!--******** open Print windows *************** -->
<!--******** open Print windows *************** -->





function openPress(pPresspic) {

// specify window parameters document.body.clientHeight window.innerWidth


var witPress=650;
var hitPress=550;
  PressPag = window.open("", "photo","width="+witPress+",height="+hitPress+",status,scrollbars,resizable,left=0,top=0");

// 	
   PressPag.document.write('<html><head><title> Savoir Gagner Le Presse</title>');	
	 PressPag.document.write('<style type="text/css"><!-- ');
	 PressPag.document.write('body{scrollbar-base-color: #ffffff; scrollbar-shadow-color: #dddddd; scrollbar-highlight-color: #eeeeee; scrollbar-3dlight-color: #aaaaaa;scrollbar-darkshadow-color: #aaaaaa; scrollbar-track-color: #dddddd;  scrollbar-arrow-color: #aaaaaa;background-color:#ffffff; } ');
	 PressPag.document.write(' //--></style>');
	 PressPag.document.write('</head>');	
   PressPag.document.write('<BODY BGCOLOR=#000000 TEXT=#FFFFCC LINK=#33CCFF VLINK=#FF6666>');
   PressPag.document.write('<center>');
   PressPag.document.write('<img src="' + pPresspic + '" alt="' + pPresspic + '"><p>');
   PressPag.document.write('<a href="#" onClick="self.close()">Fermer</a><br>');  
   PressPag.document.write('<p></font></body></html>');
   PressPag.document.close();	
	

// If we are on NetScape, we can bring the window to the front
	if (navigator.appName.substring(0,8) == "Netscape") 
 PressPag.focus();
}





function openInsert(pImageName) {

// specify window parameters document.body.clientHeight window.innerWidth

var wit=380;
var hit=550;
  extraPag = window.open("", "imag","width="+wit+",height="+hit+",status,scrollbars,resizable,left=0,top=0");

// 	
   extraPag.document.write('<html><head><title> Savoir Gagner</title>');
	 extraPag.document.write('<style type="text/css"><!-- ');
	 extraPag.document.write('body{scrollbar-base-color: #ffffff; scrollbar-shadow-color: #dddddd; scrollbar-highlight-color: #eeeeee; scrollbar-3dlight-color: #aaaaaa;scrollbar-darkshadow-color: #aaaaaa; scrollbar-track-color: #dddddd;  scrollbar-arrow-color: #aaaaaa;background-color:#ffffff; } ');
	 extraPag.document.write(' //--></style>');
	 extraPag.document.write('</head>');	
   extraPag.document.write('<BODY BGCOLOR=#000000 TEXT=#FFFFCC LINK=#33CCFF VLINK=#FF6666>');
   extraPag.document.write('<center>');
   extraPag.document.write('<img src="vas/catelog/gallery/larp/' + pImageName + '" alt="' + pImageName + '"><p>');
   extraPag.document.write('<a href="#" onClick="javascript:window.print()">Imprimer</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
	 extraPag.document.write('<a href="#" onClick="self.close()">Fermer</a><br>');  
   extraPag.document.write('<p></font></body></html>');
   extraPag.document.close();	
	

	if (navigator.appName.substring(0,8) == "Netscape"){ 
 extraPag.focus();
}

}




function PrintCommande(print,windowComman,typeofComman,idrow,bge){
  if(! window.focus)
    return;

  
  var printComman=window.open("vas/catelog/inprintCommande.php?chprint="+ typeofComman +"&oreder="+ idrow +"&badge="+ bge +"",windowComman,'height=580,width=620,dependent=yes,scrollbars=yes');
  printComman.focus();

 
}






function openPrintPageCatAdmin(print,windowPrint,typeofPrint,idcode){
  if(! window.focus)
    return;

  
  var printWin=window.open("vas/catelog/inprintcat.php?chprint="+ typeofPrint +"&rowid="+ idcode +"",windowPrint,'height=580,width=620,dependent=yes,scrollbars=yes');
  printWin.focus();

 
}



function openPrintPageCat(print,windowPrint,typeofPrint,idcode,url){
  if(! window.focus)
    return;

  
  var printWin=window.open(""+ url +"vas/catelog/inprintcat.php?chprint="+ typeofPrint +"&rowid="+ idcode +"",windowPrint,'height=580,width=620,dependent=yes,scrollbars=yes');
  printWin.focus();

 
}





function openPrintPageCatListAdmin(print,windowPrint,typeofPrint,cat,page,mark,onoff,nextpage,url){
  if(! window.focus)
    return;

  
  var printWin=window.open(""+ url +"vas/catelog/inprintcat.php?chprint="+ typeofPrint +"&kategory="+ cat +"&catpageno="+ page +"&brande="+ mark+"&searchakey="+ keys +"&onswitch="+ onoff +"&debut="+ nextpage +"",windowPrint,'height=560,width=620,dependent=yes,scrollbars=yes');
  printWin.focus();

 
}


function openPrintPageCatList(print,windowPrint,typeofPrint,cat,page,mark,keys,onoff,nextpage,url,pag){
  if(! window.focus)
    return;

  
  var printWin=window.open(""+ url +"vas/catelog/inprintcat.php?chprint="+ typeofPrint +"&kategory="+ cat +"&catpageno="+ page +"&brande="+ mark+"&searchakey="+ keys +"&onswitch="+ onoff +"&debut="+ nextpage +"&page="+ pag +"",windowPrint,'height=560,width=620,dependent=yes,scrollbars=yes');
  printWin.focus();

 
}







<!--******************** join email form check* *********************-->



function joinemail(){


  var em = 0;
  var emailString =  /^([_0-9a-z\.-])+@([_0-9a-z\.-])+[a-z]{2,3}$/i;
  var textString =  /^[_0-9 a-z-âéçè'àùûêëöô]*[_0-9 a-z-âéçè'àùûêëöô]$/i;
  var passString = /^[_0-9a-z]*[_0-9a-z]$/i;
 

  if (document.emaildiff.prenom.value.search(textString) == -1){
     em=1;
     window.alert("Oh !!! et vous oubliez votre prenom?!?!\t\t\n");
     document.emaildiff.prenom.focus();
     return;
  }



  if (document.emaildiff.nom.value.search(textString) == -1){
     em=1;
     window.alert("Oh !!! et vous oubliez votre nom?!?!\t\t\n");
     document.emaildiff.nom.focus();
     return;
  }
    if (document.emaildiff.email.value.search(emailString) == -1){
     em=1;
     window.alert("Pouvez-vous vérifier que votre adresse courriel soit correcte? merci\t\t\n");
     document.emaildiff.email.focus();
     return;
  }

   
  if (em==0){


   document.emaildiff.submit();
   
  }
  return;
}





//-->

