function avant_arriere(photo_av,photo_ar){
	obj('im_man').src=photo_ar
	
}
function charger_mensuration(code){
	codetai=obj('slttai').value
	codeuni=obj('sltuni').value
	load_page("mensuration_detail.php?codetai="+codetai+"&codeuni="+codeuni+"&code="+code,'id_mensuration')
}
function valider(){
	var tc,tcm
	tc=obj('tc').value
	tcm=obj('tcm').value
	tc=eval(tc)
	tcm=eval(tcm)

	if((tc >= tcm) ||(tc<10)){
		alert("La mesure du tour de ceinture ne correspond pas a cette taille veuillez choisir la taille supperieur")
		obj('tc').focus()
		return false
	}else{
		th=obj('tth').value
		tcu=obj('ttcu').value
		ej=obj('eja').value
		tj=obj('etj').value
		mo=obj('emo').value


		tai=obj('slttai').value
		uni=obj('sltuni').value



		data="&tc="+tc
		data+="&th="+th
		data+="&tcu="+tcu
		data+="&ej="+ej
		
		data+="&tj="+tj
		data+="&mo="+mo

		data+="&tai="+tai
		data+="&uni="+uni
	//alert("actions.php?actions=panier"+data)
	http.open("POST", "actions.php?actions=panier"+data, true);
	http.onreadystatechange = rec_panier;
	http.send(null);
	return false
	}
}
function rec_panier(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			
			document.location='mon_panier.php';
	}
}
function galerie_valider(){
	var tc,tcm
	tc=obj('tc').value
	tcm=obj('tcm').value
	tc=eval(tc)
	tcm=eval(tcm)

	if((tc >= tcm) ||(tc<10)){
		alert("La mesure du tour de ceinture ne correspond pas a cette taille veuillez choisir la taille supperieur")
		obj('tc').focus()
		return false
	}else{
		th=obj('tth').value
		tcu=obj('ttcu').value
		ej=obj('eja').value
		ej=obj('eja').value
		tj=obj('etj').value
		mo=obj('emo').value
		
		tai=obj('slttai').value
		uni=obj('sltuni').value
		data="&tc="+tc
		data+="&th="+th
		data+="&tcu="+tcu
		data+="&ej="+ej
		
		data+="&tj="+tj
		data+="&mo="+mo
		
		data+="&tai="+tai
		data+="&uni="+uni
	//alert("../../actions.php?actions=galerie_panier"+data)
	http.open("POST", "../../actions.php?actions=galerie_panier"+data, true);
	http.onreadystatechange = rec_gal_panier;
	http.send(null);
	return false
	}
}
function rec_gal_panier(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			//alert(results)
			document.location='../../mon_panier.php';
	}
}

