//<![CDATA[

// Declarations
/*
var ns4 = (document.layers)? true:false;
var ie4 = (document.all)? true:false;
var ie5mac = ((window.navigator.userAgent.indexOf('MSIE 5.2') >= 0) && (window.navigator.userAgent.indexOf('Mac') >= 0))
var ns6 = (document.getElementById)? true:false;


function setVis(layerID, boolval) {
	if (ie4) { if(document.all[layerID]) document.all[layerID].style.visibility = boolval ? 'visible' : 'hidden'; }
	else if (ns4) { if(document.layers[layerID]) document.layers[layerID].visibility = boolval ? 'show' : 'hide'; }
	else if (ns6) { if(document.getElementById(layerID)) document.getElementById(layerID).style.visibility = boolval ? 'visible' : 'hidden'; }
}
*/


function get(el) {
  return document.getElementById(el);
}

function checkApplication(thisForm) {

	var errorStr = '';
	
	if (eval(thisForm + ".f2_privacy.checked") == false) { errorStr = errorStr + '\n- privacy declaration'; }
	if (eval(thisForm + ".f2_familyName.value") == '') { errorStr = errorStr + '\n- family name'; }
	if (eval(thisForm + ".f2_firstName.value") == '') { errorStr = errorStr + '\n- first name'; }
	if (eval(thisForm + ".f2_dob.value") == '') { errorStr = errorStr + '\n- date of birth'; }
	if (eval(thisForm + ".f2_address.value") == '') { errorStr = errorStr + '\n- address'; }
	if (eval(thisForm + ".f2_suburb.value") == '') { errorStr = errorStr + '\n- suburb/town'; }
	if (eval(thisForm + ".f2_postcode.value") == '') { errorStr = errorStr + '\n- postcode'; }
	if (eval(thisForm + ".f2_email.value") == '') { errorStr = errorStr + '\n- email'; }
	if (eval(thisForm + ".f2_telephone.value") == '') { errorStr = errorStr + '\n- telephone'; }
	if (eval(thisForm + ".f2_parentAddress.value") == '') { errorStr = errorStr + '\n- parents residential address'; }
	if (eval(thisForm + ".f2_parentSuburb.value") == '') { errorStr = errorStr + '\n- parent suburb/town'; }
	if (eval(thisForm + ".f2_parentPostcode.value") == '') { errorStr = errorStr + '\n- parents postcode'; }
	if ((eval(thisForm + ".f2_resident[0].checked") == false) && (eval(thisForm + ".f2_resident[1].checked") == false)) { errorStr = errorStr + '\n- residential status'; }
	if (eval(thisForm + ".f2_schoolName.value") == '') { errorStr = errorStr + '\n- school name'; }
	if (eval(thisForm + ".f2_schoolAddress.value") == '') { errorStr = errorStr + '\n- school address'; }
	if (eval(thisForm + ".f2_schoolSuburb.value") == '') { errorStr = errorStr + '\n- school suburb/town'; }
	if (eval(thisForm + ".f2_schoolPostcode.value") == '') { errorStr = errorStr + '\n- school postcode'; }
	if (eval(thisForm + ".f2_y11_subject_1.value") == '') { errorStr = errorStr + '\n- year 11 - end of year results'; }
	if (eval(thisForm + ".f2_pref1_uni.value") == '') { errorStr = errorStr + '\n- university course that you intend applying for'; }
	if (eval(thisForm + ".f2_whyBC.value") == '') { errorStr = errorStr + '\n- Why are you applying for a UBS Cadetship'; }
	if (eval(thisForm + ".f2_pref.value") == '') { errorStr = errorStr + '\n- DoWhy would you like to work at UBS'; }
	if (eval(thisForm + ".f2_skills.value") == '') { errorStr = errorStr + '\n- What qualities and skills can you offer UBS'; }
	if (eval(thisForm + ".f2_teamwork.value") == '') { errorStr = errorStr + '\n- How are you involved in team work at your school and/or in the community'; }
	if (eval(thisForm + ".f2_achievement.value") == '') { errorStr = errorStr + '\n- Describe the personal achievement of which you are most proud'; }
	if (eval(thisForm + ".f2_declaration.checked") == false) { errorStr = errorStr + '\n- Declaration'; }

	if(errorStr != '') alert('Sorry, you have not completed the form.\nPlease check the following:' + errorStr);
	if(errorStr == '') {
		errorStr = 'Your form will now be submitted. If there are problems you will be asked to edit some fields and re-submit the form.'
		errorStr = errorStr + '\nIf your form has no errors your application form will be submitted to Professional Cadetships Australia for further review.';
		errorStr = errorStr + '\nAn email will also be sent to to your nominated email address (' + eval(thisForm + ".f2_email.value") + ') from info@businesscadetships.com.au outlining the next steps involved in the process.'
		errorStr = errorStr + '\nYou may need to to adjust your spam/junk mail settings to allow emails from info@businesscadetships.com.au.';
		errorStr = errorStr + '\n\nPlease confirm that your email address is ' + eval(thisForm + ".f2_email.value");
		var answer = confirm(errorStr);
		if (answer) { eval(thisForm + ".submit()"); }
	}
}

