<!-- javascript document
		checked = 0;
		
		function checkbox(form,element){ //v3.0
if (checked == 0) {
document.getElementById('checkboxbullet').src = 'images/checkbox_bullet.gif';
checked = 1;
document.forms[form][element].value = 1;	}
else {
document.getElementById('checkboxbullet').src = 'images/spacercheckbox.gif';
checked = 0;
document.forms[form][element].value = 0;	}
}

		function checkboxes(id){
	switch(id) {
case 0:
document.getElementById(0).src = 'images/checkbox_bullet.gif';
document.getElementById(1).src = 'images/spacercheckbox.gif';
if (document.getElementById('shipping').value == 1) {
new Effect.Fade('shipform', {duration:0.3});
document.getElementById('verticalsep').style.height = "160px";
document.getElementById('vtab').style.height = "400px";
html = document.getElementsByTagName('html')[0]; html.style.height = '70%';
addaddress(0); }
break;

case 1:
document.getElementById(1).src = 'images/checkbox_bullet.gif';
document.getElementById(0).src = 'images/spacercheckbox.gif';
document.getElementById('verticalsep').style.height = "300px";
document.getElementById('vtab').style.height = "580px";
html = document.getElementsByTagName('html')[0]; html.style.height = '100%';
new Effect.Appear('shipform', {duration:0.3});
break;
	}
document.getElementById('shipping').value = id;
}

// check if its a text (no numbers or special caracters)
		function veriftext(texte, form, nameinput) {
		if (texte.length >0) {
var check = /^[^\\\&\$\[\]\(\)\{\}\^\?\*\+]+[^0-9]+$/;
if (((check.exec(texte)!=null) == false) || (texte.length <2)) {
showerror(form,nameinput,'texte');	}
else thatsok(form,nameinput);	}
else thatsok(form,nameinput);	}

// check if its a number (no letters or special caracters)
		function verifnumber(texte, form, nameinput) {
		if (texte.length >0) {
var check = /^[^\\\$\[\]\(\)\{\}\^\?\*]+[^a-z]+[^A-Z]+$/;
if (((check.exec(texte)!=null) == false) || (texte.length <2)) {
showerror(form,nameinput,'number');	}
else thatsok(form,nameinput);	}
else thatsok(form,nameinput);	}

// password check function
		function verifmdp(texte, form, nameinput) {
		if (texte.length >0) {
var check = /^[^ÀÂÇÈÉÊËÎÔÙÛàâçèéêëîôùû\\\.\$\[\]\(\)\{\}\^\?\*\+\-\&@\s]+$/;
if (((check.exec(texte)!=null) == false) || (texte.length <6) || (texte.length >15)) {
showerror(form,nameinput,nameinput);	}
else thatsok(form,nameinput);	}
else thatsok(form,nameinput);	}

// passwords match function
		function verifmdp2(texte,form,nameinput) {
if (texte.length >0) {
if (document.forms[form]['password'].value != texte) {
showerror(form,nameinput,nameinput);	}
else thatsok(form,nameinput);	}
else thatsok(form,nameinput);	}

// fonction de verification du format de l'email
		function retrievepassword(texte) {
if (texte.length >0) {

var xhr = getXhr();
xhr.open("POST","php/checkmail.php");
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send("email="+texte+"&mode=1");
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
reply = xhr.responseText;
if (reply == 1) document.getElementById('inputdata').innerHTML = errors["mailsent"];
if (reply == 2) document.getElementById('inputdata').innerHTML = errors["void"];
document.getElementById('buttonok').innerHTML = '<a href="javascript:cachetout()" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'ok\',\'\',\'images/ok_button_hover.gif\',1)"><img src="images/ok_button.gif" width="52" height="26" border="0" id="ok" /></a>';
}	}

}	}

// add new address as session var for the _ship.php page
	function addaddress(action) {
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
reply = xhr.responseText;
if (reply == 1) affiche_overlay_window(errors['addressadded']);
}	}
xhr.open("POST","php/add_address.php");
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send("action="+action+"&firstname="+document.forms['shipform'][0].value+"&name="+document.forms['shipform'][1].value+"&societe="+document.forms['shipform'][2].value+"&address="+document.forms['shipform'][3].value+"&zipcode="+document.forms['shipform'][4].value+"&city="+document.forms['shipform'][5].value+"&state="+document.forms['shipform'][6].value);
}


<!-- Rollover OK buttun fonctions -->
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->