function emptyvalidation(entered, alertbox)

{

with (entered)

{

if (value==null || value=="" || value=="0")

{if (alertbox!="") {alert(alertbox);} return false;}

else {return true;}

}

} 

function searchValidation(thisform)

{

with (thisform)

{

if (emptyvalidation(txtSearch,"The Search field is empty")==false) {txtSearch.focus(); return false;};

return true;

}

} 

function emailvalidation(entered, alertbox)

{

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;}

}

} 