function approve(appID) {
	var selObj = document.getElementById('slotChoice');
	var selIndex = selObj.selectedIndex;
	if (selObj.options[selIndex].value != '') {
		var alertStr = 'This applicant will be assigned the following slot:\n' + selObj.options[selIndex].text + '\nAn email will be sent to the applicant informing them of their interview slot\nAny previous slot held by the applicant will be marked as free\n\nPlease confirm?';
		var answer = confirm(alertStr);
		if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=approveForInterview&slot=" + selObj.options[selIndex].value; }
	} else {
		alert('You did not choose a timetable slot');
	}
}

function reject(appID) {
	var alertStr = 'Are you sure you wish to REJECT this applicant?\nDoing so will send them an email immediately\nYou will be able to find this applicant in the Rejected section';
	var answer = confirm(alertStr);
	if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=rejectForInterview"; }
}

function remove(appID,view) {
	var alertStr = 'Are you sure you wish to REMOVE this applicant?\nThe applicant will not be notified\n';
	var answer = confirm(alertStr);
	if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=remove&view=" + view; }
}

function assess(appID,view) {
	var alertStr = 'Are you sure you wish to MARK AS PENDING REVIEW ?\nYou will be able to find this applicant in the Pending Review section';
	var answer = confirm(alertStr);
	if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=assess&view=" + view; }
}

function approveShortlist(appID, name, email) {
	var selObj = document.getElementById('categoryChoice');
	var selIndex = selObj.selectedIndex;
	if (selObj.options[selIndex].value != '') {
		var cat = selObj.options[selIndex].value;
		var cat_text = selObj.options[selIndex].text;
		var alertStr = 'The following APPROVAL email will be sent to ' + name + ' at ' + email + ' :\n\nThank you for attending an interview for the UBS Cadetships Program.\n' + cat_text + '.\nUBS will conduct its selection process in early September, at a date to be advised by the Bank.\nIn the meantime, should you accept an offer made by any other cadetship or accounting program please notify Alister Wilkinson at Professional Cadetships Australia.\nIf you choose to decline this invitation to the selection process, please contact Alister straight away:\ndirector@professionalcadets.com.au\nRegards,\nProfessional Cadetships Australia\n\nPlease confirm that this is correct?';
		var answer = confirm(alertStr);
		if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=approveShortlist&cat=" + cat; }
	} else {
		alert('Please choose the type of approval email you would like to send');
	};
}

