function thisButton(FromObj,TextObj,butObj)
{
	butValue=butObj.id;
	TextObj.value=butValue;
	//alert("button==="+butValue);
	return true;
}

///// referral registration
function RefApp(FormObj)
{

var cansubmit=false;

cansubmit= ForceEntry(document.refapp.First_Name, "Enter Valid First Name");
if(cansubmit) cansubmit =isname(document.refapp.First_Name,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry(document.refapp.Last_Name, "Enter Valid Last Name");
if(cansubmit) cansubmit =isname(document.refapp.Last_Name,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry(document.refapp.Company, "Enter Valid Company Name");
if(cansubmit) cansubmit =AddText(document.refapp.Company,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry1(document.refapp.Title1, "Enter Valid Title");

if(cansubmit) cansubmit= ForceEntry(document.refapp.Address, "Enter Valid Address");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.Address2, "Enter Valid Address");

if(cansubmit) cansubmit= ForceEntry(document.refapp.City, "Enter Valid City");
if(cansubmit) cansubmit =AddText(document.refapp.City,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry(document.refapp.State, "Enter Valid State");
if(cansubmit) cansubmit =AddText(document.refapp.State,"Can not type special Chars");
if(cansubmit){
	if(	document.refapp.state_hidden_value.value=="0"){
		cansubmit =MinLen(document.refapp.State,"State name is less than 4 four characters. Please re-type to be certain that it is not an abbreviation.",4);
	}
	document.refapp.state_hidden_value.value=1;
}


if(cansubmit) cansubmit= ForceEntry(document.refapp.Country, "Enter Valid Country");
if(cansubmit) cansubmit =Addtext(document.refapp.Country,"Can not type special Chars");

if (cansubmit) cansubmit= isPost(document.refapp.Zip, "Enter Valid Zip");

if (cansubmit) cansubmit=EmailValid(document.refapp.Email,"Enter Valid Email");
if(cansubmit) cansubmit= ForceEntry(document.refapp.wurl, "Enter Valid Web Site");

if (cansubmit) cansubmit= Validphone(document.refapp.Day_Phone_area_code, "Enter Valid Day Phone Area code");
if (cansubmit) cansubmit= Validphone(document.refapp.Day_Phone, "Enter Valid Day Phone Number");

if (cansubmit) cansubmit= Validphone1(document.refapp.Evening_Phone_area_code, "Enter Valid Evening Phone Area code");
if (cansubmit) cansubmit= Validphone1(document.refapp.Evening_Phone, "Enter Valid Evening Phone Number");

if (cansubmit) cansubmit= Validphone1(document.refapp.Fax_Area_Code, "Enter Valid Fax Area code");
if (cansubmit) cansubmit= Validphone1(document.refapp.Fax_number, "Enter Valid Fax Number");

if (cansubmit) cansubmit=DateValid(document.refapp.dd,document.refapp.mm,document.refapp.yy);

if (cansubmit) cansubmit =SelectEntry(document.refapp.gender,"Kindly select Gender");


if(cansubmit) cansubmit= ForceEntry1(document.refapp.race2, "Enter Valid Race");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.occupation, "Enter Valid occupation");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.degree_oth, "Enter Valid Degree");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.Year, "Enter Valid Number of Years");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.other_exp, "Enter Valid Experience");

if(cansubmit) cansubmit= isNum(document.refapp.Fee_hourly, "Enter Valid Number");
if(cansubmit) cansubmit= isNum(document.refapp.Fee_daily, "Enter Valid Number");
if(cansubmit) cansubmit= isNum(document.refapp.Fee_weekly, "Enter Valid Number");
if(cansubmit) cansubmit= isNum(document.refapp.Fee_monthly, "Enter Valid Number");


if(cansubmit) cansubmit= ForceEntry1(document.refapp.flname1, "Enter Valid First & Last Name");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.title1, "Enter Valid Title");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.org1, "Enter Valid Organisation");
if (cansubmit) cansubmit= Validphone1(document.refapp.phone1, "Enter Valid Phone Number");
if (cansubmit) cansubmit=EmailValid1(document.refapp.email1,"Enter Valid Email");

