/* ######## AJEX ##########*/

/* ######## COUNTRY-STATE ##########*/

function showHint(str) {

    if (str.length == 0) {

        document.getElementById("state").innerHTML = "";

        return;

    } else {

        var xmlhttp = new XMLHttpRequest();

        xmlhttp.onreadystatechange = function() {

            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

                document.getElementById("state").innerHTML = xmlhttp.responseText;

            }

        }



        xmlhttp.open("GET", "getstate.php?q=" + str, true);

        xmlhttp.send();

    }

}

/* ######## COUNTRY-STATE ##########*/

/* ######## AJEX ##########*/

/* ######## CONTACT US ##########*/

function validcontact()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.contact.name.value == "")

{

document.getElementById("error").innerHTML="Please enter Name";

document.contact.name.style.borderColor="red";

document.contact.name.focus();

return false;

}



if(!testName.test(document.contact.name.value))

{

document.getElementById("error").innerHTML="Please enter only character Name";

document.contact.name.style.borderColor="red";

document.contact.name.focus();

return false;

}

else if(document.contact.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.contact.name.style.borderColor="";

document.contact.email.style.borderColor="red";

document.contact.email.focus();

return false;

}

if(!validate_char.test(document.contact.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.contact.name.style.borderColor="";

document.contact.email.style.borderColor="red";

document.contact.email.focus();

return false;

}

else if(document.contact.phone.value == "")

{

document.getElementById("error").innerHTML="Please enter Phone";

document.contact.name.style.borderColor="";

document.contact.email.style.borderColor="";

document.contact.phone.style.borderColor="red";

document.contact.phone.focus();

return false;

}

if(!num.test(document.contact.phone.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.contact.name.style.borderColor="";

document.contact.email.style.borderColor="";

document.contact.phone.style.borderColor="red";

document.contact.phone.focus();

return false;

}

else if(document.contact.phone.value.length<10)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.contact.name.style.borderColor="";

document.contact.email.style.borderColor="";

document.contact.phone.style.borderColor="red";

document.contact.phone.focus();

return false;

}

else if(document.contact.phone.value.length>11)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.contact.name.style.borderColor="";

document.contact.email.style.borderColor="";

document.contact.phone.style.borderColor="red";

document.contact.phone.focus();

return false;

}

else 

return true;



}

/* ######## CONTACT US ##########*/

/* ######## REGISTER ##########*/

function validregister()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.register.name.value == "")

{

document.getElementById("error").innerHTML="Please enter Name";

document.register.name.style.borderColor="red";

document.register.name.focus();

return false;

}



if(!testName.test(document.register.name.value))

{

document.getElementById("error").innerHTML="Please enter only character Name";

document.register.name.style.borderColor="red";

document.register.name.focus();

return false;

}

else if(document.register.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="red";

document.register.email.focus();

return false;

}

if(!validate_char.test(document.register.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="red";

document.register.email.focus();

return false;

}

else if(document.register.phone.value == "")

{

document.getElementById("error").innerHTML="Please enter Phone";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="";

document.register.phone.style.borderColor="red";

document.register.phone.focus();

return false;

}

if(!num.test(document.register.phone.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="";

document.register.phone.style.borderColor="red";

document.register.phone.focus();

return false;

}

else if(document.register.phone.value.length<10)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="";

document.register.phone.style.borderColor="red";

document.register.phone.focus();

return false;

}

else if(document.register.phone.value.length>11)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="";

document.register.phone.style.borderColor="red";

document.register.phone.focus();

return false;

}



else if(document.register.password.value == "")

{

document.getElementById("error").innerHTML="Please enter password";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="";

document.register.phone.style.borderColor="";

document.register.password.style.borderColor="red";

document.register.password.focus();

return false;

}

else if(document.register.password.value.length<6)

{

document.getElementById("error").innerHTML="Please take password mor than 6 digits";

document.register.name.style.borderColor="";

document.register.email.style.borderColor="";

document.register.phone.style.borderColor="";

document.register.password.style.borderColor="red";

document.register.password.focus();

return false;

}

else 

return true;



}

/* ######## REGISTER ##########*/

/* ######## LOGIN ##########*/

function validlogin()

{

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.login.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.login.email.style.borderColor="red";

document.login.email.focus();

return false;

}

if(!validate_char.test(document.login.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.login.email.style.borderColor="red";

document.login.email.focus();

return false;

}

else if(document.login.password.value == "")

{

document.getElementById("error").innerHTML="Please enter Password";

document.login.email.style.borderColor="";

document.login.password.style.borderColor="red";

document.login.password.focus();

return false;

}



else 

return true;



}

