if (window.location.href==window.location.hostname+"/qdrecruiter/script.js")
{window.location.href=window.location.hostname+"/qdrecruiter/";}
function validate()
{
var len=validate.arguments.length;
var nmstr="";
var num="empty";
for(i=0;i<len;++i)
{
var argument="";
var type="";
var sel="";
var selmultlen=0;
var textval="";
var selectedindx="";
var ret="";
var selmult=0;
argument=validate.arguments[i];
if (argument==false)
{return false;}
if (argument)
{
type=argument.type;
	if (type=="text")
	{
	textval=argument.value;
	i=i+1;
		if (textval=="")
		{
		nmstr+="^ "+validate.arguments[i]+".\n";
		if (num=="empty")
		{num=(i-1);}
		}
	}
	if (type=="select-one")
	{
	sel=argument;
	selectedindx=argument.selectedIndex;
	i=i+1;
		if (selectedindx==validate.arguments[i])
		{
		i=i+1;
		nmstr+="^ "+validate.arguments[i]+".\n";
			if (num=="empty")
			{num=(i-2);}
		}
		else
		{i=i+1;}
	}
	if (type=="select-multiple")
	{
	selmult=argument;
	selmultlen=argument.length;
		if (selmultlen<2)
		{
		i=i+1;
		nmstr+="^ "+validate.arguments[i]+".\n";
			if (num=="empty")
			{num=(i-1);}
		}
	}
	if (type=="password")
	{
	textval=argument.value;
	i=i+1;
		if (textval=="")
		{
		nmstr+="^ "+validate.arguments[i]+".\n";
			if (num=="empty")
			{num=(i-1);}
		}
	}
	if (type=="file")
	{
	textval=argument.value;
	i=i+1;
		if (textval=="")
		{
		nmstr+="^ "+validate.arguments[i]+".\n";
			if (num=="empty")
			{num=(i-1);}
		}
	}
	if (type=="textarea")
	{
	textval=argument.value;
	i=i+1;
		if (textval=="")
		{
		nmstr+="^ "+validate.arguments[i]+".\n";
			if (num=="empty")
			{num=(i-1);}
		}
	}
}
}
if (nmstr!="")
{
alert ("Please ensure the following data is entered correctly:-\n\n"+nmstr);
validate.arguments[num].focus();
return false;
}
else
{return true;}
}
function TextIfSelect()
{
var sel=TextIfSelect.arguments[0].options[TextIfSelect.arguments[1]].selected;
var title=TextIfSelect.arguments[2];
if (sel==true)
{
	for (i=3;i<TextIfSelect.arguments.length;++i)
	{
		if (TextIfSelect.arguments[i].value=="")
		{
		alert ("Sorry, you have not entered "+title+".");
		TextIfSelect.arguments[i].focus();
		return false;
		}
		else
		{return true;}
	}
}
}

