// JavaScript Document
function emailvalidation(entered, alertbox)
{
// E-mail Validation by Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove this line and the two lines above.
with (entered)
{
apos=value.indexOf("@"); 
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
}

function emptyvalidation(entered, alertbox)
{
// Emptyfield Validation by Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove this line and the two lines above.
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 

function emptynumbervalidation(entered, alertbox)
{
// Emptyfield Validation by Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove this line and the two lines above.
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function formvalidation(buyer_form)
{
with (buyer_form)
{
if (emptyvalidation(name,"Please fill in your name")==false) {name.focus(); return false;};
if (emailvalidation(email,"Your E-mail is not valid")==false) {email.focus(); return false;};
}
}

function formvalidation(contact_form)
{
with (contact_form)
{
if (emptyvalidation(name,"Please fill in your name")==false) {name.focus(); return false;};
if (emailvalidation(email,"Your E-mail is not valid")==false) {email.focus(); return false;};
if (emptyvalidation(number,"Please fill in your contact number")==false) {number.focus(); return false;};
}
}

function formvalidation(seller_form)
{
with (seller_form)
{
if (emptyvalidation(name,"Please fill in your name")==false) {name.focus(); return false;};
if (emailvalidation(email,"Your E-mail is not valid")==false) {email.focus(); return false;};
if (emptyvalidation(address,"Please fill in your Address")==false) {address.focus(); return false;};
}
}

function formvalidation(value_form)
{
with (value_form)
{
if (emptyvalidation(name,"Please fill in your name")==false) {name.focus(); return false;};
if (emailvalidation(email,"Your E-mail is not valid")==false) {email.focus(); return false;};
}
}