function initaliser(code){
			data='&codemodel='+code
	
		//alert("panier_actions.php?actions=initaliser"+data);
		http.open("POST", "panier_actions.php?actions=initaliser"+data, true);
		http.onreadystatechange = rec_init;
		http.send(null);
}
function rec_init() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
		//alert(results)
		if (results[0]==1){
		document.location='personnalisation.php?model='+results[2]
		
		}
		//afficher_message(results[1],'id_message',1)
	}
}
function changer_face(codemodel,codedel){
		data="&codemodel="+codemodel
		data+="&codedel="+codedel
		//alert("panier_actions.php?actions=changer_face&"+data);
		http.open("POST", "panier_actions.php?actions=changer_face&"+data, true);
		http.onreadystatechange = rec_aj_cf;
		http.send(null);
//obj('idtis').src="tissus/"+tisphoto;
}
function rec_aj_cf() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
		//alert(results)
		//afficher_message(results[1],'id_message',1)
	
			if (results[0]==1){
				man=results[2];
				obj('im_man').src="../uploads/mannequins/"+man;
					//obj('actions').value="aj_photos"
					//obj('txtcode').value=results[2]
					
				}	

	}
}
function supprimer_element(code){
	
	if (confirm("Voulez vous supprimer cet aricle du panier ")){
	//alert("actions.php?actions=supprimer_element&code="+code)
		http.open("POST", "actions.php?actions=supprimer_element&code="+code, true);
		http.onreadystatechange = rec_aj_se;
		http.send(null);
	}
	return false
}
function rec_aj_se() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
		cible('mon_panier.php')
	}
}
function modifier_qte(ref,qte){
	//alert("actions.php?actions=modifier_qte&ref="+ref+"&qte="+qte)
		http.open("POST", "actions.php?actions=modifier_qte&ref="+ref+"&qte="+qte, true);
		http.onreadystatechange = rec_aj_se;
		http.send(null);
}
function valider_adresse(){
	if(obj('txtnom').value==""){
	alert("le champs nom est obligatoire")
	obj('txtnom').focus()
	return false;
	}
	if(obj('txtprenom').value==""){
	alert("le champs prénom est obligatoire")
	obj('txtprenom').focus()
	return false;
	}
	if(obj('sltpay').value==""){
	alert("le champs pays est obligatoire")
	obj('txtpays').focus()
	return false;
	}
	if(obj('txtville').value==""){
	alert("le champs ville est obligatoire")
	obj('txtville').focus()
	return false;
	}
	if(obj('txtadresse').value==""){
	alert("le champs adresse est obligatoire")
	obj('txtadresse').focus()
	return false;
	}
	if(obj('txtcp').value==""){
	alert("le champs codepostal est obligatoire")
	obj('txtcp').focus()
	return false;
	}
	if(obj('txttel').value==""){
	alert("le champs t&eacute;l est obligatoire")
	obj('txttel').focus()
	return false;
	}
	vnom=obj('txtnom').value
	vprenom=obj('txtprenom').value
	vpays=obj('sltpay').value
	vville=obj('txtville').value
	vadresse=obj('txtadresse').value
	vcp=obj('txtcp').value
	vtel=obj('txttel').value
	vnom=obj('txtnom').value
	vcadeau=obj('txtcadeau').value
	
	data="&nom="+vnom
	data+="&prenom="+vprenom
	data+="&pays="+vpays
	data+="&ville="+vville
	data+="&adresse="+vadresse
	data+="&cp="+vcp
	data+="&tel="+vtel
	data+="&cadeau="+vcadeau
	
	//alert("actions.php?actions=adresse"+data)
	http.open("POST", "actions.php?actions=adresse"+data, true);
	http.onreadystatechange = rec_adresse;
	http.send(null);
	return false
	
}
function rec_adresse(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			//alert(results)
			if(results[0]==1)
			{document.location='mon_recap.php';
			}else{
				alert("vos informations ne sont pas envoyés");
			}
			//
	}
}
function panier_inscription(){
	if(obj('txtlog').value==''){
		alert('veuillez entrer votre login')
		obj('txtlog').focus()
		return false
	}
	if(obj('txtpass').value==''){
		alert('veuillez entrer votre mot de passe')
		obj('txtpass').focus()
		return false
	}
	if(obj('txtcpass').value==''){
		alert('veuillez confirmer votre mot de passe')
		obj('txtcpass').focus()
		return false
	}
	login=obj('txtlog').value
	pass=obj('txtpass').value
	cpass=obj('txtcpass').value
	if(pass!=cpass){
	alert("Mot de passe et confirmer mot de passe ne coincident pas")
	return false
		
	}
	
	data="&login="+login
	data+="&pass="+pass
	
//alert("actions.php?actions=adresse"+data)
	http.open("POST", "actions.php?actions=ins"+data, true);
	http.onreadystatechange = rec_ins;
	http.send(null);
	return false
	
}
function rec_ins(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
		//	alert(results[0])
			if(results[0]==1)
			{document.location='mon_adresse.php';
			}else{
				alert("vos informations ne sont pas envoyés");
			}
			//
	}
}
function acces_inscription(){
	
	if(obj('txtlog').value==''){
		alert('veuillez entrer votre login')
		obj('txtlog').focus()
		return false
	}
	if(obj('txtpass').value==''){
		alert('veuillez entrer votre mot de passe')
		obj('txtpass').focus()
		return false
	}
	if(obj('txtcpass').value==''){
		alert('veuillez confirmer votre mot de passe')
		obj('txtcpass').focus()
		return false
	}
		
	login=obj('txtlog').value
	pass=obj('txtpass').value
	cpass=obj('txtcpass').value
	if(pass!=cpass){
	alert("Mot de passe et confirmer mot de passe ne coincident pas")
	return false
		
	}
	
	data="&login="+login
	data+="&pass="+pass
	
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=ins"+data, true);
	http.onreadystatechange = rec_ins2;
	http.send(null);
	return false
	
}
function rec_ins2(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			var urlCourant = document.location;
			//alert(results)
			if(results[0]==1)
			{

			window.location.reload()
			}else{
				alert(results[1]);
			}
			//
	}
}
function dg_inscription(){
	if(obj('txtlog').value==''){
		alert('veuillez entrer votre login')
		obj('txtlog').focus()
		return false
	}
	if(obj('txtpass').value==''){
		alert('veuillez entrer votre mot de passe')
		obj('txtpass').focus()
		return false
	}
	if(obj('txtcpass').value==''){
		alert('veuillez confirmer votre mot de passe')
		obj('txtcpass').focus()
		return false
	}
	login=obj('txtlog').value
	pass=obj('txtpass').value
	
	data="&login="+login
	data+="&pass="+pass
	

	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=ins"+data, true);
	http.onreadystatechange = rec_ins2_;
	http.send(null);
	return false
	
}
function rec_ins2_(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			//alert(results[0])
			if(results[0]==1)
			{document.location='http://www.domyjeans.fr/mon_compte.php';
			}else{
				alert(results[1]);
			}
			//
	}
}
function connection3(){
	if(obj('txtlog').value=='Votre login')
	{
	alert('champs login obligatoire')
	obj('txtlog').focus()
	return false;
	}
	if(!verifier_champ_email('txtlog','Login','id_message4')) return false
	if(obj('txtpass').value=='Password')
	{
	alert('champs mot de passe obligatoire')
	obj('txtpass').focus()
	return false;
	}
	vlogin=obj('txtlog').value
	vpass=obj('txtpass').value
	data="&login="+vlogin
	data+="&pass="+vpass
	//alert("http://www.domyjeans.fr/actions.php?actions=authentification"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=authentification"+data, true);
	http.onreadystatechange = rec_auth3;
	http.send(null);
	return false
	
}
function rec_auth3() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		//alert(results[3]);
		if (results[0]==1){
			if(results[3]==0){
			document.location="http://www.domyjeans.fr/mon_adresse.php"
			}else{
			document.location="http://www.domyjeans.fr/mon_panier.php"	
			}
			
		}else{
			afficher_message(results[1],'id_message4',1)				
		}
	}//readyState
}
function connection3_(){
	if(obj('txtlog').value=='Votre login')
	{
	alert('champs login obligatoire')
	obj('txtlog').focus()
	return false;
	}
	if(!verifier_champ_email('txtlog','Login','id_message4')) return false
	if(obj('txtpass').value=='Password')
	{
	alert('champs mot de passe obligatoire')
	obj('txtpass').focus()
	return false;
	}
	vlogin=obj('txtlog').value
	vpass=obj('txtpass').value
	data="&login="+vlogin
	data+="&pass="+vpass
	//alert("actions.php?actions=authentification"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=authentification"+data, true);
	http.onreadystatechange = rec_auth3_;
	http.send(null);
	return false
	
}
function rec_auth3_() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="http://www.domyjeans.fr/mon_compte.php"
			
		}else{
			afficher_message(results[1],'id_message4',1)				
		}
	}//readyState
}
function mailaa(){

	if ( obj('txtlog').value=="Votre login" ) {
			obj('txtlog').value=""
	}else if (obj('txtlog').value==""){
		obj('txtlog').value="Votre login"
	}
}
function login_mailbb(){

	if ( obj('txtpassword').value=="Password" ) {
			obj('txtpassword').value=""
	}else if (obj('txtpassword').value==""){
		obj('txtpassword').value="Password"
	}
}
function login_mailaa(){

	if ( obj('txtlogin').value=="Votre login" ) {
			obj('txtlogin').value=""
	}else if (obj('txtlogin').value==""){
		obj('txtlogin').value="Votre login"
	}
}
function mailbb(){

	if ( obj('txtpass').value=="Password" ) {
			obj('txtpass').value=""
	}else if (obj('txtpass').value==""){
		obj('txtpass').value="Password"
	}
}
function promotion(){
	if(obj('txtcode').value=='')
	{
	alert('champs code promotion obligatoire')
	obj('txtcode').focus()
	return false;
	}
	
	vcodep=obj('txtcode').value
	
	data="&codep="+vcodep
	//alert("actions.php?actions=promotion"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=promotion"+data, true);
	http.onreadystatechange = rec_pro;
	http.send(null);
	return false
	
}
function rec_pro() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="mon_recap.php"
			
		}else{
			afficher_message(results[1],'id_message5',1)				
		}
	}//readyState
}
function choix_paiement(code){

	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=choix_paiement&code="+code, true);
	http.onreadystatechange = rec_choix;
	http.send(null);
	return false
	
}
function rec_choix() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		
		
	}//readyState
}
function commander_pro(){
	
	if(obj('chkcad').disabled)
	{
		alert("veuillez cliquer sur les CONDITIONS GENERALES DE VENTE EN LIGNE DOMYJEANS")
	return false
	}
	if(!obj('chkcad').checked)
	{
		alert("vous devez cocher la case 'J'ai bien pris connaissance des conditions' ")
	return false
	}
//alert("actions.php?actions=commander_pro")
	http.open("POST", "actions.php?actions=commander_pro", true);
	http.onreadystatechange = rec_commander_pro;
	http.send(null);
	return false
	
}
function rec_commander_pro() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="paiement_promotion.php"
			
		}else{
			afficher_message(results[1],'id_message5',1)				
		}
		
	}//readyState
}


