function verifyStatus(vNbr) {
	if (vNbr == 0) {
		var sMsg = "\nDo you really wish to Activate this job posting?\n\nClick OK to Activate this job posting.\n\nClick CANCEL to go back.";
	} else {
		if (vNbr == 1) {
			var sMsg = "\nDo you really wish to De-activate this job posting?\n\nClick OK to De-activate this job posting.\n\nClick CANCEL to go back.";
			}
		}
	if (confirm(sMsg)) {
		return true; }
	else {
		return false;      
	}
}

function verifyPostingLevel(nbr) {
	if (nbr == 0) {
		var msg = "\nDo you really wish to set the job posting to be displayed only on your site (Local Level)?\n\nClick OK to set the job posting to Local.\n\nClick CANCEL to go back.";
	} else {
		if (nbr == 1) {
			var msg = "\nDo you really wish to set the job posting to be displayed only on the Agedstock Employment site (Global Level)?\n\nClick OK to set the job posting to Global.\n\nClick CANCEL to go back.";
		} else {
			if (nbr = 2) {
				var msg = "\nDo you really wish to set the job posting to be displayed on your site and the Aged Stock Employment site (Local and Global Level)?\n\nClick OK to set the job posting to Local and Global.\n\nClick CANCEL to go back.";
			}
		}
	}
	if (confirm(msg)) {
		return true; }
	else {
		return false;      
	}
}

function verifyDeleteDBEntry() {
	if (confirm("\nDo you really wish to delete this record??\n\n(Once the record is deleted, it can not be recovered!)\n\nClick OK to Delete.\n\nClick CANCEL to go back.")) {
		return true;
	}
	else {
		return false;      
	}
}

function verifyDelete() {
	if (confirm("\nDo you really wish to delete this job posting??\n\n(Once the job posting is deleted, it can not be recovered!)\n\nClick OK to Delete.\n\nClick CANCEL to go back.")) {
		return true; }
	else {
		return false;      
	}
}

function verifyDeleteContact() {
	if (confirm("\nDo you really wish to delete this contact??\n\n(Once the contact is deleted, tehy can not be recovered!)\n\nClick OK to Delete.\n\nClick CANCEL to go back.")) {
		return true; }
	else {
		return false;
	}
}

function sendPosting(arg) {
	var pk = arg;
	var fileVar = 'emp/posting.send.php?pk=' + pk;
	var title = 'newwindow';
	var config = 'height=400, width=500, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=yes';
	window.open (fileVar, title, config);
}

function checkFields() {
	var appFieldArray = new Array("fullname", "address", "city", "postal", "phone", "employer1", "duties1", "employer2", "duties2", "resume");
	var appFieldArrayNames = new Array("Name", "Address", "City", "Postal Code", "Phone Number", "Employer #1", "Duties #1", "Employer #2", "Duties #2", "Resume File");
	missinginfo = "";
	size = appFieldArray.length;
	for (var x = 0; x < size; x++) {
		if(document.form[appFieldArray[x]].value == "") {
			missinginfo += "\n     -  " + appFieldArrayNames[x];
		}
	}
	if (missinginfo != "") {
	missinginfo ="_____________________________\n" + "You failed to correctly fill in your:\n" + missinginfo + "\n_____________________________" + "\nPlease re-enter and submit again!";
	alert(missinginfo);
	return false;
	}
	else return true;
}

extArray = new Array(".doc", ".pdf", ".rtf", ".txt");

function LimitAttach(form, file) {
	allowSubmit = false;
	if (!file) return;
	while (file.indexOf("\\") != -1){
		file = file.slice(file.indexOf("\\") + 1);
		ext = file.slice(file.indexOf(".")).toLowerCase();
		for (var i = 0; i < extArray.length; i++) {
			if (extArray[i] == ext) {
				allowSubmit = true;
				break;
			}
		}
	}
	if (allowSubmit == true){
		form.submit();
	}
	else {
		alert("Please only upload files that end in types:  " + (extArray.join("  ")) + "\nPlease select a new " + "file to upload and submit again.");
		return false;
	}
}