function approveShortlist_resend(appID, name, email) {
	var selObj = document.getElementById('categoryChoice');
	var selIndex = selObj.selectedIndex;
	if (selObj.options[selIndex].value != '') {
		var cat = selObj.options[selIndex].value;
		var cat_text = selObj.options[selIndex].text;
		var alertStr = 'The following APPROVAL email will be sent to ' + name + ' at ' + email + ' :\n\nThank you for attending an interview for the UBS Cadetships Program.\n' + cat_text + '.\nUBS will conduct its selection process in early September, at a date to be advised by the Bank.\nIn the meantime, should you accept an offer made by any other cadetship or accounting program please notify Alister Wilkinson at Professional Cadetships Australia.\nIf you choose to decline this invitation to the selection process, please contact Alister straight away:\ndirector@professionalcadets.com.au\nRegards,\nProfessional Cadetships Australia\n\nPlease confirm that this is correct?';
		var answer = confirm(alertStr);
		if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=approveShortlist&cat=" + cat; }
	} else {
		alert('Please choose the type of approval email you would like to send');
	};
}

function rejectShortlist(appID, name, email) {
	var alertStr = 'The following REJECTION email will be sent to ' + name + ' at ' + email + ' :\n\nThank you for attending an interview for the UBS Cadetships Program.\nWe regret that you have been unsuccessful in being shortlisted for a cadetship position at UBS.\nAs advised at your interview, we will not be giving feedback to unsuccessful applicants.\nGood luck with your HSC and for the future.\nRegards,\nProfessional Cadetships Australia\n\nPlease confirm that this is correct?';
	var answer = confirm(alertStr);
	if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=rejectShortlist"; }
}

function approveScreening(appID, name, email) {
	var answer = confirm("Are you sure you wish to APPROVE " + name + " for a screening assessment? An email will be sent to " + email);
	if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=approveScreening"; }
}

function rejectScreening(appID, name, email) {
	var answer = confirm("Are you sure you wish to REJECT " + name + " for a screening assessment? An email will be sent to " + email);
	if (answer) { location.href="/admin/action.asp?id=" + appID + "&action=rejectScreening"; }
}


 

var homeOn = new Image(219,45); homeOn.src="menu/aw_menu_home_1.gif"
var homeOff = new Image(219,45); homeOff.src="menu/aw_menu_home_0.gif"

var aboutOn = new Image(219,33); aboutOn.src="menu/aw_menu_about_1.gif"
var aboutOff = new Image(219,33); aboutOff.src="menu/aw_menu_about_0.gif"

var companiesOn = new Image(219,33); companiesOn.src="menu/aw_menu_companies_1.gif"
var companiesOff = new Image(219,33); companiesOff.src="menu/aw_menu_companies_0.gif"

var studyworkOn = new Image(219,33); studyworkOn.src="menu/aw_menu_studywork_1.gif"
var studyworkOff = new Image(219,33); studyworkOff.src="menu/aw_menu_studywork_0.gif"

var opportunitiesOn = new Image(219,33); opportunitiesOn.src="menu/aw_menu_opportunities_1.gif"
var opportunitiesOff = new Image(219,33); opportunitiesOff.src="menu/aw_menu_opportunities_0.gif"

var cadetOn = new Image(219,33); cadetOn.src="menu/aw_menu_cadet_1.gif"
var cadetOff = new Image(219,33); cadetOff.src="menu/aw_menu_cadet_0.gif"

var UBScOn = new Image(219,33); UBScOn.src="menu/aw_menu_ubscadetship_1.gif"
var UBScOff = new Image(219,33); UBScOff.src="menu/aw_menu_ubscadetship_0.gif"

var wwlfOn = new Image(219,33); wwlfOn.src="menu/aw_menu_wwlf_1.gif"
var wwlfOff = new Image(219,33); wwlfOff.src="menu/aw_menu_wwlf_0.gif"

var applOn = new Image(219,33); applOn.src="menu/aw_menu_appl_1.gif"
var applOff = new Image(219,33); applOff.src="menu/aw_menu_appl_0.gif"

var whoweareOn = new Image(219,33); whoweareOn.src="menu/aw_menu_whoweare_1.gif"
var whoweareOff = new Image(219,33); whoweareOff.src="menu/aw_menu_whoweare_0.gif"

var contactOn = new Image(219,33); contactOn.src="menu/aw_menu_contact_1.gif"
var contactOff = new Image(219,33); contactOff.src="menu/aw_menu_contact_0.gif"

//]]>