function commander(){
	
	if(obj('chkcad').disabled)
	{
		alert("veuillez cliquer sur les CONDITIONS GENERALES DE VENTE EN LIGNE DOMYJEANS")
	return false
	}
	if(!obj('chkcad').checked)
	{
		alert("vous devez cocher la case 'J'ai bien pris connaissance des conditions' ")
	return false
	}
//alert("actions.php?actions=commander")
	http.open("POST", "actions.php?actions=commander", true);
	http.onreadystatechange = rec_commander;
	http.send(null);
	return false
	
}
function commander1(){
	
	
	
http.open("POST", "http://www.domyjeans.fr/actions.php?actions=commander1", true);
	http.onreadystatechange = rec_commander1;
	http.send(null);
	return false
	
}
function rec_commander1() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="mon_adresse.php?codecommande="+results[2]
			
		}else{
			afficher_message(results[1],'id_message5',1)				
		}
		
	}//readyState
}
function rec_commander() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="paiement_cb.php?codecommande="+results[2]
			
		}else{
			afficher_message(results[1],'id_message5',1)				
		}
		
	}//readyState
}
function commander_pp(){
	
	if(obj('chkcad').disabled)
	{
		alert("veuillez cliquer sur les CONDITIONS GENERALES DE VENTE EN LIGNE DOMYJEANS")
	return false
	}
	if(!obj('chkcad').checked)
	{
		alert("vous devez cocher la case 'J'ai bien pris connaissance des conditions' ")
	return false
	}

http.open("POST", "actions.php?actions=commander", true);
	http.onreadystatechange = rec_commanderpp;
	http.send(null);
	return false
	
}
function rec_commanderpp() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="paiement_paypal.php?codecommande="+results[2]
			
		}else{
			afficher_message(results[1],'id_message5',1)				
		}
		
	}//readyState
}
function cadeau(){

cad=(obj('chkcadeau').checked)?1:0
if(cad==0)
		{
		obj('cadeau').style.visibility='hidden'
		obj('cadeau').value=""
		}else
		{
		obj('cadeau').style.visibility='visible'
		}
}
function activer_cb()
{
obj('chkcad').disabled='';
}
function activer_paiement()
{
	
}
function profil_editer(){
	nom=obj('txtnom').value
	prenom=obj('txtprenom').value
	tel=obj('txttel').value
	fax=obj('txtfax').value
	email=obj('txtemail').value
	adresse=obj('txtadresse').value
	ville=obj('txtville').value
	cp=obj('txtcp').value
	pays=obj('sltpay').value
	if (confirm("Voulez vous editer votre profil ? ")){
		data="&nom="+nom
		data+="&prenom="+prenom
		data+="&tel="+tel
		data+="&fax="+fax
		data+="&email="+email
		data+="&adresse="+adresse
		data+="&ville="+ville
		data+="&cp="+cp
		data+="&pays="+pays
		
	//alert("actions.php?actions=profil_editer"+data)
	http.open("POST", "actions.php?actions=profil_editer"+data, true);
	http.onreadystatechange = rec_pe;
	http.send(null);
	}
	return false
	
}
function rec_pe() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			afficher_message(results[1],'id_message_pro',1)	
			
		}else{
			afficher_message(results[1],'id_message_pro',1)				
		}
		
	}//readyState
}

