var erreurcname='Please enter your name';var erreuraddress='Please enter your address';var erreuremail='Please enter a proper e-mail address.';var erreurcity='Please enter your city';var erreurcounty='Please enter your county.';var erreurpostcode='Please enter your postcode.';var erreurphone='Please enter a correct phone number.';var erreurprice='Please enter a price';var CouleurFondChampsFaux='red';var CouleurChampsFaux='white';var CouleurFondChampsJuste='#8DD503';var retourne=true;function cname(){if(document.forms[1].elements['cname'].value.length<1){document.forms[1].getElementsByTagName('p')['ecname'].innerHTML=erreurcname;document.forms[1].elements['cname'].style.background=CouleurFondChampsFaux;document.forms[1].elements['cname'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['ecname'].innerHTML='';document.forms[1].elements['cname'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function email(){if(document.forms[1].elements['email'].value==""||document.forms[1].elements['email'].value.indexOf('@',0)==-1||document.forms[1].elements['email'].value.indexOf('.',0)==-1){document.forms[1].getElementsByTagName('p')['eemail'].innerHTML=erreuremail;document.forms[1].elements['email'].style.background=CouleurFondChampsFaux;document.forms[1].elements['email'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['eemail'].innerHTML='';document.forms[1].elements['email'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function address(){if(document.forms[1].elements['address'].value==""){document.forms[1].getElementsByTagName('p')['eaddress'].innerHTML=erreuraddress;document.forms[1].elements['address'].style.background=CouleurFondChampsFaux;document.forms[1].elements['address'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['eaddress'].innerHTML='';document.forms[1].elements['address'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function city(){if(document.forms[1].elements['city'].value==""){document.forms[1].getElementsByTagName('p')['ecity'].innerHTML=erreurcity;document.forms[1].elements['city'].style.background=CouleurFondChampsFaux;document.forms[1].elements['city'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['ecity'].innerHTML='';document.forms[1].elements['city'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function county(){if(document.forms[1].elements['county'].value==""){document.forms[1].getElementsByTagName('p')['ecounty'].innerHTML=erreurcounty;document.forms[1].elements['county'].style.background=CouleurFondChampsFaux;document.forms[1].elements['county'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['ecounty'].innerHTML='';document.forms[1].elements['county'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function postcode(){if(document.forms[1].elements['postcode'].value==""){document.forms[1].getElementsByTagName('p')['epostcode'].innerHTML=erreurpostcode;document.forms[1].elements['postcode'].style.background=CouleurFondChampsFaux;document.forms[1].elements['postcode'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['epostcode'].innerHTML='';document.forms[1].elements['postcode'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function phone(){if(isNaN(document.forms[1].elements['phone'].value)==true){document.forms[1].getElementsByTagName('p')['ephone'].innerHTML=erreurphone;document.forms[1].elements['phone'].style.background=CouleurFondChampsFaux;document.forms[1].elements['phone'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['ephone'].innerHTML='';document.forms[1].elements['phone'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function price(){if(document.forms[1].elements['postcode'].value==""){document.forms[1].getElementsByTagName('p')['eprice'].innerHTML=erreurprice;document.forms[1].elements['price'].style.background=CouleurFondChampsFaux;document.forms[1].elements['price'].style.color=CouleurChampsFaux;retourne=false;return false;}
else{document.forms[1].getElementsByTagName('p')['eprice'].innerHTML='';document.forms[1].elements['price'].style.background=CouleurFondChampsJuste;retourne=true;return true;}}
function valid(){if(cname()==false||email()==false||address()==false||city()==false||postcode()==false||phone()==false){return false;}
else{return true;}}
function validprice(){if(cname()==false||email()==false||price()==false){return false;}
else{return true;}}
