// to disable the year select box when 'present' option is selected from end month
function CheckYear(){	
	if (form1.endmonth.options[form1.endmonth.selectedIndex].value =="present"){
		form1.endyear.disabled  = true;
	}
	else{
		form1.endyear.disabled  = false;
	}
}

var vap
var vac
var Eshr
var svac

function VacSave(VacID,JSID, RDBID){
if (vap){
		vap.close()
		}
	vap=window.open('/Members/mbr_vac_save.asp?VACID='+ VacID+ '&JS_ID='+ JSID+ '&RDB_ID='+ RDBID,'VacSave','status=no, menubar=no, scrollbars=no,resizable=no,width=800, height=300');
	vap.focus()
}

function VacView(VacID,xrf){
	vac=window.open('/Members/mbr_vac_view.asp?VACID='+ VacID + '&xrf='+ xrf,'VacView','status=yes,scrollbars=yes,resizable=yes,width=800, height=500')
	vac.focus()
}

function CVSave(CVID,EMID, RDBID){
if (Eshr){
		Eshr.close()
		}
	Eshr=window.open('/Employers/em_cv_save.asp?CVID='+ CVID+ '&EM_ID='+ EMID+ '&RDB_ID='+ RDBID,'CVSave','status=no, menubar=no, scrollbars=no,resizable=no,width=800, height=300');
	Eshr.focus()
}

function CVView(CVID){

	wcv=window.open('/Employers/em_cv_view.asp?CVID='+ CVID,'CVView','status=yes,scrollbars=yes,resizable=yes,width=800,height=600')
	wcv.focus()
}

// set the max number of charaters that can be written to a textarea
	function setMaxlen(imax, iObj, iSpan){
		Limit = imax - iObj.value.length;
		if (Limit > 0) {	
			iSpan.innerHTML = Limit;			
		}
		else {
			iSpan.innerHTML = 0;
			iObj.value = iObj.value.substring(0, imax);
		}
	}
	function initMaxlen(imax, iObj, iSpan){
		Limit = imax - iObj.value.length;
		if (Limit > 0) {	
			iSpan.innerHTML = Limit;			
		}
		else {
			iSpan.innerHTML = 0;
			iObj.value = iObj.value.substring(0, imax);
		}
	}

// for the date of birth it build the exact days for the chosen month and year
function getDays(iYear, iMonth, iDay) {
	var daysInMonth;
	var dPrevDate;
	var myDays;
	var i, j , Len;
	
	//Get the number of days in the chosen month for the chosen year
	dPrevDate = new Date(iYear, iMonth, 0);
	daysInMonth = dPrevDate.getDate();
	myDays = document.form1.day;

	//Remove all values from the select box
	Len = myDays.length - 1
	for(i = Len ; i > 0; i--){
		myDays.options[i]	= null;
	}

	//Add the New values
	for (i = 1; i <= daysInMonth; i++) {
		myDays[i-1]=new Option(i,i);
		if (i==iDay){
			myDays[i-1].selected= true;
		}
	}
}