function tracking(ref)
{
	obj('actions').value='track'
	obj('txttack_n').value=ref
	obj('formtrack').method='post'
	obj('formtrack').action='tracking.php'
	obj('formtrack').submit()
}
function verif_formulaire()
{

   if(document.formulaire.txtnom.value == "") {
   alert("Veuillez entrer votre nom!");
   document.formulaire.txtnom.focus();
   return false;
  }
 if(document.formulaire.txtprenom.value == "")  {
   alert("Veuillez entrer votre prenom!");
   document.formulaire.txtprenom.focus();
   return false;
  }
  if(document.formulaire.txttel.value == "")  {
   alert("Veuillez entrer votre téléphone!");
   document.formulaire.txttel.focus();
   return false;
  }
  
  
    var chkZ = 1;
 for(i=0;i<document.formulaire.txttel.value.length;++i)
   if(document.formulaire.txttel.value.charAt(i) < "0"
   || document.formulaire.txttel.value.charAt(i) > "9")
     chkZ = -1;
 if(chkZ == -1) {
   alert("Veuillez entrer seulement les chiffres!");
   document.formulaire.txttel.focus();
   return false;
  }
  

   if(document.formulaire.txtemail.value.indexOf('@') == -1) {
   alert("Veuillez entrer une adresse email valide!");
   document.formulaire.txtemail.focus();
   return false;
  }
  
  

 if(document.formulaire.txtverif.value == "") {
   alert("Veuillez entrer le code afficher!");
   document.formulaire.txtverif.focus();
   return false;
  }
 var chkZ = 1;
 for(i=0;i<document.formulaire.tel.value.length;++i)
   if(document.formulaire.tel.value.charAt(i) < "0"
   || document.formulaire.tel.value.charAt(i) > "9")
     chkZ = -1;
 if(chkZ == -1) {
   alert("Veuillez entrer seulement les chiffres!");
   document.formulaire.tel.focus();
   return false;
  }
}
function changer_captcha(){
	http.open("POST", "actions.php?actions=captcha", true);
	http.onreadystatechange = rec_captcha;
	http.send(null);
	
}
function rec_captcha(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
		
			obj('captcha').src='securimage_show.php?sid='+results[1]
			//document.location='contact.php';
	}
}
function charger_titre(code){
	http.open("POST", "actions.php?actions=titre&titre="+code, true);
	http.onreadystatechange = rec_titre;
	http.send(null);
}
function rec_titre(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
		
			
			//document.location='contact.php';
	}
}
function galerie_ajouter_panier(code){
	http.open("POST", "../../actions.php?actions=galerie_ajou_panier&code="+code, true);
	http.onreadystatechange = rec_g;
	http.send(null);
	}
	function rec_g(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			if(results[0]==1){
				//alert(results)
				document.location='mensurations.php';
			}
	}
}