if(cansubmit) cansubmit= ForceEntry1(document.refapp.flname2, "Enter Valid First & Last Name");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.title2, "Enter Valid Title");
if(cansubmit) cansubmit= ForceEntry1(document.refapp.org2, "Enter Valid Organisation");
if (cansubmit) cansubmit= Validphone1(document.refapp.phone2, "Enter Valid Phone Number");
if (cansubmit) cansubmit=EmailValid1(document.refapp.email2,"Enter Valid Email");

if (cansubmit) cansubmit=ForceEntry(document.refapp.username,"Enter Valid Username");
if (cansubmit) cansubmit=MaxLen(document.refapp.username,"Username should be greater than 5");
return cansubmit;

}

//////end referral registration


//////////start login
function LoginCheck()
{
var cansubmit=false;

cansubmit= ForceEntry(document.loginfrm.username, "Enter Valid Username");
if(cansubmit) cansubmit= MaxLen(document.loginfrm.username, "Username should be grater than 5");
if(cansubmit) cansubmit= ForceEntry(document.loginfrm.password, "Enter Valid Password");
if(cansubmit) cansubmit= MaxLen(document.loginfrm.password, "Password should be grater than 5");
return cansubmit;
}
/////////////////////end login


//////////////////start search
function SearchCheck()
{
var cansubmit=false;

cansubmit= ForceEntry1(document.searchfrm.State, "Enter Valid State");
if(cansubmit) cansubmit= ForceEntry1(document.searchfrm.Last_Name, "Enter Valid Last Name");
if(cansubmit) cansubmit= ForceEntry1(document.searchfrm.Keyword, "Enter Valid Keyword");
return cansubmit;
}
////////////end search


//////////////////start profile login
function ProfileLogin()
{
var cansubmit=false;
cansubmit= EmailValid(document.profilefrm.Email,"Enter Valid Email");
if(cansubmit) cansubmit= ForceEntry(document.profilefrm.Password, "Enter Valid Password");
if(cansubmit) cansubmit= MaxLen(document.profilefrm.Password, "Password should be grater than 5");
return cansubmit;
}
///////////////end profile login


