
		<!--

		function deleteOk(myForm){
		confirmOk = true;
			if (confirm("Are you sure you want to delete this employer and all related records for its location, contacts and vacancies?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
			
			
		function checkfeedback(myForm){

			if ((!myForm.txtTitle.value) || (!myForm.txtContact.value) ) {
					alert("Please enter name and subject");
					return;
				}
			else
				{
				myForm.submit();
				}
			}
			
		function deleteVacancy(myForm){
		confirmOk = true;
			if (confirm("Are you sure you want to delete this vacancy?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
			
		function deleteStudent(myForm){
		confirmOk = true;
			if (confirm("Are you sure you want to delete this student?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
			
		function deleteContact(myForm){
		confirmOk = true;
			if (confirm("Are you sure you want to delete this contact?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
			
		function deleteLocation(myForm){
		confirmOk = true;
			if (confirm("Are you sure you want to delete this location?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
			
		function deletePlacement(myForm){
		confirmOk = true;
			if (confirm("Are you sure you want to remove this student from the placement?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
						
		function confirmChange(){
		confirmOk = true;
			if (confirm("Please note that if you have changed the main contact from yourself - you will no longer be able to have access to some areas. Do you still want to continue?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
			
		function SaveEmployer(){
		confirmOk = true;
			if (confirm("Please note that you will be responsible for the details saved in this employer. Do you wish to continue?")){
				confirmOk = true;
				}
			else {
				confirmOk = false;
				}
			return confirmOk;
			}
		
		function feedback(myForm){
			alert("here we are");
			if ((!myForm.txtTitle.value) || (!myForm.txtEmp.value) || (!myForm.txtContact.value) || (!myForm.txtContent.value)) {
					alert("Please enter all values.");
					dataOK = false;
				}
			else
				{
				dataOK = true;
				}
			return dataOK;
			}
		
		function employerSearch(myForm){
			if (myForm.cboInd.value==0)  {
					alert("Please select an industry area to search on");
					dataOK = false;
				}
			else
				{
				dataOK = true;
				}
			return dataOK;
			}
			
		function checkVacancy(myForm){
			if (isNaN(myForm.vacNum.value)){
				alert("Please enter a numeric vacancy number (omit instance letter, eg 85-A, type in 85)");
				return false;
				}
			else{
				return true;
			}
		}
			
		function verifyPwd(myForm){
	
			if ((!myForm.txtStudNum.value) || (!myForm.txtStudPwdNew.value)) {
					alert("Please enter your student ID and new password.");
					dataOK = false;
					}
			else
				{
				if (myForm.txtStudPwdNew.value != myForm.txtStudPwdConfirm.value){
					alert("Your password entries do not match - please re-enter.");
					dataOK = false;
					}
				else
					
					dataOK = true;
					}
				return dataOK;
			}
		
		
		function verifyTimeframe(myForm){
			if (((myForm.cboDays.value!=0) && (myForm.cboMonths.value!=0)) || ((myForm.cboWeeks.value!=0) && (myForm.cboDays.value!=0)) || ((myForm.cboWeeks.value!=0) && (myForm.cboMonths.value!=0))){
					alert("Please choose either day, week or month option for timeframe (not more than 1). Alternatively you may set to '--within all--'.");
					dataOK = false;
				}
			else
				{
				dataOK = true;
				}
			return dataOK;
			}
			
			
			
		function checkJPS(myForm){
			if ((myForm.cbolodgevacacies.value=="NoLodgeVac")&&(myForm.JobsFilled.value=="1")){
				alert("Vacancies lodged must be set to 'Yes' or 'All' if choosing to retrieve where placements filled by Jobnet");
				return false;}
			else{
				return true;
			}
		}
		
		function checkPlacement(myForm){
			if (myForm.cboVacNum.value==0) {
					alert("Please choose a vacancy before attempting to save the placement.");
					dataOK = false;
				}
			else
				{
				dataOK = true;
				}
			return dataOK;
			}
			
		function confirmDeleteSuper(){
			if (confirm("Are you sure you wish to delete this work experience location record?")){
				return true;}
			else{
				return false;
			}
		}
		
		function confirmDeleteReferral(){
			if (confirm("Are you sure you wish to delete this Referral?")){
				return true;}
			else{
				return false;
			}
		}
			
		function checkWE(myForm){
			if ((!myForm.weSuperSN.value) || (!myForm.weSuperGN.value) || (!myForm.weSuperStreet.value) || (!myForm.weSuperSuburb.value) || (!myForm.weSuperPC.value) ||(!myForm.weSuperPhone.value) ||(!myForm.weSuperFax.value)) {
				alert("Please complete all mandatory fields (Email is not mandatory)");
				return false;}
			else{
				return true;
				}
			}

		function checkReferrals(myForm){
			if ((myForm.cboVacNum.value==0) || (myForm.cboStudent.value==0) || (myForm.cboMethod.value==0) || (myForm.cboDay.value==0) || (myForm.cboMonth.value==0) || (myForm.txtYear.value==0)){
				alert ("All required fields must be completed before saving");
				dataOK = false;}
			else{dataOK = true;}
			return dataOK;}
		
		function checkServices(myForm){
			if ((myForm.cboServTypeID.value==0) || (myForm.cboStudent.value==0) || (myForm.txtDeliveredBy.value==0) || (myForm.txtHours.value==0)){
				alert ("All required fields must be completed before saving");
				dataOK = false;}
			else{dataOK = true;}
			return dataOK;}

		function AdminVacOK(myForm){
			if ((!myForm.txtDuties.value) || (!myForm.txtLocn.value)) {
				alert ("Please complete both the Vacancy location and Major Duties fields before saving.");
				dataOK = false;}
			else {dataOK = true; }
			return dataOK;
			}
			
		function validMatch(myForm){
				if (myForm.cboJob(0).selected){
					alert ("Please choose a vacancy.");
					return false;}
				else { 
					myForm["ShowAll"].value = "Yes";
					myForm["LoadVacancy"].value = "Yes";
					myForm.submit();}
			}
		
		function loadVacancyData(myForm)	{		
			if (myForm.cboJob.value != 0) {
				myForm["LoadVacancy"].value = "Yes";
				myForm.submit(); }
			else {
			 return false;}
		}
		
		function ValidateCriteria(myForm){
			if ((myForm.cboDayFrom.value!="") || (myForm.cboMonthFrom.value!="") || (myForm.cboYearFrom.value!="")){
				//Check for valid start date 
				var strDateCheck = myForm.cboDayFrom.value + '/' + myForm.cboMonthFrom.value + '/' + myForm.cboYearFrom.value
				if (!ValidateDate(strDateCheck, myForm.cboDayFrom.value, myForm.cboMonthFrom.value, myForm.cboYearFrom.value))
					{
					return false;
					}
			}
				
			if ((myForm.cboDayTo.value!="") || (myForm.cboMonthTo.value!="") || (myForm.cboYearTo.value!="")){
				//Check for valid start date 
				strDateCheck = myForm.cboDayTo.value + '/' + myForm.cboMonthTo.value + '/' + myForm.cboYearTo.value
				if (!ValidateDate(strDateCheck, myForm.cboDayTo.value, myForm.cboMonthTo.value, myForm.cboYearTo.value))
					{
					return false;
					}
			}
		}

		function ValidateVacancyDate(myForm){
			if ((myForm.cboStartDay.value!="") || (myForm.cboStartMonth.value!="") || (myForm.txtStartYear.value!="")){
				//Check for valid start date 
				strDateCheck = myForm.cboStartDay.value + '/' + myForm.cboStartMonth.value + '/' + myForm.txtStartYear.value
				if (!ValidateDate(strDateCheck, myForm.cboStartDay.value, myForm.cboStartMonth.value, myForm.txtStartYear.value))
					{
					return false;
					}
			}
			
			if ((myForm.cboFollowupDay.value!="") || (myForm.cboFollowupMonth.value!="") || (myForm.txtFollowupYear.value!="")){
				//Check for valid start date 
				strDateCheck = myForm.cboFollowupDay.value + '/' + myForm.cboFollowupMonth.value + '/' + myForm.txtFollowupYear.value
				if (!ValidateDate(strDateCheck, myForm.cboFollowupDay.value, myForm.cboFollowupMonth.value, myForm.txtFollowupYear.value))
					{
					return false;
					}
			}
			
			if ((myForm.cboExpiryDay.value!="") || (myForm.cboExpiryMonth.value!="") || (myForm.txtExpiryYear.value!="")){
				//Check for valid start date 
				strDateCheck = myForm.cboExpiryDay.value + '/' + myForm.cboExpiryMonth.value + '/' + myForm.txtExpiryYear.value
				if (!ValidateDate(strDateCheck, myForm.cboExpiryDay.value, myForm.cboExpiryMonth.value, myForm.txtExpiryYear.value))
					{
					return false;
					}
			}
		}
		
		
		function ValidateAdminEntry(myForm){
			if (!myForm.EWELocID.value) {
				alert("Please get employer details before continuing");
				return false;
			}
	
			if ((!myForm.LecturerSurname.value) ||(!myForm.LecturerFirstNames.value) ||(!myForm.LecturerPhone.value)|| (!myForm.cboProgramArea.value)) {
				alert("Please enter all lecturer details, including program area");
				return false;
			}
			
			if ((!myForm.StudentNumber.value) || (!myForm.StudentSurname.value) || (!myForm.StudentGivenName.value) || (!myForm.DayStart.value) || (!myForm.MonthStart.value) || (!myForm.YearStart.value) || (!myForm.DayEnd.value) || (!myForm.MonthEnd.value) || (!myForm.YearEnd.value)) {
				alert("Please enter all student details, including work experience start and end dates");
				return false;
			}
			
			//Check for valid start date 
			var strDateCheck = myForm.DayStart.value + '/' + myForm.MonthStart.value + '/' + myForm.YearStart.value
			if (!ValidateDate(strDateCheck, myForm.DayStart.value, myForm.MonthStart.value, myForm.YearStart.value))
				{
				return false;
				}
			
			//Check for valid start date 
			strDateCheck = myForm.DayEnd.value + '/' + myForm.MonthEnd.value + '/' + myForm.YearEnd.value
			if (!ValidateDate(strDateCheck, myForm.DayEnd.value, myForm.MonthEnd.value, myForm.YearEnd.value))
				{
				return false;
				}
							
			//Check if category of Other selected, then a description must be entered
			var i
			for(i=0; i<myForm.length; i+=1)
			{
				if (myForm.elements[i].type == 'radio')
				{
					if ((myForm.elements[i].checked) && (myForm.elements[i].value == 'Other'))
					{
						if (!myForm.Other.value) {
							alert ("You have selected a category of Other - please provide a description in the textbox");
							return false;
						}
					}
				}
			}
			
			// check dates are in order
			var startDay = parseInt(myForm.DayStart.value)
			var startMonth = parseInt(myForm.MonthStart.value)
			var startYear = parseInt(myForm.YearStart.value)
			var endDay = parseInt(myForm.DayEnd.value)
			var endMonth = parseInt(myForm.MonthEnd.value)
			var endYear = parseInt(myForm.YearEnd.value)
			
			if (endYear < startYear){
					alert("End date is prior to start date");
					return false;}
			else{
					if ((endMonth < startMonth) && (endYear == startYear)){
						alert("End date is prior to start date");
						return false;}
					else{
						if ((endYear == startYear) && (endMonth == startMonth) && (endDay < startDay)){
								alert("End date is prior to start date");
								return false;}
					}
			}
		}
		
		function ValidateEntry(myForm){
			if (!myForm.EWELocID.value) {
				alert("Please get employer details before continuing");
				return false;
			}
	
			if ((!myForm.LecturerSurname.value) ||(!myForm.LecturerFirstNames.value) ||(!myForm.LecturerPhone.value)|| (!myForm.CourseNumber.value)|| (!myForm.cboProgramArea.value)) {
				alert("Please enter all lecturer details, including program area and course number");
				return false;
			}
			
			if ((!myForm.StudentNumber.value) || (!myForm.StudentSurname.value) || (!myForm.StudentGivenName.value) || (!myForm.DayStart.value) || (!myForm.MonthStart.value) || (!myForm.YearStart.value) || (!myForm.DayEnd.value) || (!myForm.MonthEnd.value) || (!myForm.YearEnd.value)) {
				alert("Please enter all student details, including work experience start and end dates");
				return false;
			}
			
			//Check for valid start date 
			var strDateCheck = myForm.DayStart.value + '/' + myForm.MonthStart.value + '/' + myForm.YearStart.value
			if (!ValidateDate(strDateCheck, myForm.DayStart.value, myForm.MonthStart.value, myForm.YearStart.value))
				{
				return false;
				}
			
			//Check for valid start date 
			strDateCheck = myForm.DayEnd.value + '/' + myForm.MonthEnd.value + '/' + myForm.YearEnd.value
			if (!ValidateDate(strDateCheck, myForm.DayEnd.value, myForm.MonthEnd.value, myForm.YearEnd.value))
				{
				return false;
				}
							
			//Check if category of Other selected, then a description must be entered
			var i
			for(i=0; i<myForm.length; i+=1)
			{
				if (myForm.elements[i].type == 'radio')
				{
					if ((myForm.elements[i].checked) && (myForm.elements[i].value == 'Other'))
					{
						if (!myForm.Other.value) {
							alert ("You have selected a category of Other - please provide a description in the textbox");
							return false;
						}
					}
				}
			}
			
			// check dates are in order
			var startDay = parseInt(myForm.DayStart.value)
			var startMonth = parseInt(myForm.MonthStart.value)
			var startYear = parseInt(myForm.YearStart.value)
			var endDay = parseInt(myForm.DayEnd.value)
			var endMonth = parseInt(myForm.MonthEnd.value)
			var endYear = parseInt(myForm.YearEnd.value)
			
			if (endYear < startYear){
					alert("End date is prior to start date");
					return false;}
			else{
					if ((endMonth < startMonth) && (endYear == startYear)){
						alert("End date is prior to start date");
						return false;}
					else{
						if ((endYear == startYear) && (endMonth == startMonth) && (endDay < startDay)){
								alert("End date is prior to start date");
								return false;}
					}
			}
		}
		
		function CheckWorkExp(myForm){
			myForm.load.value="load";
			myForm.action ="default.asp?mode=New";
			myForm.submit();
		}
		
		function CheckWorkExpExisting(myForm,vid){
				myForm.load.value="load";
				myForm.action ="default.asp?mode=View&VID="+vid;
				myForm.submit();
		}
		
		function CheckWorkExpAdminNew(myForm,eid){
			myForm.action ="?mode=add&type=vacancy&EmployerID="+eid;
			myForm.submit();
		}
		
		function CheckWorkExpAdmin(myForm,vid,eid){
				myForm.load.value="load";
				myForm.action ="admin.asp?mode=details&type=appVac&id="+vid+"&EmployerID="+eid;
				myForm.submit();
		}
		
		
		function CheckStudentNum(myForm){
			if (isNaN(myForm.txtStudNum.value)){
				alert("Please enter a numeric student number");
				
				return false;
				}
			else{
				return true;
			}
		}

		
		function GetStudentDetails()
		{
			var sValue = document.frmWEPRegn.StudentNumber.value;
			var sEWELocIDValue = document.frmWEPRegn.EWELocID.value;
			var sContactIDValue = document.frmWEPRegn.ContactID.value;
			
			if (sValue != "") 
				{
					document.frmWEPRegn.StudentSurname.value="";
					document.frmWEPRegn.StudentGivenName.value="";
					document.frmWEPRegn.action="WorkExpRegn.asp?mode=load&StudentNumber=" + sValue + "&EWELocID=" + sEWELocIDValue + "&ContactID=" + sContactIDValue ;
					document.frmWEPRegn.submit();
				}
		}
		
		
		function ValidateDate(strDate,strDay,strMth,strYr) 
  {
  // Checks for the following valid date formats:
  // DD/MM/YYYY   DD-MM-YYYY 
  // Also separates date into month, day, and year variables
  // Using 4 digits for year because SQL treats YY < 50 as 20YY

  var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;

  // To require a 4 digit year entry, use this line instead:
  // var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;
  var dateStr = strDate //.value;

  var matchArray = dateStr.match(datePat); // is the format ok?

  if (matchArray == null)
    {
    alert("Date is not in a valid format")
    return false;
    }
  month = matchArray[3]; // parse date into variables
  day = matchArray[1];
  year = matchArray[4];
  if (month < 1 || month > 12) 
    { // check month range
    alert("Month must be between 1 and 12");
    return false;
    }
  if (day < 1 || day > 31) 
    {
    alert("Day must be between 1 and 31");
    return false;
    }

  if ((month==4 || month==6 || month==9 || month==11) && day==31) 
    {
	if (month==4)
	  	{month="April";}
	if (month==6)
	  	{month="June";}
	if (month==9)
	  	{month="September";}
	if (month==11)
	  	{month="November";}
    alert(month+" does not have 31 days!")
    return false;
    }
    
  if (month == 2) 
    { // check for february 29th
    var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
    if (day>29 || (day==29 && !isleap)) 
      {
      alert("February " + year + " doesn't have " + day + " days!");
      return false;
      }
    }
  if (year.length !=4) 
    {
    //alert(year.length);
    alert("Please enter a 4 digit year.");
    return false;
    }
  booValidDate = true;
  return true;
  }
		
		
		//  -->