function mensuration_entrer(code){
	codeuni =obj('sltuni').value
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=mensuation_tc&code="+code+"&uni="+codeuni, true);
	http.onreadystatechange = rec_tc;
	http.send(null);
}
function mensuration_entrer_th(code){
	codeuni =obj('sltuni').value
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=mensuation_th&code="+code+"&uni="+codeuni, true);
	http.onreadystatechange = rec_tc;
	http.send(null);
}
function mensuration_entrer_tcu(code){
	codeuni =obj('sltuni').value
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=mensuation_tcu&code="+code+"&uni="+codeuni, true);
	http.onreadystatechange = rec_tc;
	http.send(null);
}
function mensuration_entrer_ej(code){
	codeuni =obj('sltuni').value
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=mensuation_ej&code="+code+"&uni="+codeuni, true);
	http.onreadystatechange = rec_tc;
	http.send(null);
}
function mensuration_entrer_tj(code){
	codeuni =obj('sltuni').value
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=mensuation_tj&code="+code+"&uni="+codeuni, true);
	http.onreadystatechange = rec_tc;
	http.send(null);
}
function mensuration_entrer_mo(code){
	codeuni =obj('sltuni').value
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=mensuation_mo&code="+code+"&uni="+codeuni, true);
	http.onreadystatechange = rec_tc;
	http.send(null);
}


