function validate()
{
flag=true;

   if(document.buyerform.name.value=="") 
{
   flag=false;
   alert("Enter Company / Person Name  ");
   document.buyerform.name.focus();
   return flag;
} 
if((flag) && (document.buyerform.item.value==""))
{
   flag=false;
   alert("Enter the Item Name");
   document.buyerform.item.focus();
   return flag;
}
if((flag) && (document.buyerform.price.value=="") || isNaN(document.buyerform.price.value))
{
   flag=false;
   alert("Enter Expected Buying Price of the Item!!");
   document.buyerform.price.focus();
   document.buyerform.price.select();
   return flag;
}

if((flag) && (document.buyerform.address.value==""))
{
   flag=false;
   alert("Please Enter Your Address !!");
   document.buyerform.address.focus();
   return flag;
}

if((flag) && ((document.buyerform.email.value).indexOf("@")<=0 || (document.buyerform.email.value).indexOf(".")<=2 || (document.buyerform.email.value).indexOf("/")>0) || (document.buyerform.email.value).indexOf(".")==(document.buyerform.email.value).indexOf("@")+1)
{ 
   flag=false;
   alert("enter valid email address"); 
   document.buyerform.email.focus();  
   document.buyerform.email.select();  
  return flag;
}

if((flag) && (document.buyerform.comments.value==""))
{
   flag=false;
   alert("Please Enter Your comments !!");
   document.buyerform.comments.focus();
   return flag;
}

return flag; 
}
