
function validate()
{
if(document.form1.header.value=="")
{
	alert('Enter the Header Value');
	document.form1.header.focus();
	return false;
}

if(document.form1.descr.value=="")
{
	alert('Enter the Description');
	document.form1.descr.focus();
	return false;
}
if(document.form1.offered.value=="")
{
	alert('Enter the Offered name');
	document.form1.offered.focus();
	return false;
}
if(document.form1.contact.value=="")
{ 
    alert('Enter the ContactPerson name');
	document.form1.contact.focus();
	return false;
}
var a=document.form1.cno.value;

if(a=="")
{
	alert('Enter the contact number');
	document.form1.cno.focus();
	return false;
}
var cont=/^[0-9\-\+\.\)\(]/;
if(cont.test(a)!=true)
{
	alert('Only numericvalues and -, . ,(),+ are valid');
	document.form1.cno.focus();
	return false;
}

if(document.form1.email.value=="")
{
	alert('Enter the Email Address');
	document.form1.email.focus();
	return false;
}
if(document.form1.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
{
	alert('Enter the Valid Email');
	document.form1.email.focus();
	return false;
}
if(document.form1.category.selectedIndex == 0)
{
	alert('Select the Category List');
	document.form1.category.focus();
	return false;
}
var b=document.form1.price.value;
var price=/^[0-9\-\.]+$/;
if(b=="")
{
	alert('Enter the Retail Price');
	document.form1.price.focus();
	return false;
}
if(price.test(b)!=true)
{
	alert('Valid only 0-9,-,. and should not allow $ symbol');
	document.form1.price.focus();
	return false;
}
var d=document.form1.discount.value;
if(d=="")
{
	alert('Enter the discount Price');
	document.form1.discount.focus();
	return false;
}
if(price.test(d)!=true)
{
	alert('Valid only 0-9,-,. and should not allow $ symbol');
	document.form1.discount.focus();
	return false;
}

if(document.form1.distype.value=="")
{ 
     alert('Enter the discount type');
	 document.form1.distype.focus();
	 return false;
}
if(document.form1.country.value=="")
{
	alert('Enter the country name');
	document.form1.country.focus();
	return false;
}
if(document.form1.url.value=="")
{
	alert('Enter the correct url');
	document.form1.url.focus();
	return false;
}
if(document.form1.file.value=="")
{
	alert('Upload the image file');
	document.form1.file.focus();
	return false;
}
if(document.form1.ship.value=="")
{
	alert('Enter the Shipping Cost');
	document.form1.ship.focus();
	return false;
}
var dt=document.form1.valid.value;
var date=/^[0-9/-]+$/;
if(date.test(dt)!=true)
{
	alert('Enter the Validity date in the given format');
	document.form1.valid.focus();
	return false;
}
if(document.form1.prcode.value=="")
{
	alert('Enter the promotional code');
	document.form1.prcode.focus();
	return false;
}
if(document.form1.coupcode.value=="")
{
	alert('Enter the coupon code');
	document.form1.coupcode.focus();
	return false;
}

}