function rec_tc(){
	if (http.readyState == 4) {
			results = http.responseText.split("::");
			
				//alert(results)
	}
			
}

function login_connection(){
	if(obj('txtlogin').value=='Votre login')
	{
	alert('champs login obligatoire')
	obj('txtlogin').focus()
	return false;
	}
	if(!verifier_champ_email('txtlogin','Login','id_message4')) return false
	if(obj('txtpassword').value=='Password')
	{
	alert('champs mot de passe obligatoire')
	obj('txtpassword').focus()
	return false;
	}
	vlogin=obj('txtlogin').value
	vpass=obj('txtpassword').value
	data="&login="+vlogin
	data+="&pass="+vpass
	//alert("http://www.domyjeans.fr/actions.php?actions=authentification"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=authentification"+data, true);
	http.onreadystatechange = rec_log;
	http.send(null);
	return false
	
}
function rec_log() {
	if (http.readyState == 4) {
		//alert(http.responseText)
			var urlCourant = document.location;
		results = http.responseText.split("::");
		if (results[0]==1){
			window.location.reload()
			
		}else{
		alert(results[1]);
			//afficher_message(results[1],'id_message3',1)				
		}
	}//readyState
}

function login_inscription(){
	if(obj('txtlog').value==''){
		alert('veuillez entrer votre login')
		obj('txtlog').focus()
		return false
	}
	if(obj('txtpass').value==''){
		alert('veuillez entrer votre mot de passe')
		obj('txtpass').focus()
		return false
	}
	if(obj('txtcpass').value==''){
		alert('veuillez confirmer votre mot de passe')
		obj('txtcpass').focus()
		return false
	}
	login=obj('txtlog').value
	pass=obj('txtpass').value
	cpass=obj('txtcpass').value
	if(pass!=cpass){
	alert("Mot de passe et confirmer mot de passe ne coincident pas")
	return false
		
	}
	
	data="&login="+login
	data+="&pass="+pass
	
//alert("actions.php?actions=adresse"+data)
http.open("POST", "http://www.domyjeans.fr/actions.php?actions=ins"+data, true);
	http.onreadystatechange = rec_login_ins;
	http.send(null);
	
}
function rec_login_ins(){
	if (http.readyState == 4) {
		//alert(http.responseText)
			var urlCourant = document.location;
		results = http.responseText.split("::");
		if (results[0]==1){
			window.location.reload()
			
		}else{
		alert(results[1]);
			//afficher_message(results[1],'id_message3',1)				
		}
	}//readyState
}
function login_panier_inscription(){
	if(obj('txtlog').value==''){
		alert('veuillez entrer votre login')
		obj('txtlog').focus()
		return false
	}
	if(obj('txtpass').value==''){
		alert('veuillez entrer votre mot de passe')
		obj('txtpass').focus()
		return false
	}
	if(obj('txtcpass').value==''){
		alert('veuillez confirmer votre mot de passe')
		obj('txtcpass').focus()
		return false
	}
	login=obj('txtlog').value

	pass=obj('txtpass').value
	cpass=obj('txtcpass').value
	if(pass!=cpass){
	alert("Mot de passe et confirmer mot de passe ne coincident pas")
	return false
		
	}
	
	data="&login="+login
	data+="&pass="+pass
	
//alert("actions.php?actions=adresse"+data)
	http.open("POST", "actions.php?actions=ins"+data, true);
	http.onreadystatechange = rec_log_ins;
	http.send(null);
	return false
	
}
function rec_log_ins(){
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="http://www.domyjeans.fr/mon_compte.php"
			
		}else{
			afficher_message(results[1],'id_message4',1)				
		}
	}//readyState
}
function login_connection3(){
	if(obj('txtlogin').value=='Votre login')
	{
	alert('champs login obligatoire')
	obj('txtlogin').focus()
	return false;
	}
	if(!verifier_champ_email('txtlogin','Login','id_message4')) return false
	if(obj('txtpassword').value=='Password')
	{
	alert('champs mot de passe obligatoire')
	obj('txtpassword').focus()
	return false;
	}
	vlogin=obj('txtlogin').value
	vpass=obj('txtpassword').value
	data="&login="+vlogin
	data+="&pass="+vpass
	//alert("http://www.domyjeans.fr/actions.php?actions=authentification"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=authentification"+data, true);
	http.onreadystatechange = rec_log_auth3;
	http.send(null);
	return false
	
}
function rec_log_auth3() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			document.location="http://www.domyjeans.fr/mon_compte.php"
			
		}else{
			afficher_message(results[1],'id_message4',1)				
		}
	}//readyState
}



