function ValidateCompForm()
{
	if (document.Regform.UserName.value == "")
	{
		alert('Enter UserName');
		document.Regform.UserName.focus();
		return false;
	}
	else
	{
			var Chars = "!@#$%^&*() ,<>?/\;:~`}{[]|-+=";
			var string = document.Regform.UserName.value;

			for (var i = 0; i < string.length; i++) 
			{
			   if (Chars.indexOf(string.charAt(i)) > 1)
				{
					alert("Special characters are not permitted inside the username");
					document.Regform.UserName.value;
					return false;
				}
			}		
	}
	
	if (document.Regform.Password.value == "")
	{
		alert('Enter Password');
		document.Regform.Password.focus();
		return false;
	}
	else
	{
		var Chars = "!@#$%^&*() ,<>?/\;:~`}{[]|-+=";
			var string = document.Regform.Password.value;

			for (var i = 0; i < string.length; i++) 
			{
			   if (Chars.indexOf(string.charAt(i)) > 1)
				{
					alert("No Special characters or numbers are permitted as password");
					document.Regform.Password.focus();
					return false;
				}
		  }
		  
		  //Check if passwords match
		  if(document.Regform.Password.value != document.Regform.Password1.value)
		  {
		  	alert("The passwords don't match ! Please type them again !");
		  	document.Regform.Password.focus();
		  	return false;
		  }
	}
	
	if (document.Regform.CompName.value == "")
	{
		alert('Please enter the company name');
		document.Regform.CompName.focus();
		return false;
	}
	
	if (document.Regform.Branch.value == "")
	{
		alert('Please enter the branch name');
		document.Regform.Branch.focus();
		return false;
	}
	

	
	if(document.Regform.CompAddress.value  == "")
	{
		alert('Please enter the company address');
		document.Regform.CompAddress.focus();
		return false;
	}
	else
	{
		var txt = "";
		txt = document.Regform.CompAddress.value
		if (txt.length > 100)
		{
			alert('Address cannot be more than 100 characters');
			document.Regform.CompAddress.focus();
			return false;
		}
	}
	
	if(document.Regform.MailId.value == "")
	{
		alert('Please enter your email');
		document.Regform.MailId.focus();
		return false;
	}
	else
	{
		var strn = "";
		strn = document.Regform.MailId.value;
					
       	if (strn.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
		{
			alert("Invalid email address");
			document.Regform.MailId.focus();
        	return false;
		} 
	}

	if(document.Regform.ContactName.value == "")
	{
		alert('Please enter your contact name');
		document.Regform.ContactName.focus();
		return false;
	}
	
	if(document.Regform.ContactPhoneNumber.value == "")
	{
		alert('Please enter your contact phone number');
		document.Regform.ContactPhoneNumber.focus();
		return false;
	}
	
	if (document.Regform.ContactPhoneNumber.value != "")
	{
		var Chars = "1234567890()- ";
			var string = document.Regform.ContactPhoneNumber.value;

			for (var i = 0; i < string.length; i++) 
			{
			   if (Chars.indexOf(string.charAt(i)) == -1)
				{
					alert("The Contact Phone Number should be numeric");
					document.Regform.ContactPhoneNumber.focus();
					return false;
				}
			}	
	}
	
	if(document.Regform.ContactMail.value == "")
	{
		alert('Please enter your email');
		document.Regform.ContactMail.focus();
		return false;
	}
	else
	{
		var strn = "";
		strn = document.Regform.ContactMail.value;
					
       	if (strn.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
		{
			alert("Invalid contact email address");
			document.Regform.ContactMail.focus();
        	return false;
		} 
	}
	//return true;
	document.Regform.submit();
}


function chkoddmonths(m,d)
{
	var strMonths = new Array();
	var strDates = new Array();
	//alert(m);
	//alert(d);
	strMonths[0] = 31;
	strMonths[1] = 29;
	strMonths[2] = 31;
	strMonths[3] = 30;
	strMonths[4] = 31;
	strMonths[5] = 30;
	strMonths[6] = 31;
	strMonths[7] = 31;
	strMonths[8] = 30;
	strMonths[9] = 31;
	strMonths[10] = 30;
	strMonths[11] = 31;
	
	if (d > strMonths[m-1])
	{
		return false;
	}
	else
	{
		return true;	
	}
}