//CHECKING THE NAME FIELD IS BLANK OR NOT ***************************************************************		
//alert("validation.js file");
function checkBlank(value)
		{
				//alert("checkBlank");
				if(value + "x" == "x")
				return true;
		}
		
		
function checkRate(value)
		{
				if(value == "r0") return true;
		}
function checknewstype(value)
		{
				if(value == "r0") return true;
		}
/*function checkValidDate(value)
		{alert("hello");
				var regexp=/^(\d{8}|\d{2}-\d{2}-\d{4})$/;
				var regexp=/^(\d{8}|\d{2}\/\\d{2}\/\\d{4})$/;
				var regexp1=/^(\d{6}|\d{2}-\d{2}-\d{2})$/;
				
				if(value.length==10){return false;}
				if(!(value.indexOf("/")==3)||(value.indexOf("/")==6)){return false;}
			if(regexp1.test(value)){return false;}
				if(regexp.test(value)){alert("hello1");return false;}			
		}
*/		

function checklenpass(pass)		
		{
			if(pass.length<6){return true}
		return false
		}

function checkphone(value)
		{
			
				var regexp=/^(\d{12}|\d{2}-\d{4}-\d{6})$/;
				var regexp1=/^(\d{17}|\d{5}-\d{5}-\d{7})$/;
				var regexp2=/^(\d{10}|\d{10})&/;
				var regexp3=/^(\d{11}|\d{5}-\d{6})&/;
				var regexp4=/^(\d{10}|\d{4}-\d{6})$/;
				
				if(value.length==12)
				{
					if(regexp.test(value))
						{
						return false;
						}
				}
				else if(value.length==17)
				{
							if(regexp1.test(value))
						{
						return false;
						}
				}
				else if(value.length==10)
				{
					if(regexp2.test(value))
						{
						return false;
						}
					if(regexp4.test(value))
						{
						return false;
						}
				}
				else if(value.length==11)
				{
					if(regexp3.test(value))
						{
						return false;
						}
				}
				else
				{
					//alert("Invalid Phone/Invalid Number enter Country Code-Area Code-PhoneNumber");
					return true;
				}
		}

//CHECKING THE PASSWORD FIELD IS BLANK OR NOT ***************************************************************		
/*
//CHECKING THE CITY FIELD IS BLANK OR NOT ***************************************************************		
function namecheck(name)
		{
				if(name + "x" == "x")
				{
					alert("Name Field Can Not Be Blank");
					//document.form1.aname.focus();
					return false;
				}
		}
*/
//CHECKING THE PHONE/MOBILE FIELD IS BLANK OR NOT ***************************************************************		
function phonenumcheck(allowstring,phone)
			{
		if(phone.length<10)
		{
		//alert(" Enter Complete Phone Number using Upto 15 Chracter")
		return false;
		}
		for(i=0;i<phone.length;i++)
				{
					str="Not Allow";
					for(j=0;j<allowstring.length;j++)
						{
						if(phone.charAt(i)==allowstring.charAt(j))
							{
							str="Allow";
							}
						}
					if(str!="Allow")
						{
						//alert("You Have Entered Invalid Value For Phone Field. Enter 0-9,-,_, ,");
						//document.form1.aphone.focus();
						return false;
						}
				}
			return true;
			}

//CHECKING THE E-MAIL FIELD IS BLANK OR NOT ***************************************************************		

function emailvalidcheck(email)
			{
	
					var chk1 = email.indexOf("@");
					var chk3 = email.lastIndexOf("@");
					var chk2 = email.lastIndexOf(".");
					var chk4 = email.indexOf(" ");
				
				if((chk1 < 1)||(chk2 < 3))
					{
						//alert("Email address is not valid.");
						//document.form1.aemail.select();
						return false;
					}
				if(chk3!=chk1)
					{ 
						//alert("You Can Not Enter 2 @ For A Email Id Field");
						//document.form1.aemail.select();
						return false;
					}
				if(chk4 >= 0)
					{ 
						//alert("There Is Space in the Email Id. Enter Valid Email Id..");
						//document.form1.aemail.select();
						return false;
					}
				if(email.length<=chk2+1)
					{
						//alert("This is a invalid Email Id (.) in Last Position")
						return false;
					}
					return true;
			}

function emailvalidcheck1(email)
			{
	
					var chk1 = email.indexOf("@");
					var chk3 = email.lastIndexOf("@");
					var chk2 = email.lastIndexOf(".");
					var chk4 = email.indexOf(" ");
				
				if((chk1 < 1)||(chk2 < 3))
					{
						//alert("Email address is not valid.");
						//document.form1.aemail.select();
						return false;
					}
				if(chk3!=chk1)
					{ 
						//alert("You Can Not Enter 2 @ For A Email Id Field");
						//document.form1.aemail.select();
						return false;
					}
				if(chk4 >= 0)
					{ 
						//alert("There Is Space in the Email Id. Enter Valid Email Id..");
						//document.form1.aemail.select();
						return false;
					}
				if(email.length<=chk2+1)
					{
						//alert("This is a invalid Email Id (.) in Last Position")
						return false;
					}
					return true;
			}


//CHECKING THE LENGTH OF THE ENTERED VALUE ***************************************************************		

function checknan(pass)
		{//alert("ss");
			if(isNaN(pass))
			{
			alert("Paword Will Only Accept Numeric Value and (0<password<120)");
			//	document.form1.password.select();
				return false;
			}
			pnum=parseInt(pass);
			if(pnum<=0||pnum>=120)
			{
				alert("Please Enter Valid Password It should Not( Exceed 120 ,  Less then 0 or 0)");
				//document.form1.password.select();
				return false;
			}
			return true;
		}
		
//Checking The Length Of The Field Entered  *******************************************************************		
function checklen(value)
		{
			if(value.length<=3)
				{
				return false;
				}
				return true;
		}
function passlen(value)
		{
			if(value.length<=5)
				{
				return false;
				}
				return true;
		}		