/* ######## LOGIN ##########*/

/* ######## FORGOT PASSWORD ##########*/

function validforgotpassword()

{

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.forgotpass.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.forgotpass.email.style.borderColor="red";

document.forgotpass.email.focus();

return false;

}

if(!validate_char.test(document.forgotpass.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.forgotpass.email.style.borderColor="red";

document.forgotpass.email.focus();

return false;

}



else 

return true;



}

/* ######## FORGOT PASSWORD ##########*/

/* ######## MY-ACCOUNT (UPDATE PROFILE) ##########*/

function validupdateprofile()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.updateprofile.name.value == "")

{

document.getElementById("error").innerHTML="Please enter Name";

document.updateprofile.name.style.borderColor="red";

document.updateprofile.name.focus();

return false;

}



if(!testName.test(document.updateprofile.name.value))

{

document.getElementById("error").innerHTML="Please enter only character Name";

document.updateprofile.name.style.borderColor="red";

document.updateprofile.name.focus();

return false;

}

else if(document.updateprofile.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="red";

document.updateprofile.email.focus();

return false;

}

if(!validate_char.test(document.updateprofile.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="red";

document.updateprofile.email.focus();

return false;

}

else if(document.updateprofile.phone.value == "")

{

document.getElementById("error").innerHTML="Please enter Phone";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="red";

document.updateprofile.phone.focus();

return false;

}

if(!num.test(document.updateprofile.phone.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="red";

document.updateprofile.phone.focus();

return false;

}

else if(document.updateprofile.phone.value.length<10)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="red";

document.updateprofile.phone.focus();

return false;

}

else if(document.updateprofile.phone.value.length>11)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="red";

document.updateprofile.phone.focus();

return false;

}

else if(document.updateprofile.postalcode.value == "")

{

document.getElementById("error").innerHTML="Please enter Postal Code";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="red";

document.updateprofile.postalcode.focus();

return false;

}

if(!num.test(document.updateprofile.postalcode.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="red";

document.updateprofile.postalcode.focus();

return false;

}

else if(document.updateprofile.postalcode.value.length<6)

{

document.getElementById("error").innerHTML="Please take Postal Code number of 6 digits";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="red";

document.updateprofile.postalcode.focus();

return false;

}

else if(document.updateprofile.postalcode.value.length>6)

{

document.getElementById("error").innerHTML="Please take Postal Code of 6 digits";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="red";

document.updateprofile.postalcode.focus();

return false;

}

else if(document.updateprofile.city.value == "")

{

document.getElementById("error").innerHTML="Please enter City";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="";

document.updateprofile.city.style.borderColor="red";

document.updateprofile.city.focus();

return false;

}



if(!testName.test(document.updateprofile.city.value))

{

document.getElementById("error").innerHTML="Please enter only character";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="";

document.updateprofile.city.style.borderColor="red";

document.updateprofile.city.focus();

return false;

}

else if(document.updateprofile.country.value == "")

{

document.getElementById("error").innerHTML="Please select Country";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="";

document.updateprofile.city.style.borderColor="";

document.updateprofile.country.style.borderColor="red";

document.updateprofile.country.focus();

return false;

}

else if(document.updateprofile.state.value == "")

{

document.getElementById("error").innerHTML="Please select State";

document.updateprofile.name.style.borderColor="";

document.updateprofile.email.style.borderColor="";

document.updateprofile.phone.style.borderColor="";

document.updateprofile.postalcode.style.borderColor="";

document.updateprofile.city.style.borderColor="";

document.updateprofile.country.style.borderColor="";

document.updateprofile.state.style.borderColor="red";

document.updateprofile.state.focus();

return false;

}

else 

return true;



}

/* ######## MY-ACCOUNT (UPDATE PROFILE) ##########*/

/* ######## MY-ACCOUNT (CHANGE PASSWORD) ##########*/

function validchangepass()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;



if(document.changepassword.newpass.value == "")

{

document.getElementById("error").innerHTML="Please enter New password";

document.changepassword.newpass.style.borderColor="red";

document.changepassword.newpass.focus();

return false;

}

else if(document.changepassword.newpass.value.length<6)

{

document.getElementById("error").innerHTML="Please take password mor than 6 digits";

document.changepassword.newpass.style.borderColor="red";

document.changepassword.newpass.focus();

return false;

}

else if(document.changepassword.cpass.value == "")

{

document.getElementById("error").innerHTML="Please enter Confirm password";

document.changepassword.newpass.style.borderColor="";

document.changepassword.cpass.style.borderColor="red";

document.changepassword.cpass.focus();

return false;

}

else if(document.changepassword.cpass.value.length<6)