function decimalnumber(name,title)
{
var value=name.value;
var length=value.length;
var result=0;
var pattern=/\d+[.]{0,1}\d*/;
result=pattern.exec(value);
if (result==null)
	{result='';}
if (result!=value)
	{
	alert ("Sorry, "+title+" entered by you is not valid.\nPlease do not use any alphabet characters.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function confpassword(pwd, confpwd)
{
var password=pwd.value;
var confirmpassword=confpwd.value;
if (password!=confirmpassword)
{
alert ("Sorry, Confirm Password does not match with\nthe password entered. Please retype it.")
confpwd.focus();
confpwd.select();
return false;
}
else
{return true;}
}
function emailcheck(name,title)
{
var email=name.value;
var pattern=/.+[@].+\..+/;
var result='';
result=pattern.exec(email);
if (email=="")
{email=null;}
if (result!=email)
{
alert ("Sorry, "+title+" is not valid.");		
name.focus();
name.select();
return false;
}
else
{return true;}
}
function isnumber(name,title)
{
var value=name.value;
var result=0;
var pattern=/\d+/;
result=pattern.exec(value);
if (value=="")
{value=null;}
if (result!=value)
{
	alert ("Sorry, "+title+" is not valid.");
	name.focus();
	name.select();
	return false;
}
else
{return true;}
}
function NonAlphabet(name,title)
{
var value=name.value;
var pattern=/[^a-zA-z]+/;
var result='';
result=pattern.exec(value);
if (value=="")
{value=null;}
	if (result!=value)
	{
	alert ("Sorry, "+title+" is invalid.\nPlease do not use any alphabets.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function TwoCharacters(name,title)
{
var value=name.value;
var length=value.length;
var result=0;
var pattern=/[a-zA-Z0-9]{2}/;
result=pattern.exec(value);
if (result==null)
	{result='';}
if (result!=value)
	{
	alert ("Sorry, "+title+" entered by you is invalid.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function NoSpecialCharacters(name,title)
{
var value=name.value;
var length=value.length;
var result=0;
var pattern=/[a-zA-Z0-9]{3}/;
result=pattern.exec(value);
if (result==null)
	{result='';}
if (result!=value)
	{
	alert ("Sorry, "+title+" entered by you is invalid.\nPlease do not use Special Characters.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function DateMonthFormat(name, title)
{
var val=name.value;
var len=val.length;
var months=["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
var pattern=/\d+/;
if (len==4)
{
var dt=val.substr(0,1);
var mon=val.substr(1);
}
else
{
var dt=val.substr(0,2);
var mon=val.substr(2);
}
mon=mon.toLowerCase();
if (val=="")
{return true;}
else
{
	if (pattern.exec(dt)!=dt)
	{
	alert ("Sorry "+title+" enterred by you is invalid.");
	name.focus();
	name.select();
	return false;
	}
	else
	{
	if (mon==months[0] || mon==months[2] || mon==months[4] || mon==months[6] || mon==months[7] || mon==months[9] || mon==months[11])
	{
		if (dt>31 || dt<1)
		{
		alert ("Sorry "+title+" enterred by you is invalid.");
		name.focus();
		name.select();
		return false;
		}
		else
		{return true;}
	}
	else if (mon==months[1])
	{
		if (dt>29 || dt<1)
		{
		alert ("Sorry "+title+" enterred by you is invalid.");
		name.focus();
		name.select();
		return false;
		}
		else
		{return true;}
	}
	else if (mon==months[3] || mon==months[5] || mon==months[8] || mon==months[10])
	{
		if (dt>30 || dt<1)
		{
		alert ("Sorry "+title+" enterred by you is invalid.");
		name.focus();
		name.select();
		return false;
		}
		else
		{return true;}
	}
	else
	{
	alert ("Sorry "+title+" enterred by you is invalid.");
	name.focus();
	name.select();
	return false;
	}
	}
}
}
function EnterAtleastOne()
{
var title=EnterAtleastOne.arguments[0];
var entered=0;
for (i=1;i<EnterAtleastOne.arguments.length;++i)
{
	if (EnterAtleastOne.arguments[i].value!="")
	{entered=1;}
}
if (entered==0)
{
alert ("Please enter atleast one "+title+".");
EnterAtleastOne.arguments[1].focus();
return false;
}
else
{return true;}
}
function TextIfOption()
{
var opt=TextIfOption.arguments[0];
var checkind=TextIfOption.arguments[1];
var title=TextIfOption.arguments[TextIfOption.arguments.length-1];
var optchk=opt[checkind].checked;
if (optchk==true)
{
	for (i=2;i<(TextIfOption.arguments.length-1);++i)
	{
	var textval=TextIfOption.arguments[i].value;
	if (textval=="")
		{
		alert ("Please enter "+title+".")
		TextIfOption.arguments[i].focus();
		return false;
		}
	}
}
}
function newwindow()
{
var present="no";
var newWindow=window.open(newwindow.arguments[0],newwindow.arguments[1],"width="+newwindow.arguments[2]+",height="+newwindow.arguments[3]+",status="+newwindow.arguments[4]+",resizable="+newwindow.arguments[5]+",scrollbars=yes,directories=no");
//alert (newWindow+", "+document.childWindows);
newWindow.moveTo(newwindow.arguments[6], newwindow.arguments[7]);
if (document.childWindows)
{document.childWindows[document.childWindows.length-1]=newWindow;}
else
{document.childWindows=[newWindow];}
}
function CloseWindows()
{
if (document.childWindows)
{
	for (i=0;i<document.childWindows.length;++i)
	{
	if (document.childWindows[i].closed==false)
	{
	var WinObj=document.childWindows[i];
	WinObj.close();
	}
	}
document.childWindows.length=0;
}
}
function ChangeSelect(hdn, sel1, sel2)
{
var arr=hdn.value.split(",");
var arrin="";
var r="";
for (i=0;i<arr.length;++i)
{
arrin=arr[i].split("|");
	if (sel1.options[sel1.selectedIndex].value==arrin[0])
	{
		if (arrin.length>2)
		{
		sel2.length=(arrin.length-1)/2+1;
		for (c=1;c<sel2.length;c++)
		{
			if (c==1)
			{
			sel2.options[c].value=arrin[c];
			sel2.options[c].text=arrin[c+1];
			}
			else
			{
			sel2.options[c].value=arrin[2*c-1];
			sel2.options[c].text=arrin[2*c];
			}
		}
		}
		else
		{sel2.length=1;}
	sel2.options[0].selected=true;
	}
}
}
function monthchange(datelist, monthlist, yearlist)
{
	var eachdt="";
	for(t=0;t<datelist.length;t++)
	{
		eachdt=datelist.options[t].text;
		datelist.options[t].text=eachdt.replace(/[-]{1}\s*\w*[*]{0,1}/g, "");
	}
	var Months=["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
	var Days=["Sun*", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
	var NoofDays=[31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
	if (datelist.length>31)
	{
		var curdt=datelist.options[datelist.selectedIndex].text;
		var curind="";
		datelist.options[0] = null;
		for (a=0;a<datelist.length;++a)
		{
			if (datelist.options[a].text==curdt)
			{
				curind=a;
			}
		}
		datelist.options[curind].selected=true;
	}
	if (monthlist.length>12)
	{
		var curmn = monthlist.options[monthlist.selectedIndex].text;
		var curmnind="";
		monthlist.options[0] = null;
		for (b=0; b < monthlist.length;++b)
		{
			if (monthlist.options[b].text==curmn)
			{
				curmnind=b;
			}
		}
		monthlist.options[curmnind].selected=true;
	}
	if (yearlist.length>4)
	{
		var curyr=yearlist.options[yearlist.selectedIndex].text;
		var curyrind="";
		yearlist.options[0] = null;
		for (c=0;c<yearlist.length;++c)
		{
			if (yearlist.options[c].text==curyr)
			{
				curyrind=c;
			}
		}
		yearlist.options[curyrind].selected=true;
	}
	
	var LastDayIdx=0;
	var LastDays=0;
	
	for (p=1989;p<parseInt(yearlist.options[yearlist.selectedIndex].text);++p)
	{
		var LastYrLeap=p%4;
		if (LastYrLeap==0)
		{
			LastDays=LastDays+366;
		}
		else
		{
			LastDays=LastDays+365;
		}
	}	
	
	var length=monthlist.length;
	var i=monthlist.selectedIndex;
	var yr=yearlist.selectedIndex;
	var dt=datelist.selectedIndex;
	var DtArr=datelist.options[dt].text.split("-");
	var dttxt=DtArr[0];
	var year=yearlist.options[yr].text;
	var month=monthlist.options[i].text.toLowerCase();
	var leap=year%4;
	var MonthIdx="";
	for (q=0;q<Months.length;q++)
	{
		if (month==Months[q])
		{
			MonthIdx=q;
		}
	}
	if (MonthIdx==0)
	{
		var TotalDays=LastDays;
	}
	else
	{
		/*alert (MonthIdx+", "+leap);*/
		if (leap==0 && MonthIdx>1)
		{
			var TotalDays=LastDays+NoofDays[MonthIdx-1]+1;
		}
		else
		{
			var TotalDays=LastDays+NoofDays[MonthIdx-1];
		}
	}
	
	var FirstDay=LastDayIdx+(TotalDays%7);
	/*alert (FirstDay+", "+LastDayIdx+", "+TotalDays);*/
	if (month=="feb")
	{
		if (leap==0)
		{
			if (dttxt>29)
			{
				datelist.options[0].selected=true;
			}
			datelist.length=29;
			datelist.options[28].text="29";
			datelist.options[28].value="29";
		}
		else
		{
			if (dttxt>28)
			{
				datelist.options[0].selected=true;
			}
			datelist.length=28;
		}
	}
	else if (month=="apr" || month=="jun" || month=="sep" || month=="nov")
	{
		if (dttxt>30)
		{
			datelist.options[0].selected=true;
		}
		datelist.length=30;
		datelist.options[28].text="29";
		datelist.options[28].value="29";
		datelist.options[29].text="30";
		datelist.options[29].value="30";
	}
	else
	{
		datelist.length=31;
		datelist.options[28].text="29";
		datelist.options[28].value="29";
		datelist.options[29].text="30";
		datelist.options[29].value="30";
		datelist.options[30].text="31";
		datelist.options[30].value="31";	
	}
	
	datelist.options[0].text+="- "+Days[FirstDay];
	for (r=1;r<datelist.length;r++)
	{
		if (FirstDay==6)
		{
			FirstDay=0;
			datelist.options[r].text+="- "+Days[FirstDay];
		}
		else
		{
			datelist.options[r].text+="- "+Days[++FirstDay];
		}
	}
}


function yearchange(datelist, monthlist, yearlist)
{
var eachdt="";
for (t=0;t<datelist.length;t++)
{
eachdt=datelist.options[t].text;
datelist.options[t].text=eachdt.replace(/[-]{1}\s*\w*[*]{0,1}/g, "");
}
var Months=["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
var Days=["Sun*", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var NoofDays=[31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
if (datelist.length>31)
{
var curdt=datelist.options[datelist.selectedIndex].text;
var curind="";
datelist.options[0] = null;
	for (a=0;a<datelist.length;++a)
	{
		if (datelist.options[a].text==curdt)
		{curind=a;}
	}
datelist.options[curind].selected=true;
}
if (monthlist.length>12)
{
var curmn=monthlist.options[monthlist.selectedIndex].text;
var curmnind="";
monthlist.options[0] = null;
	for (b=0;b<monthlist.length;++b)
	{
		if (monthlist.options[b].text==curmn)
		{curmnind=b;}
	}
monthlist.options[curmnind].selected=true;
}
if (yearlist.length>4)
{
var curyr=yearlist.options[yearlist.selectedIndex].text;
var curyrind="";
yearlist.options[0] = null;
	for (c=0;c<yearlist.length;++c)
	{
		if (yearlist.options[c].text==curyr)
		{curyrind=c;}
	}
yearlist.options[curyrind].selected=true;
}
var LastDayIdx=0;
var LastDays=0;	/*Based on 31 dec 1989 day calculation*/
for (p=1989;p<parseInt(yearlist.options[yearlist.selectedIndex].text);p++)
{
	var LastYrLeap=p%4;
	if (LastYrLeap==0)
	{LastDays=LastDays+366;}
	else
	{LastDays=LastDays+365;}
}
var yr=yearlist.selectedIndex;
var dt=datelist.selectedIndex;
var dttxt=datelist.options[dt].text;
var year=yearlist.options[yr].text;
var DtArr=datelist.options[dt].text.split("-");
var dttxt=DtArr[0];
var i=monthlist.selectedIndex;
var month=monthlist.options[i].text.toLowerCase();
var leap=year%4;
var MonthIdx="";
for (q=0;q<Months.length;q++)
{
	if (month==Months[q])
	{MonthIdx=q;}
}
if (MonthIdx==0)
{var TotalDays=LastDays;}
else
{
	if (leap==0 && MonthIdx>1)
	{var TotalDays=LastDays+NoofDays[MonthIdx-1]+1;}
	else
	{var TotalDays=LastDays+NoofDays[MonthIdx-1];}
}
var FirstDay=LastDayIdx+(TotalDays%7);
/*alert (FirstDay+", "+TotalDays+", "+LastDays);*/
if (month=="feb")
{
if (leap==0)
{
	if (dttxt>29)
	{datelist.options[0].selected=true;}
datelist.length=29;
datelist.options[28].text="29";
datelist.options[28].value="29";
}
else
{
	if (dttxt>28)
	{datelist.options[0].selected=true;}
datelist.length=28;
}
}
datelist.options[0].text+="- "+Days[FirstDay];
for (r=1;r<datelist.length;r++)
{
		if (FirstDay==6)
		{
		FirstDay=0;
		datelist.options[r].text+="- "+Days[FirstDay];
		}
		else
		{datelist.options[r].text+="- "+Days[++FirstDay];}
}
}
function alphabetcheck(name,title)
{
var value=name.value;
var pattern=/[a-zA-z]+/;
var result='';
result=pattern.exec(value);
if (value=="")
{value=null;}
	if (result!=value)
	{
	alert ("Sorry, "+title+" is invalid.\nPlease do not use numeric or special characters.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function SelectHiddenValue(name,hiddenfield,joinstr)
{
var len=name.length;
var hiddenval=0;
if (name)
{
var type=name.type;
	if (type=="select-multiple")
	{
		for (i=0;i<len;++i)
		{
			if (name.options[i].selected==true)
			{
				if (i==0)
				{hiddenval=name.options[i].value;}
				else
				{hiddenval+=joinstr+name.options[i].value;}
			}
		/*alert ("I="+i+" hiddenval="+hiddenval);*/
		}
	hiddenfield.value=hiddenval;
	return true;
	}
}
}
function Transfer(all, chosenlist)
{
	var a,p,s,t;
	var str="";		
	var i=all.selectedIndex;
	var m = all.length;	
	for(p=1;p<m;++p)
	{
		var n = chosenlist.length;
		var present='';
		var result=all.options[p].selected;
		if (result==true)
		{
		a=all.options[p].value;
		t=all.options[p].text;
		for (s=0;s<n;++s)
		{
		if (chosenlist.options[s].text==t && chosenlist.options[s].value==a)
			{present=chosenlist.options[s].text;}
		}
		/*alert ("PRESENT="+present+" N="+n);*/
		if (present=="")
		{
		chosenlist.length=n+1;
		chosenlist.options[n].text=t;
		chosenlist.options[n].value=a;
		}
		}
	}	
}
function Remove(chosenlist)
{
	var sel="";
	var n = chosenlist.length;
	var i = chosenlist.selectedIndex;
	var p=1;
	if (n>1)
	{
	do{
	sel=chosenlist.options[p].selected;
	if (sel==true)
	{
	/*alert ("Text="+document.ZoneCreate.CityList.options[p].text+" P="+p);*/
	chosenlist.options[p]=null;
	p=p-1;
	}
	++p;
	}while (p!=chosenlist.length)
	}
}
function CompleteDate(name,title)
{
var months=[["jan",31], ["feb",28], ["mar",31], ["apr",30], ["may",31], ["jun",30], ["jul",31], ["aug",31], ["sep",30], ["oct",31], ["nov",30], ["dec",31]];
var dt="";
var mth="";
var mthIndx="empty";
var yr="";
var leap="";
var val=name.value;
if (val!="")
{
var seperate=val.split("-");
if (seperate.length==3)
{
yr=2000+seperate[2];
mth=seperate[1].toLowerCase();
dt=seperate[0];
leap=yr%4;
	if ((yr*0)!=0)
	{
	alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
	name.focus();
	name.select();
	return false;
	}
	for (i=0;i<months.length;++i)
	{
		if (months[i][0]==mth)
		{mthIndx=i;}
	}
if (mthIndx!="empty")
{
	if (leap==0)
	{months[1][1]=29;}
	if (dt>months[mthIndx][1])
	{
	alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
else
{
alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
name.focus();
name.select();
return false;
}
}
else
{
alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
name.focus();
name.select();
return false;
}
}
else
{return true;}
}
function SmallDate(name)
{
var val=name.value;
var len=val.length;
var dt,mon,year;
if (len==6 || len==7)
{
if (len==6)
{
dt=val.substr(0, 1);
mon=val.substr(1, 3);
year=val.substr(4, 2);
}
if (len==7)
{
dt=val.substr(0, 2);
mon=val.substr(2, 3);
year=val.substr(5, 2);
}
year=year.toString();
/*year="20"+year;*/
name.value=dt+"-"+mon+"-"+year;
}
}
function DDMMMYYFormat(name, title)
{
if (name.value!="")
{
var val=name.value;
var len=val.length;
var dte,mon,year;
if (len==6 || len==7)
{
if (len==6)
{
dte=val.substr(0, 1);
mon=val.substr(1, 3);
year=val.substr(4, 2);
}
if (len==7)
{
dte=val.substr(0, 2);
mon=val.substr(2, 3);
year=val.substr(5, 2);
}
year=year.toString();
var seperate=[dte, mon, year];
var months=[["jan",31], ["feb",28], ["mar",31], ["apr",30], ["may",31], ["jun",30], ["jul",31], ["aug",31], ["sep",30], ["oct",31], ["nov",30], ["dec",31]];
var dt="";
var mth="";
var mthIndx="empty";
var yr="";
var leap="";
yr=2000+seperate[2];
mth=seperate[1].toLowerCase();
dt=seperate[0];
leap=yr%4;
	if ((yr*0)!=0)
	{
	alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
	name.focus();
	name.select();
	return false;
	}
	for (i=0;i<months.length;++i)
	{
		if (months[i][0]==mth)
		{mthIndx=i;}
	}
if (mthIndx!="empty")
{
	if (leap==0)
	{months[1][1]=29;}
	if (dt>months[mthIndx][1])
	{
	alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
else
{
alert ("Sorry, "+title+" entered by you is Invalid.\nPlease enter date in DDMMMYY format.");
name.focus();
name.select();
return false;
}
}
else
{
alert ("Sorry, "+title+" you have entered is invalid.\nPlease enter date in ddmmmyy format.");
name.focus();
name.select();
return false;
}
}
}
function DateCheck(fromdate,frommonth,fromyear,todate,tomonth,toyear,title)
{
var fromdatesel=fromdate.selectedIndex;
var todatesel=todate.selectedIndex;
var frommonthsel=frommonth.selectedIndex;
var tomonthsel=tomonth.selectedIndex;
var fromyearsel=fromyear.selectedIndex;
var toyearsel=toyear.selectedIndex;
var months=["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
var fromdatetext=fromdate.options[fromdatesel].value;
var todatetext=todate.options[todatesel].value;
var frommonthtext=frommonth.options[frommonthsel].text;
var tomonthtext=tomonth.options[tomonthsel].text;
var fromyeartext=fromyear.options[fromyearsel].text;
var toyeartext=toyear.options[toyearsel].text;
var tomon,frommon;
for (i=0;i<months.length;i++)
{
	if (frommonthtext.toLowerCase()==months[i])
	{frommon=i;}
	if (tomonthtext.toLowerCase()==months[i])
	{tomon=i;}
}
/*alert ("FromDt="+fromdatetext+" FromMn="+frommon+" FromYR="+fromyeartext+"\nTODT="+todatetext+" TOMN="+tomon+" TOYR="+toyeartext);*/
if (parseInt(fromyeartext)>parseInt(toyeartext))
{
alert ("Sorry, "+title);
fromyear.focus();
return false;
}
else if (parseInt(fromyeartext)==parseInt(toyeartext))
{
	if (frommon>tomon)
	{
	alert ("Sorry, "+title);
	frommonth.focus();
	return false;
	}
	else if (frommon==tomon)
	{
		if (parseInt(fromdatetext)>=parseInt(todatetext))
		{
		alert ("Sorry, "+title);
		fromdate.focus();
		return false;
		}
		else
		{return true;}
	}
	else
	{return true;}
}
else
{return true;}
}
function DateWindow()
{
var present="no";
alert (DateWindow.arguments[0]);
var newWindow=window.open(DateWindow.arguments[0],DateWindow.arguments[1],"width="+DateWindow.arguments[2]+",height="+DateWindow.arguments[3]+",status="+DateWindow.arguments[4]+",resizable="+DateWindow.arguments[5]+",scrollbars=yes,directories=no");
alert (newWindow+", "+document.childWindows);
newWindow.moveTo(DateWindow.arguments[6], DateWindow.arguments[7]);
if (document.childWindows)
{document.childWindows[document.childWindows.length]=newWindow;}
else
{document.childWindows=[newWindow];}
newWindow.DateList=DateWindow.arguments[8];
newWindow.MonthList=DateWindow.arguments[9];
newWindow.YearList=DateWindow.arguments[10];
alert ("DATELIST = "+newWindow.DateList);
}
function RadioChecked(nm, title)
{
var Chk="empty";
/*alert (nm+", "+nm.length);*/
if (nm.length)
{
	for (var i=0;i<nm.length;i++)
	{
	if (nm[i].checked==true)
	{Chk=i;}
	}
}
else
{
	if (nm.checked==true)
	{Chk=1;}
}
if (Chk=="empty")
{
alert ("Please select a "+title);
return false;
}
}
function SubTotalAfterMultiply()
{
var CurValue=SubTotalAfterMultiply.arguments[0].value;
if (CurValue=="")
{SubTotalAfterMultiply.arguments[0].value=0;}
var CurMultiple=SubTotalAfterMultiply.arguments[1].value;
var title=SubTotalAfterMultiply.arguments[2];
if (CurMultiple=="")
{SubTotalAfterMultiply.arguments[1].value=0;}
var total=SubTotalAfterMultiply.arguments[3];
var value=parseFloat(SubTotalAfterMultiply.arguments[0].value)*parseFloat(CurMultiple);
var ignoremsg=0;
if (title!="")
{
var result=0;
var pattern=/\d+[.]{0,1}\d*/;
result=pattern.exec(CurValue);
if (result==null)
	{result='';}
if (result!=CurValue)
	{
	alert ("Sorry, "+title+" entered by you is not valid.\nPlease do not use any alphabet characters.");
	SubTotalAfterMultiply.arguments[0].focus();
	SubTotalAfterMultiply.arguments[0].select();
	return false;
	}
	else
	{
		for (i=4;i<SubTotalAfterMultiply.arguments.length;++i)
		{
		var TxtVal="";
		var Mult="";
		if (SubTotalAfterMultiply.arguments[i])
		{
			if (SubTotalAfterMultiply.arguments[i].value=="")
			{SubTotalAfterMultiply.arguments[i].value=0;}
		/*value=parseFloat(value);*/
		TxtVal=parseFloat(SubTotalAfterMultiply.arguments[i].value);
		i=i+1;
		if (SubTotalAfterMultiply.arguments[i].value=="")
		{SubTotalAfterMultiply.arguments[i].value=0;}
		Mult=parseFloat(SubTotalAfterMultiply.arguments[i].value);
		value+=(TxtVal*Mult);
		}
		}
	}
}
else
{
	for (i=4;i<SubTotalAfterMultiply.arguments.length;++i)
	{
	var TxtVal="";
	var Mult="";
	if (SubTotalAfterMultiply.arguments[i])
	{
		if (SubTotalAfterMultiply.arguments[i].value=="")
		{SubTotalAfterMultiply.arguments[i].value=0;}
		value=parseFloat(value);	
		TxtVal=parseFloat(SubTotalAfterMultiply.arguments[i].value);
		i=i+1;
		if (SubTotalAfterMultiply.arguments[i].value=="")
		{SubTotalAfterMultiply.arguments[i].value=0;}
		Mult=parseFloat(SubTotalAfterMultiply.arguments[i].value);
		value+=(TxtVal*Mult);
	}
	}
}
total.value=roundup(value.toString());
return true;	
}
function TotalAfterMultiply()
{
var CurValue=TotalAfterMultiply.arguments[0].value;
if (CurValue=="")
{TotalAfterMultiply.arguments[0].value=0;}
var CurMultiple=TotalAfterMultiply.arguments[1].value;
if (CurMultiple=="")
{TotalAfterMultiply.arguments[1].value=0;}
var CurMultiple1=TotalAfterMultiply.arguments[2].value;
if (CurMultiple1=="")
{TotalAfterMultiply.arguments[2].value=0;}
var title=TotalAfterMultiply.arguments[3];
var total=TotalAfterMultiply.arguments[4];
var value=(parseFloat(TotalAfterMultiply.arguments[0].value)*parseFloat(TotalAfterMultiply.arguments[1].value))*parseFloat(TotalAfterMultiply.arguments[2].value);
var ignoremsg=0;
/*alert ("1="+TotalAfterMultiply.arguments[0].value+" 2="+TotalAfterMultiply.arguments[1].value+" 3="+TotalAfterMultiply.arguments[2].value+"\nVAL="+value);*/
if (title!="")
{
var result=0;
var pattern=/\d+[.]{0,1}\d*/;
result=pattern.exec(CurValue);
if (result==null)
	{result='';}
if (result!=CurValue)
	{
	alert ("Sorry, "+title+" entered by you is not valid.\nPlease do not use any alphabet characters.");
	TotalAfterMultiply.arguments[0].focus();
	TotalAfterMultiply.arguments[0].select();
	return false;
	}
	else
	{
		for (i=5;i<TotalAfterMultiply.arguments.length;i++)
		{
		var TxtVal="";
		var Mult="";
		if (TotalAfterMultiply.arguments[i])
		{
			if (TotalAfterMultiply.arguments[i].value=="")
			{TotalAfterMultiply.arguments[i].value=0;}
		/*value=parseFloat(value);*/
		TxtVal=parseFloat(TotalAfterMultiply.arguments[i].value);
		i=i+1;
		Mult=parseFloat(TotalAfterMultiply.arguments[i].value);
		if (Mult=="")
		{TotalAfterMultiply.arguments[i].value=0;}
		i=i+1;
		if (TotalAfterMultiply.arguments[i].value=="")
		{TotalAfterMultiply.arguments[i].value=0;}
		value+=(TxtVal*Mult)*parseFloat(TotalAfterMultiply.arguments[i].value);
		}
		}
	}
}
else
{
	for (i=5;i<TotalAfterMultiply.arguments.length;i++)
	{
	var TxtVal="";
	var Mult="";
	if (TotalAfterMultiply.arguments[i])
	{
		if (TotalAfterMultiply.arguments[i].value=="")
		{TotalAfterMultiply.arguments[i].value=0;}
		value=parseFloat(value);	
		TxtVal=parseFloat(TotalAfterMultiply.arguments[i].value);
		i=i+1;
		Mult=parseFloat(TotalAfterMultiply.arguments[i].value);
		if (Mult=="")
		{TotalAfterMultiply.arguments[i].value=0;}
		i=i+1;
		if (TotalAfterMultiply.arguments[i].value=="")
		{TotalAfterMultiply.arguments[i].value=0;}
		value+=(TxtVal*Mult)*parseFloat(TotalAfterMultiply.arguments[i].value);
	}
	}
}
total.value=roundup(value.toString());
return true;	
}
function SubTotal()
{
var value=parseFloat(SubTotal.arguments[0].value);
var title=SubTotal.arguments[1];
var total=SubTotal.arguments[2];
/*alert ("1st="+SubTotal.arguments[0]+"\n\ntitle="+SubTotal.arguments[1]+"\n\ntotal="+SubTotal.arguments[2]+"\n\nLEN="+SubTotal.arguments.length);*/
var result=0;
var pattern=/\d+[.]{0,1}\d*/;
result=pattern.exec(value);
	if (result==null)
	{result='';}
	if (result!=value)
	{
	alert ("Sorry, "+title+" entered by you is not valid.\nPlease do not use any alphabet characters.");
	SubTotal.arguments[0].focus();
	SubTotal.arguments[0].select();
	return false;
	}
	else
	{
		for (i=3;i<SubTotal.arguments.length;i++)
		{
		if (SubTotal.arguments[i])
		{
			if (SubTotal.arguments[i].value=="")
			{SubTotal.arguments[i].value=0;}
			value+=parseFloat(SubTotal.arguments[i].value);
		}
		}
	}
total.value=roundup(value.toString());
return true;
}
function roundup(par)
{
if (par!="")
{
/*alert (typeof(par));*/
var rlt=par.split(".");
var beforedecimal=rlt[0];
var thirddecimal="";
var firsttwo="";
var afterdecimal=rlt[1];
if (rlt.length==2)
{
	if (afterdecimal.length<=2)
	{return par;}
	else
	{
	thirddecimal=afterdecimal.charAt(2);
	firsttwo=afterdecimal.substr(0, 2);
		if (thirddecimal>4)
		{
			if (firsttwo==99)
			{
			beforedecimal++;
			firsttwo="00";
			}
			else
			{firsttwo++;}
		}
	par=beforedecimal+"."+firsttwo;
	return par;
	}
}
else
{return par;}
}
else
{return 0;}
}
function anyonechecked()
{
if (anyonechecked.arguments[0])
{
var title=anyonechecked.arguments[anyonechecked.arguments.length-1];
var chk="empty";
	if (anyonechecked.arguments[0].value==anyonechecked.arguments[1])
	{
	for (i=2;i<(anyonechecked.arguments.length-1);++i)
	{
		if (anyonechecked.arguments[i].checked==true)
		{chk=i;}
	}
	if (chk=="empty")
	{
	alert ("Please Check atleast one "+title+".");
	return false;
	}
	else
	{return true;}
	}
}
else
{return false;}
}
function resetall(FormName)
{
for (var i=0;i<FormName.elements.length;i++)
{
var Elmt=FormName.elements[i];
var c=0;
	if (Elmt.type == "text" || Elmt.type == "file" || Elmt.type == "textarea" || Elmt.type == "password")
	{Elmt.value=Elmt.defaultValue;}
	if (Elmt.type == "checkbox" || Elmt.type == "radio")
	{Elmt.checked=Elmt.defaultChecked;}
	/*if (Elmt.type=="radio")
	{
		alert ("LEN = "+Elmt.defaultChecked);
		for (c=0;c<Elmt.length;c++)
		{Elmt[c].checked=Elmt[c].defaultChecked;}
	}*/
	if (Elmt.type == "select-one" || Elmt.type == "select-multiple")
	{
		for (c=0;c<Elmt.length;c++)
		{Elmt.options[c].selected=Elmt.options[c].defaultSelected;}
	}
}
}
function Check()
{
var selidx=Check.arguments[0].selectedIndex;
var title=Check.arguments[1];
if (selidx < 0)
{
alert ("Please select atleast one"+title);
Check.arguments[0].focus();
return false;
}
}
function AlsoEnter()
{
var title=AlsoEnter.arguments[0];
if (AlsoEnter.arguments[1].value!="" && AlsoEnter.arguments[2].value!="")
{
	for (i=3;i<AlsoEnter.arguments.length;++i)
	{
		if (AlsoEnter.arguments[i].value=="")
		{
		alert ("Please also enter "+title);
		AlsoEnter.arguments[i].focus();
		return false;
		}
	}
return true;
}
else
{return true;}
}
function NoSpecialChar(name,title)
{
var value=name.value;
var length=value.length;
var result=0;
var pattern=/[a-zA-Z0-9]+/;
result=pattern.exec(value);
if (result==null)
	{result='';}
if (result!=value)
	{
	alert ("Sorry, "+title+" entered by you is invalid.\nPlease do not use Special Characters.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function CheckTheGiven()
{
var len=CheckTheGiven.arguments.length;
for (i=0;i<len;++i)
{
	if (CheckTheGiven.arguments[i])
	{CheckTheGiven.arguments[i].checked=true;}
}
}
function UncheckTheGiven()
{
var len=UncheckTheGiven.arguments.length;
for (i=0;i<len;++i)
{
	if (UncheckTheGiven.arguments[i])
	{UncheckTheGiven.arguments[i].checked=false;}
}
}
function urlcheck(name,title)
{
var value=name.value;
var length=value.length;
var result=0;
var pattern=/\S+/;
result=pattern.exec(value);
if (result==null)
	{result='';}
if (result!=value)
	{
	alert ("Sorry, "+title+" entered by you contains an invalid space.");
	name.focus();
	name.select();
	return false;
	}
	else
	{return true;}
}
function NoNumbers(name,title)
{
var value=name.value;
var result=0;
var pattern=/\D+/;
result=pattern.exec(value);
if (value=="")
{value=null;}
if (result!=value)
{
	alert ("Sorry, "+title+" is not valid.\nPlease do not use numeric values.");
	name.focus();
	name.select();
	return false;
}
else
{return true;}
}
function DateComparison(txt1, txt2, title)
{
if (txt1.value!="" && txt2.value!="")
{
var val1=txt1.value.split("-");
var val2=txt2.value.split("-");
var months=[["jan",31], ["feb",29], ["mar",31], ["apr",30], ["may",31], ["jun",30], ["jul",31], ["aug",31], ["sep",30], ["oct",31], ["nov",30], ["dec",31]];
var fdt=val1[0];
var tdt=val2[0];
if(fdt.charAt(0)==0)
{fdt=fdt.charAt(1);}
if (tdt.charAt(0)==0)
{tdt=tdt.charAt(1);}
var fmth=val1[1].toLowerCase();
var tmth=val2[1].toLowerCase();
var fyr=val1[2];
var tyr=val2[2];
var fmthidx="empty";
var tmthidx="empty";
if (parseInt(fyr)<=parseInt(tyr))
{
	if (parseInt(fyr)==parseInt(tyr))
	{
		for (i=0;i<months.length;++i)
		{
			if (fmth==months[i][0])
			{fmthidx=i;}
			if (tmth==months[i][0])
			{tmthidx=i;}
		}
		if (parseInt(fmthidx)==parseInt(tmthidx))
		{
			if (parseInt(fdt)>=parseInt(tdt))
			{
			alert ("Sorry, "+title+".");
			txt1.focus();
			txt1.select();
			return false;
			}
		}
		else if (parseInt(fmthidx)>parseInt(tmthidx))
		{
		alert ("Sorry, "+title+".");
		txt1.focus();
		txt1.select();
		return false;
		}
	}
}
else
{
alert ("Sorry, "+title+".");
txt1.focus();
txt1.select();
return false;
}
}
else
{return true;}
}
function HiddenValue(name,hiddenfield,joinstr)
{
var len=name.length;
var hiddenval=0;
if (name)
{
var type=name.type;
	if (type=="select-multiple")
	{
		for (i=0;i<len;++i)
		{
			if (i==0)
			{hiddenval=name.options[i].value;}
			else
			{hiddenval+=joinstr+name.options[i].value;}
		/*alert ("I="+i+" hiddenval="+hiddenval);*/
		}
	hiddenfield.value=hiddenval;
	return true;
	}
}
}

