
// re-direct to old-browser-warning page if viewer using old browser
function browserRedirect(){
browserName = navigator.appName; 
browserVersion = parseInt(navigator.appVersion); 
if (browserName == "Netscape" && browserVersion == 4) 
	location = "old-browser-warning.html";
else if (browserName == "Netscape" && browserVersion == 3) 
	location = "old-browser-warning.html";
else if (browserName == "Microsoft Internet Explorer" && browserVersion == 3) 
	location = "old-browser-warning.html";
}

function newsDelConf(blurbid){
	if (confirm("Are you sure you want to delete this news entry?"))
		window.location="news_delete.php?blurbid="+blurbid;
}

function courseDelConf(courseid){
	if (confirm("Are you sure you want to delete this class?"))
		window.location="class_delete.php?courseID="+courseid;
}

function subcatDelConf(subcatid){
	if (confirm("Are you sure you want to delete this sub-category?"))
		window.location="subcat_delete.php?subcatID="+subcatid;
}

// open window for directions.php map
function openWin(url){
	window.open(url,"MCCMap","toolbar=no,menubar=no,status=no,width=780,height=590,scrollbars=yes,resize=yes");
}

// Pop-up Window
function NewWindow(PopUp) {

popUp = window.open (PopUp, 'pop');
popUp.focus();
//window.open(PopUp, 'pop');
}

// Text counter
function TextCounter(field, countField, maxLimit) {if (field.value.length > maxLimit) // if too long...trim it!	field.value = field.value.substring(0, maxLimit);else 	countField.value = maxLimit - field.value.length;
}

function uploadConfirm(){
	if (document.getElementsByName("upload_resume").length > 0)
		var uploadType = "resume";
	else if (document.getElementsByName("upload_head_shot").length > 0)
		var uploadType = "head shot";
	if (document.getElementsByName("upload_resume").length > 0 || document.getElementsByName("upload_head_shot").length > 0)
		var upload = confirm("Depending on the size of your " +uploadType + " file and your internet connection, your file upload may take a few moments. Please do not click any other buttons on your web browser during the uploading process.\n\nAfter your file has finished uploading, you will be taken to the next section.");
	if (upload== false)
		return false;
}