{

document.getElementById("error").innerHTML="Please take confirm password mor than 6 digits";

document.changepassword.newpass.style.borderColor="";

document.changepassword.cpass.style.borderColor="red";

document.changepassword.cpass.focus();

return false;

}

else if(document.changepassword.newpass.value !== document.changepassword.cpass.value)

{

document.getElementById("error").innerHTML="Both password doesn't match.";

document.changepassword.newpass.style.borderColor="";

document.changepassword.cpass.style.borderColor="red";

document.changepassword.cpass.focus();

return false;

}

else 

return true;



}

/* ######## MY-ACCOUNT (CHANGE PASSWORD) ##########*/

/* ######## MYACCOUNT (ADDRESS BOOK) ##########*/

function validaddressbook()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.addressbook.name.value == "")

{

document.getElementById("error").innerHTML="Please enter Name";

document.addressbook.name.style.borderColor="red";

document.addressbook.name.focus();

return false;

}



if(!testName.test(document.addressbook.name.value))

{

document.getElementById("error").innerHTML="Please enter only character Name";

document.addressbook.name.style.borderColor="red";

document.addressbook.name.focus();

return false;

}



else if(document.addressbook.phone.value == "")

{

document.getElementById("error").innerHTML="Please enter Phone";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="red";

document.addressbook.phone.focus();

return false;

}

if(!num.test(document.addressbook.phone.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="red";

document.addressbook.phone.focus();

return false;

}

else if(document.addressbook.phone.value.length<10)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="red";

document.addressbook.phone.focus();

return false;

}

else if(document.addressbook.phone.value.length>11)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="red";

document.addressbook.phone.focus();

return false;

}

else if(document.addressbook.postalcode.value == "")

{

document.addressbook("error").innerHTML="Please enter Postal Code";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="red";

document.addressbook.postalcode.focus();

return false;

}

if(!num.test(document.addressbook.postalcode.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="red";

document.addressbook.postalcode.focus();

return false;

}

else if(document.addressbook.postalcode.value.length<6)

{

document.getElementById("error").innerHTML="Please take Postal Code number of 6 digits";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="red";

document.addressbook.postalcode.focus();

return false;

}

else if(document.addressbook.postalcode.value.length>6)

{

document.getElementById("error").innerHTML="Please take Postal Code of 6 digits";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="red";

document.addressbook.postalcode.focus();

return false;

}

else if(document.addressbook.city.value == "")

{

document.getElementById("error").innerHTML="Please enter City";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="";

document.addressbook.city.style.borderColor="red";

document.addressbook.city.focus();

return false;

}



if(!testName.test(document.addressbook.city.value))

{

document.getElementById("error").innerHTML="Please enter only character";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="";

document.addressbook.city.style.borderColor="red";

document.addressbook.city.focus();

return false;

}



else if(document.addressbook.address.value == "")

{

document.getElementById("error").innerHTML="Please enter Address";

document.addressbook.name.style.borderColor="";

document.addressbook.phone.style.borderColor="";

document.addressbook.postalcode.style.borderColor="";

document.addressbook.city.style.borderColor="";

document.addressbook.address.style.borderColor="red";

document.addressbook.address.focus();

return false;

}

else 

return true;



}

/* ######## MYACCOUNT (ADDRESS BOOK) ##########*/

/* ######## ADD TO CART ##########*/

function validaddtocart()

{

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.addtocart.size.value == "")

{

document.getElementById("sizeerror").innerHTML="Please select size";

return false;

}

else if(document.addtocart.colour.value == "")

{

document.getElementById("colorerror").innerHTML="Please select colour";

return false;

}



else 

return true;



}

/* ######## ADD TO CART ##########*/

/* ######## PRODUCT REVIEW ##########*/

function validreview()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.review.name.value == "")

{

document.getElementById("error").innerHTML="Please enter Name";

document.review.name.style.borderColor="red";

document.review.name.focus();

return false;

}



if(!testName.test(document.review.name.value))

{

document.getElementById("error").innerHTML="Please enter only character Name";

document.review.name.style.borderColor="red";

document.review.name.focus();

return false;

}

else if(document.review.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.review.name.style.borderColor="";

document.review.email.style.borderColor="red";

document.review.email.focus();

return false;

}

if(!validate_char.test(document.review.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.review.name.style.borderColor="";

document.review.email.style.borderColor="red";

document.review.email.focus();

return false;

}



else if(document.review.reviewtext.value == "")

{

document.getElementById("error").innerHTML="Please enter your review";

document.review.name.style.borderColor="";

document.review.email.style.borderColor="";

document.review.reviewtext.style.borderColor="red";

document.review.reviewtext.focus();

return false;

}



else 

return true;



}

