
function validate_form ( )
{

	
	if ( document.additem.proname.value == "" )
    {
        alert ( "Please fill in the 'Product Name' box." );
        document.additem.proname.focus();
		return false;
    }
	if ( document.additem.proprice.value == "" )
    {
        alert ( "Please fill in the 'Product Price' box." );
        document.additem.proprice.focus();
		return false;
    }
	if ( document.additem.prodiscri.value == "" )
    {
        alert ( "Please fill in the 'Discription ' box." );
        document.additem.prodiscri.focus();
		return false;
    }
	if ( document.additem.transatype.selectedIndex == 0 )
    {
        alert ( "Please select Trannsaction Type." );
        document.additem.transatype.focus();
		return false;
    }
	if ( document.additem.contaname.value == "" )
    {
        alert ( "Please fill in the 'Contact Name' box." );
       document.additem.contaname.focus();
		return false;
    }
	if ( document.additem.contapho.value == "" )
    {
        alert ( "Please fill in the 'Contact Phone' box." );
        document.additem.contapho.focus();
		return false;
    }
	if ( document.additem.contaemai.value == "" )
    {
        alert ( "Please fill in the 'Contact Email' box." );
     	document.additem.contaemai.focus();
		return false;
    }
	var x=document.forms["additem"]["contaemai"].value
	var atpos=x.indexOf("@");
	var dotpos=x.lastIndexOf(".");
	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  	{
  	alert("Not a valid e-mail address");
  	return false;
  	}
	
	return true;

}