//////////////profile updation
function ProfileCheck(FormObj)
{

var cansubmit=false;

cansubmit= ForceEntry(document.pfrm.First_Name, "Enter Valid First Name");
if(cansubmit) cansubmit =isname(document.pfrm.First_Name,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry(document.pfrm.Last_Name, "Enter Valid Last Name");
if(cansubmit) cansubmit =isname(document.pfrm.Last_Name,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry1(document.pfrm.Middle_Name, "Enter Valid Middle Name");

if(cansubmit) cansubmit= ForceEntry(document.pfrm.Address1, "Enter Valid Address");
if(cansubmit) cansubmit= ForceEntry1(document.pfrm.Address2, "Enter Valid Address");

if(cansubmit) cansubmit= ForceEntry(document.pfrm.City, "Enter Valid City");
if(cansubmit) cansubmit =AddText(document.pfrm.City,"Can not type special Chars");

if(cansubmit) cansubmit= ForceEntry(document.pfrm.State, "Enter Valid State");
if(cansubmit) cansubmit =AddText(document.pfrm.State,"Can not type special Chars");
if(cansubmit) cansubmit =MinLen(document.pfrm.State,"State name is less than 4 four characters. Please re-type to be certain that it is not an abbreviation.",4);


if(cansubmit) cansubmit= ForceEntry(document.pfrm.Country, "Enter Valid Country");
if(cansubmit) cansubmit =AddText(document.pfrm.Country,"Can not type special Chars");

if (cansubmit) cansubmit= isPost(document.pfrm.Zip, "Enter Valid Zip");


if(cansubmit) cansubmit= ForceEntry1(document.pfrm.Company, "Enter Valid Company Name");

//if(cansubmit) cansubmit= ForceEntry1(document.pfrm.Title1, "Enter Valid Title");
if(cansubmit) cansubmit= ForceEntry1(document.pfrm.occupation, "Enter Valid occupation");

//if (cansubmit) cansubmit=EmailValid(document.pfrm.Email,"Enter Valid Email");
if(cansubmit) cansubmit= ForceEntry1(document.pfrm.wurl, "Enter Valid Web Site");

if (cansubmit) cansubmit= Validphone(document.pfrm.Day_Phone_area_code, "Enter Valid Day Phone Area code");
if (cansubmit) cansubmit= Validphone(document.pfrm.Day_Phone, "Enter Valid Day Phone Number");

if (cansubmit) cansubmit= Validphone(document.pfrm.Evening_Phone_area_code, "Enter Valid Evening Phone Area code");
if (cansubmit) cansubmit= Validphone(document.pfrm.Evening_Phone, "Enter Valid Evening Phone Number");

if (cansubmit) cansubmit= Validphone1(document.pfrm.Fax_Area_Code, "Enter Valid Fax Area code");
if (cansubmit) cansubmit= Validphone1(document.pfrm.Fax_number, "Enter Valid Fax Number");

if(cansubmit) cansubmit= ForceEntry1(document.pfrm.Highest_Degree, "Enter Valid Highest Degree");

if (cansubmit) cansubmit=DateValid(document.pfrm.dd,document.pfrm.mm,document.pfrm.yy);
if (cansubmit) cansubmit=DateValid(document.pfrm.gdd,document.pfrm.gmm,document.pfrm.gyy);

if (cansubmit) cansubmit =SelectEntry(document.pfrm.gender,"Kindly select Gender");

return cansubmit;

}

///////////////end profile updation



function PwdCheck()
{

var cansubmit=false;

cansubmit= ForceEntry(document.pwdfrm.old_pwd, "Enter Valid Old Password");
if(cansubmit) cansubmit =isname(document.pwdfrm.old_pwd,"Can not type special Chars");
if (cansubmit) cansubmit= MaxLen(document.pwdfrm.old_pwd,"Password should be Greater than 5");

if (cansubmit) cansubmit= ForceEntry(document.pwdfrm.pwd1, "Enter Valid Password");
if(cansubmit) cansubmit =isname(document.pwdfrm.pwd1,"Can not type special Chars");
if (cansubmit) cansubmit= MaxLen(document.pwdfrm.pwd1,"Password should be Greater than 5");

if (cansubmit) cansubmit= ForceEntry(document.pwdfrm.pwd2, "Enter Valid Confirm Password");
if(cansubmit) cansubmit =isname(document.pwdfrm.pwd2,"Can not type special Chars");
if (cansubmit) cansubmit= MaxLen(document.pwdfrm.pwd2,"Password should be Greater than 5");

if (cansubmit) cansubmit= issame(document.pwdfrm.pwd1,document.pwdfrm.pwd2,"Password and Confirm password should be same");

return cansubmit;

}

function ForgotPwd()
{

var cansubmit=false;

cansubmit= ForceEntry(document.pwdfrm.username, "Enter Valid Username");
if(cansubmit) cansubmit =isname(document.pwdfrm.username,"Can not type special Chars");
if (cansubmit) cansubmit= MaxLen(document.pwdfrm.username,"Username should be Greater than 5");

if (cansubmit) cansubmit=EmailValid(document.pwdfrm.emailid,"Enter Valid Email");


return cansubmit;

}


function trim(strinput)
{
    var i;
					 while(strinput.charAt(0)==' '||strinput.charAt(0)=='\t'||strinput.charAt(0)=='\n'||strinput.charAt(0)=='\r')
					{
					strinput= strinput.substring(1);
					}
					i = strinput.length-1;
					while(strinput.charAt(i)==' '||strinput.charAt(i)=='\t'||strinput.charAt(i)=='\n'||strinput.charAt(i)=='\r')
					{
					strinput = strinput.substring(0,i);
					i = i-1;
					}
return strinput;
}

function issame(lenObj,lenObj1,lenobjMsg)
{
	str=lenObj.value;
	str1=lenObj1.value;
	if(str!=str1)
	{
		alert(lenobjMsg);
		lenObj1.focus();
		return false;
	}
	return true;
}

function MaxLen(lenObj,Msg)
{
	str=lenObj.value;
	if(str.length < 5)
	{
		alert(Msg);
		lenObj.focus();
		return false;
	}
	return true;
}

function MinLen(lenObj,Msg,MinLimit)
{
	str=lenObj.value;
	if(str.length < MinLimit)
	{
		alert(Msg);
		lenObj.focus();
		return false;
	}
	return true;
}

 function isname(nameObj,nameMsg)
{
	 var i=0
		 names=nameObj.value;
	 for(i;i<names.length;i++)
	 {
	 	var c=names.charAt(i)
	 	if (!(((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z"))|| ((c >= "0") && (c <= "9")) || (c == ".") )) //|| (c == " ")))
	 	{
	 		alert(nameMsg);
			nameObj.focus();
			return false
	 	}
	 }
     	 return true
}
 function AddText(nameObj,nameMsg)
{
	 var i=0
		 names=nameObj.value;
	 for(i;i<names.length;i++)
	 {
	 	var c=names.charAt(i)
	 	if (!(((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z"))|| ((c >= "0") && (c <= "9")) || (c == ".")|| (c == ",")|| (c == "-")|| (c == " ")))
	 	{
	 		alert(nameMsg);
			nameObj.focus();
			return false
	 	}
	 }
     	 return true
}

function EmailValid(emailtext,MsgErr)
{

	if (trim(emailtext.value) == "")
	{
		MsgErr=MsgErr+"-- Email cannot be blank";
		alert(MsgErr);
		emailtext.focus();
		return false;
	}
	
	emailStr=emailtext.value;

	var emailPat=/^(.+)@(.+)$/

	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"

	var validChars="\[^\\s" + specialChars + "\]"

	var quotedUser="(\"[^\"]*\")"

	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/

	var atom=validChars + '+'

	var word="(" + atom + "|" + quotedUser + ")"

	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	var matchArray=emailStr.match(emailPat)
		if (matchArray==null) 
	{
	  	MsgErr=MsgErr+"-- Email address seems incorrect (check @ and .'s)";
				alert(MsgErr);
		emailtext.focus();
	return false
	}
	
	var user=matchArray[1]
	var domain=matchArray[2]


	if (user.match(userPat)==null) 
	{

		MsgErr=MsgErr+"--The username in Email doesn't seem to be valid.";
				alert(MsgErr);
		emailtext.focus();
		return false
	}


	var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) 
	{   
		  for (var i=1;i<=4;i++) 
		  {
			if (IPArray[i]>255) 
			{
				MsgErr=MsgErr+"--Destination IP address is invalid!";
						alert(MsgErr);
				emailtext.focus();
				return false;
			}
		}
			return true;
	
	}

	var domainArray=domain.match(domainPat)
if (domainArray==null) 
	{
		MsgErr=MsgErr+"-- The email doesn't seem to be valid.";
				alert(MsgErr);
		emailtext.focus();
		 return false;
	}

	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length < 2 || 
	 domArr[domArr.length-1].length>3) {
	   
	 MsgErr=MsgErr+"--The address must end in a three-letter domain, or two letter country.";
	 		alert(MsgErr);
	  emailtext.focus();
	  return false;

	}

	if (len<2) {
	   var errStr="This address is missing a hostname!"
	  MsgErr=MsgErr+"--"+errStr;
	  		alert(MsgErr);
			emailtext.focus();
		return false;
	}
	
	return true;
	}




function EmailValid1(emailtext,MsgErr)
{

/*	if (trim(emailtext.value) == "")
	{
		MsgErr=MsgErr+"Email cannot be blank";
		alert(MsgErr);
		emailtext.focus();
		return false;
	}*/
	if (trim(emailtext.value) != '')
	{
	emailStr=emailtext.value;

	var emailPat=/^(.+)@(.+)$/

	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"

	var validChars="\[^\\s" + specialChars + "\]"

	var quotedUser="(\"[^\"]*\")"

	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/

	var atom=validChars + '+'

	var word="(" + atom + "|" + quotedUser + ")"

	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	var matchArray=emailStr.match(emailPat)
		if (matchArray==null) 
	{
	  	MsgErr=MsgErr+"-- Email address seems incorrect (check @ and .'s)";
				alert(MsgErr);
		emailtext.focus();
	return false
	}
	
	var user=matchArray[1]
	var domain=matchArray[2]


	if (user.match(userPat)==null) 
	{

		MsgErr=MsgErr+"--The username in Email doesn't seem to be valid.";
				alert(MsgErr);
		emailtext.focus();
		return false
	}


	var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) 
	{   
		  for (var i=1;i<=4;i++) 
		  {
			if (IPArray[i]>255) 
			{
				MsgErr=MsgErr+"--Destination IP address is invalid!";
						alert(MsgErr);
				emailtext.focus();
				return false;
			}
		}
			return true;
	
	}

	var domainArray=domain.match(domainPat)
if (domainArray==null) 
	{
		MsgErr=MsgErr+"-- The email doesn't seem to be valid.";
				alert(MsgErr);
		emailtext.focus();
		 return false;
	}

	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length < 2 || 
	 domArr[domArr.length-1].length>3) {
	   
	 MsgErr=MsgErr+"--The address must end in a three-letter domain, or two letter country.";
	 		alert(MsgErr);
	  emailtext.focus();
	  return false;

	}

	if (len<2) {
	   var errStr="This address is missing a hostname!"
	  MsgErr=MsgErr+"--"+errStr;
	  		alert(MsgErr);
			emailtext.focus();
		return false;
	}
}
	return true;
	}




function ForceEntry(strObject,strMessage)
{
var Charss = " -_/:,.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var Chars = " +-()0123456789";
tti = strObject.value;
 if (trim(tti) != '')
 {
	for (var i = 0; i < tti.length; i++)
	{
		if (i == 0)
		{
			if (Charss.indexOf(tti.charAt(i)) == 0)
			{
				alert(strMessage);
				strObject.focus();
				return false;
			}
		}
		if (Charss.indexOf(tti.charAt(i)) == -1)
		{
			alert(strMessage);
				strObject.focus();
			return false;
		}
	}
}
else
{
		alert(strMessage);
		strObject.focus();
  return false;
  }
  return true;
}

function ForceEntry1(strObject,strMessage)
{
var Charss = " -_/:,.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
//var Chars = " +-()0123456789";
tti = strObject.value;
 if (trim(tti) != '')
 {
	for (var i = 0; i < tti.length; i++)
	{
		if (i == 0)
		{
			if (Charss.indexOf(tti.charAt(i)) == 0)
			{
				alert(strMessage);
				strObject.focus();
				return false;
			}
		}
		if (Charss.indexOf(tti.charAt(i)) == -1)
		{
			alert(strMessage);
				strObject.focus();
			return false;
		}
	}
}
  return true;
}


function isPost(strObject,strMessage)
{
//var Charss = " -_/:,.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var Chars = " +-()0123456789";
tti = strObject.value;
 if (trim(tti) != '')
 {
	for (var i = 0; i < tti.length; i++)
	{
		if (i == 0)
		{
			if (Chars.indexOf(tti.charAt(i)) == 0)
			{
				alert(strMessage);
				strObject.focus();
				return false;
			}
		}
		if (Chars.indexOf(tti.charAt(i)) == -1)
		{
			alert(strMessage);
				strObject.focus();
			return false;
		}
	}
}
else
{
		alert(strMessage);
		strObject.focus();
  return false;
  }
  return true;
}

 function Validphone(strObject,strMessage)
 {
	var Charsss = " +-()0123456789-";
	var Charssss = " -0123456789,./";
tti = strObject.value;

 if (trim(tti) != '')
 {
	for (var i = 0; i < tti.length; i++)
	{
		if (i == 0)
		{
			if (Charsss.indexOf(tti.charAt(i)) == 0)
			{
				alert(strMessage)
				strObject.focus();
				return false;
			}
		}
		if (Charsss.indexOf(tti.charAt(i)) == -1)
		{
				alert(strMessage)
				strObject.focus();
				return false;
		}
	}
 }
  return true;
}

 function Validphone(strObject,strMessage)
 {
	var Charsss = " +-()0123456789-";
	var Charssss = " -0123456789,./";
tti = strObject.value;

 if (trim(tti) != '')
 {
	for (var i = 0; i < tti.length; i++)
	{
		if (i == 0)
		{
			if (Charsss.indexOf(tti.charAt(i)) == 0)
			{
				alert(strMessage)
				strObject.focus();
				return false;
			}
		}
		if (Charsss.indexOf(tti.charAt(i)) == -1)
		{
				alert(strMessage)
				strObject.focus();
				return false;
		}
	}
 }
 else
{
		alert(strMessage);
		strObject.focus();
  return false;
  }


  return true;
}


 function Validphone1(strObject,strMessage)
 {
	var Charsss = " +-()0123456789-";
	var Charssss = " -0123456789,./";
tti = strObject.value;

 if (trim(tti) != '')
 {
	for (var i = 0; i < tti.length; i++)
	{
		if (i == 0)
		{
			if (Charsss.indexOf(tti.charAt(i)) == 0)
			{
				alert(strMessage)
				strObject.focus();
				return false;
			}
		}
		if (Charsss.indexOf(tti.charAt(i)) == -1)
		{
				alert(strMessage)
				strObject.focus();
				return false;
		}
	}
 }
  return true;
}

function DateValid(DField,MField,YField)
	{
		if (isNaN(DField.value) == true)
		{
			alert( "Invalid Date" );
			DField.focus();
			return false;
		}
		else if (isNaN(MField.value) == true)
		{
			alert( "Invalid Month" );
			MField.focus();
			return false;
		}
		else if (isNaN(YField.value) == true)
		{
				alert( "Invalid year" );
			YField.focus();
			return false;
		}
		else if (YField.value =="")
		{
			alert( "Invalid year" );
			YField.focus();
			return false;
		}
		if(YField.value.length < 4)
		{
			alert( "Invalid year" );
			YField.focus();
			return false;
		}
		if(!isDate(eval(DField.value),eval(MField.value),eval(YField.value)))
		{
			alert("Invalid Date");
			YField.focus();
			return false;
		}


		curdate = MField.value+"/"+DField.value+"/"+YField.value;
		var from_date=new Date(curdate);
		var to_date=new Date();

		 if (to_date.getTime() < from_date.getTime())
		 {
			   alert("Your date should be lesser than Current date");
			YField.focus();
			 return false;
		 }
	return true;
	}
	
function isDate(ThisDay,ThisMon,ThisYear)
{
	var ValidDay;
	ThisDay=parseInt(ThisDay);
	ThisMon=parseInt(ThisMon);
	ThisYear=parseInt(ThisYear);
	if(ThisDay>31||ThisMon>12||ThisYear>4000||ThisYear<1||ThisDay<1||ThisMon<1)
		{
		return false;
		}
	switch (ThisMon)
		{
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:
				ValidDay=31;
				break;
		case 2:ValidDay=28;
				if(ThisYear%4==0)
					{
					if(ThisYear%400==0)
						ValidDay=29;
					else
						{
						if(ThisYear%100==0)
							ValidDay=28;
						else
							ValidDay=29;
						}
					}
				break;
		case 4:
		case 6:
		case 9:
		case 11:
				ValidDay=30;
				break;
		default:
				return false;
		}
	if(ValidDay<ThisDay)
		return false;
	else
		return true;
}

function SelectEntry(strObject,strMessage)
{
	if (strObject.value == '')
 	{
	  alert(strMessage);
	  strObject.focus();
	  return false;
	}
return true;
}


function isNum(strObject,strMessage)
{
tti = strObject.value;
 if (trim(tti) != '')
 {
	 if(isNaN(tti))
	 {
		alert(strMessage);
		strObject.focus();
		return false;
	 }
 }
 return true;
}

