
var i=new Date();
var year=i.getFullYear();
var selbox;

function InitializeDate(datetext)
{ 
	selbox = datetext;	
	selbox.options.length = 0;
	for(var i=1; i<=31; i++)
	{
		selbox.options[selbox.options.length] = new Option(i,i);
	}
}

function InitializeYear(yeartext)
{	

	selbox = yeartext;	
	selbox.options.length = 0;
	selbox.options[selbox.options.length] = new Option("Year","");
	for(var i=year; i>=(year-90); i--)
	{
		selbox.options[selbox.options.length] = new Option(i,i);
	}
	
}

function InitializeEduEndYear(yeartext)
{	

	selbox = yeartext;	
	selbox.options.length = 0;
	selbox.options[selbox.options.length] = new Option("Year","");
	for(var i=year+5; i>=(year-85); i--)
	{
		selbox.options[selbox.options.length] = new Option(i,i);
	}
}


function SetupEnddate(chosen,endyear)
{
	selbox = endyear;
	selbox.options.length = 0;

	for(var i=chosen; i<=2008; i++)
	{
		selbox.options[selbox.options.length] = new Option(i,i);
	}
}

function SetupCurrentJob(currentjob,edate,emonth,eyear,sdate,smonth,syear)
{
	if(currentjob.checked)
	{
		edate.disabled=true;
		emonth.disabled=true;
		eyear.disabled=true;
		edate.value='';
		emonth.value='';
		eyear.value='';	
	}
	else
	{
		edate.disabled=false;
		emonth.disabled=false;
		eyear.disabled=false;
		edate.value=sdate;
		emonth.value=smonth;
		eyear.value=syear;	
	}
}

function required(text,checkcondition,Name)
{
	if(text.value==checkcondition)
	{
		alert("Please enter the " + Name);
		text.focus();
		return false;			
	}
}


function required1(text,checkcondition,Name)
{
	if(text.value==checkcondition)
	{
		alert("Please select " + Name);
		text.focus();
		return false;			
	}
}
function RestrictMaxLength(textName,mlength)
{
	if(textName.value.length>=mlength)
	alert("Please enter less than "+mlength+" characters");
}