/* ######## PRODUCT REVIEW ##########*/

/* ######## CHECKOUT (SHIPPING ADDRESS) ##########*/

function validbillingaddress()

{

var testName =/^([a-z]|[A-Z]| )*$/;

var num = /^[0-9]+$/;

var validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;





if(document.billingaddress.name.value == "")

{

document.getElementById("error").innerHTML="Please enter Name";

document.billingaddress.name.style.borderColor="red";

document.billingaddress.name.focus();

return false;

}



if(!testName.test(document.billingaddress.name.value))

{

document.getElementById("error").innerHTML="Please enter only character Name";

document.billingaddress.name.style.borderColor="red";

document.billingaddress.name.focus();

return false;

}

else if(document.billingaddress.email.value == "")

{

document.getElementById("error").innerHTML="Please enter email";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="red";

document.billingaddress.email.focus();

return false;

}

if(!validate_char.test(document.billingaddress.email.value))

{

document.getElementById("error").innerHTML="Please take right syntax";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="red";

document.billingaddress.email.focus();

return false;

}

else if(document.billingaddress.phone.value == "")

{

document.getElementById("error").innerHTML="Please enter Phone";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="red";

document.billingaddress.phone.focus();

return false;

}

if(!num.test(document.billingaddress.phone.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="red";

document.billingaddress.phone.focus();

return false;

}

else if(document.billingaddress.phone.value.length<10)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="red";

document.billingaddress.phone.focus();

return false;

}

else if(document.billingaddress.phone.value.length>11)

{

document.getElementById("error").innerHTML="Please take phone number of 10 digits";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="red";

document.billingaddress.phone.focus();

return false;

}

else if(document.billingaddress.postalcode.value == "")

{

document.billingaddress("error").innerHTML="Please enter Postal Code";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="red";

document.billingaddress.postalcode.focus();

return false;

}

if(!num.test(document.billingaddress.postalcode.value))

{

document.getElementById("error").innerHTML="Please enter only numeric value";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="red";

document.billingaddress.postalcode.focus();

return false;

}

else if(document.billingaddress.postalcode.value.length<6)

{

document.getElementById("error").innerHTML="Please take Postal Code number of 6 digits";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="red";

document.billingaddress.postalcode.focus();

return false;

}

else if(document.billingaddress.postalcode.value.length>6)

{

document.getElementById("error").innerHTML="Please take Postal Code of 6 digits";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="red";

document.billingaddress.postalcode.focus();

return false;

}

else if(document.billingaddress.city.value == "")

{

document.getElementById("error").innerHTML="Please enter City";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="";

document.billingaddress.city.style.borderColor="red";

document.billingaddress.city.focus();

return false;

}



if(!testName.test(document.billingaddress.city.value))

{

document.getElementById("error").innerHTML="Please enter only character";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="";

document.billingaddress.city.style.borderColor="red";

document.billingaddress.city.focus();

return false;

}

else if(document.billingaddress.country.value == "")

{

document.getElementById("error").innerHTML="Please select Country";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="";

document.billingaddress.city.style.borderColor="";

document.billingaddress.country.style.borderColor="red";

document.billingaddress.country.focus();

return false;

}

else if(document.billingaddress.state.value == "")

{

document.getElementById("error").innerHTML="Please select State";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="";

document.billingaddress.city.style.borderColor="";

document.billingaddress.country.style.borderColor="";

document.billingaddress.state.style.borderColor="red";

document.billingaddress.state.focus();

return false;

}

else if(document.billingaddress.address.value == "")

{

document.getElementById("error").innerHTML="Please enter Address";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="";

document.billingaddress.city.style.borderColor="";

document.billingaddress.country.style.borderColor="";

document.billingaddress.address.style.borderColor="red";

document.billingaddress.address.focus();

return false;

}

else if(!document.billingaddress.paymentmethod[0].checked && !document.billingaddress.paymentmethod[1].checked && !document.billingaddress.paymentmethod[2].checked)

{

document.getElementById("error").innerHTML="Please Choose Payment Method";

document.billingaddress.name.style.borderColor="";

document.billingaddress.email.style.borderColor="";

document.billingaddress.phone.style.borderColor="";

document.billingaddress.postalcode.style.borderColor="";

document.billingaddress.city.style.borderColor="";

document.billingaddress.country.style.borderColor="";

document.billingaddress.address.style.borderColor="";

document.billingaddress.paymentmethod[0].focus();

return false;

}

else 

return true;



}

/* ######## CHECKOUT (SHIPPING ADDRESS) ##########*/