function login_panier_inscription_(){
	if(obj('txtlog').value==''){
		alert('veuillez entrer votre login')
		obj('txtlog').focus()
		return false
	}
	if(obj('txtpass').value==''){
		alert('veuillez entrer votre mot de passe')
		obj('txtpass').focus()
		return false
	}
	if(obj('txtcpass').value==''){
		alert('veuillez confirmer votre mot de passe')
		obj('txtcpass').focus()
		return false
	}
	login=obj('txtlog').value
	pass=obj('txtpass').value
	cpass=obj('txtcpass').value
	if(pass!=cpass){
	alert("Mot de passe et confirmer mot de passe ne coincident pas")
	return false
		
	}
	
	data="&login="+login
	data+="&pass="+pass
	
//alert("actions.php?actions=adresse"+data)
	http.open("POST", "actions.php?actions=ins"+data, true);
	http.onreadystatechange = rec_log_ins_;
	http.send(null);
	return false
	
}
function rec_log_ins_(){
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			
			document.location="http://www.domyjeans.fr/mon_adresse.php"
			
			
		}else{
			afficher_message(results[1],'id_message4',1)				
		}
	}//readyState
}
function login_connection3_(){
	if(obj('txtlogin').value=='Votre login')
	{
	alert('champs login obligatoire')
	obj('txtlogin').focus()
	return false;
	}
	if(!verifier_champ_email('txtlogin','Login','id_message4')) return false
	if(obj('txtpassword').value=='Password')
	{
	alert('champs mot de passe obligatoire')
	obj('txtpassword').focus()
	return false;
	}
	vlogin=obj('txtlogin').value
	vpass=obj('txtpassword').value
	data="&login="+vlogin
	data+="&pass="+vpass
	//alert("http://www.domyjeans.fr/actions.php?actions=authentification"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=authentification"+data, true);
	http.onreadystatechange = rec_log_auth3_;
	http.send(null);
	return false
	
}
function rec_log_auth3_() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			if(results[3]==0){
			document.location="http://www.domyjeans.fr/mon_adresse.php"
			}else{
			document.location="http://www.domyjeans.fr/mon_panier.php"	
			}
			
		}else{
			afficher_message(results[1],'id_message4',1)				
		}
	}//readyState
}

function passe_oublie(){
	if(obj('txtcode').value=='')
	{
	alert('Veuillez saisir votre email')
	obj('txtcode').focus()
	return false;
	}
	if(!verifier_champ_email('txtcode','Email','id_message5')){
	//alert('Adresse email non valid')
	obj('txtcode').focus()	
	return false
	}
	
	vcodep=obj('txtcode').value
	
	data="&login="+vcodep
	//alert("http://127.0.0.1/Projets/DMJ-PROD-28MAI2010_090710/actions.php?actions=passe_oublie"+data)
	http.open("POST", "http://www.domyjeans.fr/actions.php?actions=passe_oublie"+data, true);
	http.onreadystatechange = rec_pass_oub;
	http.send(null);
	return false
	
}
function rec_pass_oub() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("::");
		if (results[0]==1){
			alert(results[1])
						
		}else{
			alert(results[1])
		}
	}//readyState
}
