function checkCorpEmail(eml)

 {
	if (eml.indexOf("hotmail.com") > 0 ||eml.indexOf("gmail.com") > 0 || eml.indexOf("yahoo.com") > 0 || eml.indexOf("test.com") > 0 || eml.indexOf("rediffmail.com") > 0 || eml.indexOf("aol.com") > 0) {
		alert("Please enter corporate email address ");

		return false;
		
	 } 
	
	else {
		return true;
	     }
}
function isNotAlphabets(str)

{
		for (var i = 0; i < str.length; i++)
		{
				re = / /gi				//Replace the space between words with no space
				str = str.replace(re,"");
			
				var ch = str.substring(i, i + 1);
				if((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) 
				{
					return true;
				}
		}
		return false;
}
function isNotNumeric(str)

{
		for (var i = 0; i < str.length; i++)
		{
				var ch = str.substring(i, i + 1);
				if((ch < '0' || '9' < ch)) 
				{
					if((ch == " ") || (ch == "_")  || (ch == ".") || (ch == "-") || (ch == "+")  || (ch == "(") || (ch == ")")) continue;
					return true;
				}
		}
		return false;
}

function checkEmail(myForm,mess)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.value))
{
	return (true)
}
alert(mess);
myForm.focus();
return (false)
}

function check_url(theurl) {    
    var tomatch= /[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
     if (tomatch.test(theurl))
     {
         return true;
     }
     else
     {
     alert("Please Enter  Valid  Link");
//myForm.focus();
//return (false)
     }
}

function checkform(chk)
{

	
	if(chk.Name.value == "")
	{
		alert("Please enter Your Name");
	     chk.Name.focus();
		return false;
	}
	if(chk.website_url.value == "")
	{
		alert("Please enter Your website URL");
	     chk.website_url.focus();
		return false;
	}
	
	if(!check_url(chk.website_url.value))
	{
	
	chk.website_url.focus();
		return false;

	}
	
	if(chk.email.value=="")
	{
		alert("Please enter Email");
		chk.email.focus();
		return false;
	}

	
	if(!checkEmail(chk.email,"Please enter valid Email Address"))
	{
		return false;
	}

	
	
	if(isNotAlphabets(chk.Name.value))
		 {
			alert("Invalid characters in Your Name");
			chk.Name.focus();
			return false;
		 }
	
	
	
	
	if(chk.phone.value== "")
	{
		alert("Please Enter Your Phone");
		chk.phone.focus();
		return false;
	}
	if(isNotNumeric(chk.phone.value))
				 {
					alert("Invalid characters in phone_num.");
					chk.phone.focus();
					return false;
				 }
	

	
	return true;
	
}
	
function notEmpty11(elem, helperMsg){


	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
		
	}
	
	if(!checkEmail(chk.email,"Please enter valid Email Address"))
	{
		return false;
	}

	return true;
	
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	}
	return true;
}

	
function notEmpty1(elem, helperMsg)

{
var elm1=elem.value.length >= 7;
	if(elm1)
	{
		alert(helperMsg);
		elem1.focus();
		return false;
	}

	
	
	if(!check_url(chk.url1.value))
	{
	
	chk.url.focus();
		return false;

	}
		return true;
}


function checkform1(chk1)
{

	
	if(chk1.Name.value == "")
	{
		alert("Please enter Your Name");
	     chk1.Name.focus();
		return false;
	}
	
	if(isNotAlphabets(chk1.Name.value))
		 {
			alert("Invalid characters in Your Name");
			chk1.Name.focus();
			return false;
		 }
	
	
	if(chk1.Email.value=="")
	{
		alert("Please enter Email");
		chk1.Email.focus();
		return false;
	}

	
	if(!checkEmail(chk1.Email,"Please enter valid Email Address"))
	{
		return false;
	}

	
	
	
	
	
	
	if(chk1.Phone.value== "")
	{
		alert("Please Enter Your Phone");
		chk1.Phone.focus();
		return false;
	}
	if(isNotNumeric(chk1.Phone.value))
				 {
					alert("Invalid characters in phone.");
					chk1.Phone.focus();
					return false;
				 }
	

	
	return true;
	
}


function checkform2(chk2)
{

	
	if(chk2.name_url.value == "")
	{
		alert("Please enter Your Name");
	     chk2.name_url.focus();
		return false;
	}
	
	if(isNotAlphabets(chk2.name_url.value))
		 {
			alert("Invalid characters in Your Name");
			chk2.name_url.focus();
			return false;
		 }
	
	
	if(chk2.email_url.value=="")
	{
		alert("Please enter Email");
		chk2.email_url.focus();
		return false;
	}

	
	if(!checkEmail(chk2.email_url,"Please enter valid Email Address"))
	{
		return false;
	}

	
	
	
	
	
	
	if(chk2.phone_url.value== "")
	{
		alert("Please Enter Your Phone");
		chk2.phone_url.focus();
		return false;
	}
	if(isNotNumeric(chk2.phone_url.value))
				 {
					alert("Invalid characters in phone_num.");
					chk2.phone_url.focus();
					return false;
				 }
	


	return true;
	
}



						/*	########### Front End Validations ###########  */
