function Ajax_Connect(Requete_php){var xhr_object=null;if(window.XMLHttpRequest)
xhr_object=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object=new ActiveXObject("Microsoft.XMLHTTP");else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4){eval(unescape(xhr_object.responseText));}}
xhr_object.open("POST",Requete_php,true);xhr_object.setRequestHeader("Content-type","application/x-www-form-urlencoded");return(xhr_object);};function Ajax_Spiner(State){if(State==true){window.document.getElementById('Fog_Layer').style.display='block';var sHtml;sHtml='<div style="text-align:center; margin-top:200px;"><div style="height:70px; width:300px; background-color:#FFFFFF; margin-left:auto; margin-right:auto; border: 3px solid #D66327;  -moz-border-radius : 10px ; -webkit-border-radius: 10px; -khtml-border-radius: 10px ; border-radius : 10px ; "><div style="margin-top:10px;"><span style="font-weight:bold;">Please wait...</span></div><div><img src="../Img/please_wait_01.gif"/></div></div></div>';window.document.getElementById('Fog_Layer').innerHTML=sHtml;}else{window.document.getElementById('Fog_Layer').innerHTML="";window.document.getElementById('Fog_Layer').style.display='none';}}
function Ajax_Send_Data(Array_Php_Var,Requete_php){var Array_Data=new Array();var i;var String_Post=new String();var Add_and="";Array_Data=Array_Php_Var.split('|');for(i=0;i<Array_Data.length;i++){String_Post=String_Post+Add_and+Array_Data[i];Add_and="&";}
var xhr_object=null;xhr_object=Ajax_Connect(Requete_php);xhr_object.send(String_Post);}
function Ajax_Send_Form(Id_Form,Array_Php_Var,Requete_php){var Add_and,Add_and_Data,String_Form_Post,String_Var_Post=new String();var Array_Campo_Form=new Array();var Array_Data=new Array();var i;Add_and="";Add_and_Data="";String_Form_Post="";String_Var_Post="";if(Array_Php_Var!=''){Array_Data=Array_Php_Var.split('|');Add_and_Data="&";for(i=0;i<Array_Data.length;i++){String_Var_Post=String_Var_Post+Add_and_Data+Array_Data[i];}}
Array_Campo_Form=window.document.getElementById(Id_Form).elements;if(Id_Form!=''){for(i=0;i<Array_Campo_Form.length;i++){if(Array_Campo_Form[i].type=='checkbox'){String_Form_Post=String_Form_Post+Add_and+Array_Campo_Form[i].name+"="+Array_Campo_Form[i].checked;}else if(Array_Campo_Form[i].type=='radio'){if(Array_Campo_Form[i].checked){String_Form_Post=String_Form_Post+Add_and+Array_Campo_Form[i].name+"="+Array_Campo_Form[i].value;}}else{var String_Value=escape(Array_Campo_Form[i].value);String_Form_Post=String_Form_Post+Add_and+Array_Campo_Form[i].name+"="+String_Value;}
Add_and="&";var intype=Array_Campo_Form[i].getAttribute('input_type');if(intype!=null)
intype=intype.toUpperCase();var required=Array_Campo_Form[i].getAttribute('required');if(required!=null)
required=required.toUpperCase();var ok=true;switch(intype)
{case'PRICE':ok=Verify_Price(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'EMAIL':ok=Verify_Email(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'WEBSITE':ok=Verify_Website(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'INTEGER':ok=Verify_Integer(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'TEXT':ok=Verify_Text(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'FLOAT':ok=Verify_Float(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'PHONE':ok=Verify_Phone(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'POSTCODE':ok=Verify_Postcode(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'PASSWORD':ok=Verify_Password(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;case'DATE':ok=Verify_Date(Array_Campo_Form[i].id,Array_Campo_Form[i].value,required);break;default:break;}
if(!ok){alert(Error_Message);return;}}}
var xhr_object=null;xhr_object=Ajax_Connect(Requete_php);xhr_object.send(String_Form_Post+String_Var_Post);}
function Verify_Price(Id_Campo,Value_Price,required)
{var error=0;Error_Message="";if(isNaN(Value_Price)||Value_Price<0){error=1;Error_Message="Incorrect Price";}
if(Value_Price.indexOf(".")=="-1"&&Value_Price!=""&&error!=1)
document.getElementById(Id_Campo).value=Value_Price+".00";if(required=='YES'&&Value_Price==""){error=1;Error_Message="Required Price";}
if(required!='YES'&&Value_Price==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Email(Id_Campo,Value_Email,required)
{var error=0;Error_Message="";var expresion=/^([a-zA-Z0-9_\.\-^'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!expresion.test(Value_Email)){error=1;Error_Message="Incorrect E-mail";}
if(required=='YES'&&Value_Email==""){error=1;Error_Message="Required E-mail";}
if(required!='YES'&&Value_Email==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Integer(Id_Campo,Value_Integer,required)
{var error=0;Error_Message="";if(isNaN(Value_Integer)||Value_Integer<0){error=1;Error_Message="Incorrect value. Must be an integer.";}
if(Value_Integer.indexOf(".")!="-1"){error=1;Error_Message="Incorrect value. Must be an integer."}
if(required=='YES'&&Value_Integer==""){error=1;Error_Message="Required Integer value";}
if(required!='YES'&&Value_Integer==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Float(Id_Campo,Value_Float,required)
{var error=0;Error_Message="";if(isNaN(Value_Float)||Value_Float<0){error=1;Error_Message="Incorrect value. It must be a real number.";}
if(required=='YES'&&Value_Float==""){error=1;Error_Message="Required real number value.";}
if(required!='YES'&&Value_Float==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Website(Id_Campo,Value_Website,required)
{var error=0;Error_Message="";var expresion=/^(?:(http|https):\/\/)?(?:[\w-]+\.)+[a-z]{2,6}$/;if(!expresion.test(Value_Website)){error=1;Error_Message="Incorrect website value";}
if(required=='YES'&&Value_Website==""){error=1;Error_Message="Required Website.";}
if(required!='YES'&&Value_Website==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Text(Id_Campo,Value_Text,required)
{var error=0;Error_Message="";if(required=='YES'&&Value_Text==""){error=1;Error_Message="Required text";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Phone(Id_Campo,Value_Phone,required)
{var error=0;Error_Message="";if(Value_Phone.length<9||Value_Phone.length>16){error=1;Error_Message="Incorrect phone format";}
if(required=='YES'&&Value_Phone==""){error=1;Error_Message="Required Phone or Fax";}
if(required!='YES'&&Value_Phone==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Postcode(Id_Campo,Value_Postcode,required)
{var error=0;Error_Message="";var expresion=/^([a-zA-Z0-9])+$/;if(!expresion.test(Value_Postcode)){error=1;Error_Message="Incorrect Postcode";}
if(Value_Postcode.length>5){error=1;Error_Message="Incorrect Postcode";}
if(required=='YES'&&Value_Postcode==""){error=1;Error_Message="Required Postcode";}
if(required!='YES'&&Value_Postcode==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Verify_Password(Id_Campo,Value_Password,required)
{var error=0;Error_Message="";var expresion=/^([a-zA-Z0-9])+$/;if(!expresion.test(Value_Password)){error=1;Error_Message="Incorrect Password. Only alphanumeric passwords accepted";}
if(Value_Password.length!=8){error=1;Error_Message="Incorrect Password. The password must have 8 characters";}
if(required=='YES'&&Value_Password==""){error=1;Error_Message="Required Phone or Fax";}
if(required!='YES'&&Value_Password==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Confirm_Password(Id_pwd_1,Id_pwd_2){var pwd1=document.getElementById(Id_pwd_1).value;var pwd2=document.getElementById(Id_pwd_2).value;if(pwd1==pwd2){document.getElementById(Id_pwd_1).style.borderColor=Valid_Border_Color;document.getElementById(Id_pwd_1).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_pwd_1).style.borderStyle=Valid_Style;document.getElementById(Id_pwd_2).style.borderColor=Valid_Border_Color;document.getElementById(Id_pwd_2).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_pwd_2).style.borderStyle=Valid_Style;Error_Message="";return true;}else{document.getElementById(Id_pwd_1).style.borderColor=Error_Border_Color;document.getElementById(Id_pwd_1).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_pwd_1).style.borderStyle=Error_Style;document.getElementById(Id_pwd_2).style.borderColor=Error_Border_Color;document.getElementById(Id_pwd_2).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_pwd_2).style.borderStyle=Error_Style;Error_Message="Incorrect repited password.";alert(Error_Message);return false;}}
function Confirm_Email(Id_email_1,Id_email_2){var email1=document.getElementById(Id_email_1).value;var email2=document.getElementById(Id_email_2).value;if(email1==email2){document.getElementById(Id_email_1).style.borderColor=Valid_Border_Color;document.getElementById(Id_email_1).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_email_1).style.borderStyle=Valid_Style;document.getElementById(Id_email_2).style.borderColor=Valid_Border_Color;document.getElementById(Id_email_2).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_email_2).style.borderStyle=Valid_Style;Error_Message="";return true;}else{document.getElementById(Id_email_1).style.borderColor=Error_Border_Color;document.getElementById(Id_email_1).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_email_1).style.borderStyle=Error_Style;document.getElementById(Id_email_2).style.borderColor=Error_Border_Color;document.getElementById(Id_email_2).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_email_2).style.borderStyle=Error_Style;Error_Message="Incorrect repited mail.";alert(Error_Message);return false;}}
function Verify_Date(Id_Campo,Value_Date,required)
{var error=0;Error_Message="";var expresion=/^\d{2}\-\d{2}\-\d{4}$/;if(!expresion.test(Value_Date)){var expresion=/^\d{4}-\d{2}\-\d{2}$/;if(!expresion.test(Value_Date)){error=1;Error_Message="Incorrect Date format.";}}
if(required=='YES'&&Value_Date==""){error=1;Error_Message="Required Date";}
if(required!='YES'&&Value_Date==""){error=0;Error_Message="";}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Error_Message="";document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}};var Valid_Backgroung_Color="#DDFFDD";var Valid_Border_Color="#00CC00";var Valid_Style="solid ";var Error_Backgroung_Color="#FFC6C6";var Error_Border_Color="#D50000";var Error_Style="dashed ";function Control_Digit(Id_Campo){var verif=document.getElementById(Id_Campo).value;if(isNaN(verif)==true){alert("Error : insert number (ex : 35 ) !!!");document.getElementById(Id_Campo).value="";return false;}else{return true}}
function Control_Email(Id_Campo,Current_Email,Type_Email)
{var error=0;if(document.getElementById(Id_Campo).value.indexOf("@")=="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf(".")=="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("*")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("/")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("'")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf(",")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("+")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("?")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("(")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf(")")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf("<")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value.indexOf(">")!="-1"){error=1;}
if(document.getElementById(Id_Campo).value==""){error=1;}
if(error==1){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Confirm_Email(Id_email_1,Id_email_2){var email1=document.getElementById(Id_email_1).value;var email2=document.getElementById(Id_email_2).value;if(email1==email2){document.getElementById(Id_email_1).style.borderColor=Valid_Border_Color;document.getElementById(Id_email_1).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_email_1).style.borderStyle=Valid_Style;return true;}else{document.getElementById(Id_email_1).style.borderColor=Error_Border_Color;document.getElementById(Id_email_1).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_email_1).style.borderStyle=Error_Style;return false;}}
function Control_Select(Id_Campo,Name_Campo){var verif=document.getElementById(Id_Campo).value;if((verif==undefined)||(verif=="0")){document.getElementById(Id_Campo).value="";document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Control_Select_Void_Values(Id_Campo,Name_Campo){var verif=document.getElementById(Id_Campo).value;if(verif=="VOID"){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Control_Text(Id_Campo,Name_Campo){var verif=document.getElementById(Id_Campo).value;if((verif==undefined)||(verif=="")){document.getElementById(Id_Campo).value="";document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}}
function Control_Login(Id_Campo,Name_Campo,Login_User){var verif=document.getElementById(Id_Campo).value;if((verif==undefined)||(verif=="")){document.getElementById(Id_Campo).value="";document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{Is_Exist_Login(document.getElementById(Id_Campo).value,Id_Campo,Login_User,"./Ajax/Ajx_Exist_Login.php");return true;}}
function Control_Date(Date_form){var Date_f=document.getElementById(Date_form).value;if(Date_f==""){document.getElementById(Date_form).style.borderColor=Error_Border_Color;document.getElementById(Date_form).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Date_form).style.borderStyle=Error_Style;return false;}else{if(Date_f.search(/-/)==-1){document.getElementById(Date_form).style.borderColor=Error_Border_Color;document.getElementById(Date_form).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Date_form).style.borderStyle=Error_Style;return false;}else{var Select_Date=(Date_f).split("-")
if((Select_Date.length!=3)||isNaN(parseInt(Select_Date[0]))||isNaN(parseInt(Select_Date[1]))||isNaN(parseInt(Select_Date[2]))){document.getElementById(Date_form).style.borderColor=Error_Border_Color;document.getElementById(Date_form).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Date_form).style.borderStyle=Error_Style;return false;}else{document.getElementById(Date_form).style.borderColor=Valid_Border_Color;document.getElementById(Date_form).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Date_form).style.borderStyle=Valid_Style;return true;}}}}
function Control_Num_Tajeta(Id_Campo){var verif=document.getElementById(Id_Campo).value;var string=verif+"";if(isNaN(verif)==true){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{if((string.length>=14)&&(string.length<=16)){document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}else{document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}}}
function Control_Num_Tajeta_4dig(Id_Campo){var verif=document.getElementById(Id_Campo).value;var string=verif+"";if(isNaN(verif)==true){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{if(string.length==4){document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}else{document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}}}
function Control_Date_Tajeta(Id_Campo){var verif=document.getElementById(Id_Campo).value;var month=verif.substring(0,2);var year=verif.substring(3,5);if((month>=1)&&(month<=12)){var Current_Year=new Date();var CurrentYear=Current_Year.getFullYear();if(((parseInt(year)+2000)>=CurrentYear)&&(year<=99)){document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}else{document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}}else{document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}}
function Control_Secu_Code(Id_Campo){var verif=document.getElementById(Id_Campo).value;var string=verif+"";if(isNaN(verif)==true){document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}else{if(string.length==3){document.getElementById(Id_Campo).style.borderColor=Valid_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Valid_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Valid_Style;return true;}else{document.getElementById(Id_Campo).style.borderColor=Error_Border_Color;document.getElementById(Id_Campo).style.backgroundColor=Error_Backgroung_Color;document.getElementById(Id_Campo).style.borderStyle=Error_Style;return false;}}}
function Control_Adv_Field(Type_Field,Format,Id_Field){}
function Please_Wait()
{var pop_up='<div style="margin-top:150px; margin-left:auto; margin-right:auto; width:400px; background-color:#FFFFFF;border:2px solid #006699;">';pop_up+='<div class="Option_Sub_Layer_Title" style="height:25px; margin-left:auto; margin-right:auto;">';pop_up+='<div style="height:25px;font-size:20px;"><span>Please wait...</span></div>';pop_up+='</div>';pop_up+='<div style="float:left; width:50px;display:none"><img alt=\'Please Wait\' src=\'Img/Purchase/Correcto.png\'/></div>';pop_up+='<div style="float:left; width:50px;display:none"><img alt=\'Please Wait\' src=\'Img/Purchase/Error.png\'/></div>';pop_up+='<div style="min-height:300px; margin-top:15px;">';pop_up+='<div style=" width:375px; height:40px; margin-left:25px;" id="step1">';pop_up+='<div style="float:left; width:50px;"><img alt=\'Please Wait\' src=\'Img/Purchase/loadinfo2.gif\'/></div>';pop_up+='<div style="float:left; width:300px;">Verify personal data</div>';pop_up+='</div>';pop_up+='<div style=" width:375px; height:40px; margin-left:25px;" id="step2">';pop_up+='</div>';pop_up+='<div style=" width:375px; height:40px; margin-left:25px;" id="step3">';pop_up+='</div>';pop_up+='<div style=" width:375px; height:40px; margin-left:25px;" id="step4">';pop_up+='</div>';pop_up+='<div style=" width:375px; height:40px; margin-left:25px;" id="step5">';pop_up+='</div>';pop_up+='<div style=" width:375px; height:40px; margin-left:25px;" id="step6">';pop_up+='</div>';pop_up+='<div style=" width:300px; height:40px; margin-left:100px;" id="button">';pop_up+='</div>';pop_up+='</div>';pop_up+='<div>';window.document.getElementById('Fog_Layer').style.display='block';window.document.getElementById('Fog_Layer').innerHTML=pop_up;};var outp;var Search_Destination;var oldins;var posi=-1;var words=10;var input;var key;function Autocomplete(Destination)
{window.document.getElementById('City').value='';window.document.getElementById('Country').value='';window.document.getElementById('Id_City').value='';window.document.getElementById('Id_Country').value='';Search_Destination=document.getElementById(Destination);init(Destination);}
function Destination_Selected(Place,City,Country,Id_City,Id_Country)
{window.document.getElementById('Destination').value=Place;window.document.getElementById('Autocomplete').style.display='none';window.document.getElementById('City').value=City;window.document.getElementById('Country').value=Country;window.document.getElementById('Id_City').value=Id_City;window.document.getElementById('Id_Country').value=Id_Country;}
function init(Destination){outp=document.getElementById("Autocomplete");document.getElementById(Destination).onkeydown=keygetter;document.getElementById(Destination).onkeyup=keyHandler;}
function setColor(_posi,_color,_forg){outp.childNodes[_posi].style.background=_color;outp.childNodes[_posi].style.color=_forg;}
function keygetter(event){if(!event&&window.event)event=window.event;if(event)key=event.keyCode;else key=event.which;}
function keyHandler(event){var textfield=document.getElementsByName("Destination")[0];if(key==40){if(outp.childNodes.length>0&&posi<outp.childNodes.length-1){if(posi>=0)
setColor(posi,"#FFFFFF","#0088AA");else
input=textfield.value;setColor(++posi,"#D5E5FF","#0088AA");textfield.value=outp.childNodes[posi].firstChild.nodeValue;}}
else if(key==38){if(outp.childNodes.length>0&&posi>=0){if(posi>=1){setColor(posi,"#fff","#0088AA");setColor(--posi,"#D5E5FF","#0088AA");textfield.value=outp.childNodes[posi].firstChild.nodeValue;}
else{setColor(posi,"#fff","#0088AA");textfield.value=input;textfield.focus();posi--;}}}
else if(key==27){textfield.value=input;document.getElementById('Autocomplete').style.display='none';posi=-1;oldins=input;}
else if(key==8){posi=-1;oldins=-1;Ajax_Send_Data(Search_Destination.name+'='+Search_Destination.value,'Ajax/Ajx_Autocomplete.php');}
else if(key==13){aux=outp.childNodes[posi];Destination_Selected(aux.firstChild.nodeValue,aux.childNodes[1].value,aux.childNodes[2].value,aux.childNodes[3].value,aux.childNodes[4].value);posi=-1;oldins=-1;}
else
Ajax_Send_Data(Search_Destination.name+'='+Search_Destination.value,'Ajax/Ajx_Autocomplete.php');}
var mouseHandler=function(){for(var i=0;i<words.length;++i)
setColor(i,"white","black");this.style.background="blue";this.style.color="white";}
var mouseHandlerOut=function(){this.style.background="white";this.style.color="black";}
var mouseClick=function(){document.getElementsByName("text")[0].value=this.firstChild.nodeValue;setVisible("hidden");posi=-1;oldins=this.firstChild.nodeValue;}
