function validate_form()
{
 if((document.form_submit.title.value=="")||(document.form_submit.url.value=="")||(document.form_submit.email.value=="")||(document.form_submit.description.value=="")||(document.form_submit.site_type.value=="")||(document.form_submit.cat_name.value==""))
	{
		alert("Fields marked with (*) are compulsary\n Navigate to the category/sub-category where you want your site list and click 'Add link'. If you not found the suitable category, enter the name of new category you want to suggest in the 'Category' field");
		return false;
		
	}
	return emailcheck();
}
function isnumeral()
	{
          var i=new String(document.form1.bpin.value);
          {   
               if(isNaN(i))
               {
		   alert("Value must be numeric");
                   document.form1.bpin.select();
		   return false;	
               }
		return true;
          }
	}
function emailcheck()
	{
	var i=new String(document.form_submit.email.value);
	if(i.indexOf("@")<3)
	{	
		alert("Invalid email address");
		document.form_submit.email.select();
		return false;
	}
	 replace_quote(8);	
	 return true;
}
function validate_contact(){
	if( (document.form_submit.name.value)=="" || (document.form_submit.email.value)=="" ){
	alert("Fields marked with (*) are compulsary");
	return false;
	}
	return emailcheck();
	replace_quote(6)
		
}

function replace_quote(ele){
	var str;
	var mstr=/'/g;	
	for(i=0;i<ele;i++)
	{
		str=new String(document.form_submit.elements[i].value);
		document.form_submit.elements[i].value=str.replace(mstr,"''");
	}
}