<!--

//outside links
function link(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=400,left = 20,top = 20');");
}

//image pop-up window
function image(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=513,left = 20,top = 20');");
}

//results pop-up window
function results(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=513,left = 20,top = 20');");
}

//form pop-up window
function form(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=657,height=513,left = 20,top = 20');");
}

//print window
function varitext(text){
	text=document
	print(text)
}

//pic_album table update
function update(url) {
	document['index'].src=url;
}

//sadow's email address
function advisorEmail() {
	user = "jsadowski";
	site = "bdsd.k12.wi.us";
	linkName = "Email Mr. Jim Sadowski";
	document.write('<a href=\"mailto:' + user + '@' + site + '\">');
	document.write(linkName + '</a>');
}

//eric's email address
function ericEmail() {
	user = "esuminski";
	site = "wi.rr.com";
    linkName = "Email Eric Suminski";
    document.write('<a href=\"mailto:' + user + '@' + site + '\">');
    document.write(linkName + '</a>');
}

//barb's email address
function BarbEmail() {
	user = "bfleming";
	site = "bdsd.k12.wi.us";
    linkName = "Email Barb Fleming";
    document.write('<a href=\"mailto:' + user + '@' + site + '\">');
    document.write(linkName + '</a>');
}

//formFeedback validation function
function formFeedbackValidation() {
	var rbTypeSelect = null;
	for (var i=0; i < document.formFeedback.rbType.length; i++) {
		if (document.formFeedback.rbType[i].checked) {
			rbTypeSelect = document.formFeedback.rbType[i].value;
			break;
		}
	}
	if (rbTypeSelect == null) {
		alert("Please select a feedback type.");
		return false;
	}
	
	var rbAffiliationSelect = null;
	for (var i=0; i < document.formFeedback.rbAffiliation.length; i++) {
		if (document.formFeedback.rbAffiliation[i].checked) {
			rbAffiliationSelect = document.formFeedback.rbAffiliation[i].value;
			break;
		}
	}
	if (rbAffiliationSelect == null) {
		alert("Please select an affiliation.");
		return false;
	}
	
	var rbOtherOption = document.formFeedback.rbAffiliation.length;
	if (document.formFeedback.rbAffiliation[rbOtherOption - 1].checked) {
		if (document.formFeedback.tfOther.value == "") {
			alert("Please specify 'Other' affiliation.");
			document.formFeedback.tfOther.focus();
			return false;
		}
	}
	
	if (document.formFeedback.tfEmail.value == "") {
		alert("Please specify an Email address.");
		document.formFeedback.tfEmail.focus();
		return false;
	}
	
	if (document.formFeedback.tfEmail.value.indexOf ('@',0) == -1 || 
		document.formFeedback.tfEmail.value.indexOf ('.',0) == -1 ||
		document.formFeedback.tfEmail.value.length < 6) {      
			alert("Please specify a valid Email address.")      
			document.formFeedback.tfEmail.select();      
			document.formFeedback.tfEmail.focus();      
		return false;      
	}
	
	if (document.formFeedback.taFeedback.value == "") {
		alert("Please complete feedback.");
		document.formFeedback.taFeedback.focus();
		return false;
	}
	
	return true;
}

//function to run on load of form
function onStart() {
	document.formFeedback.rbType.focus();	
}

//formMailList validation function
function formMailListValidation() {
	var rbActionSelect = null;
	for (var i=0; i < document.formMailList.rbAction.length; i++) {
		if (document.formMailList.rbAction[i].checked) {
			rbActionSelect = document.formMailList.rbAction[i].value;
			break;
		}
	}
	if (rbActionSelect == null) {
		alert("Please select your request (subscribe or unsubscribe).");
		return false;
	}
	
	if (document.formMailList.tfEmail.value == "") {
		alert("Please specify an Email address.");
		document.formMailList.tfEmail.focus();
		return false;
	}
	
		if (document.formMailList.tfEmail.value.indexOf ('@',0) == -1 || 
		document.formMailList.tfEmail.value.indexOf ('.',0) == -1 ||
		document.formMailList.tfEmail.value.length < 6) {      
			alert("Please specify a valid Email address.")      
			document.formMailList.tfEmail.select();      
			document.formMailList.tfEmail.focus();      
		return false;      
	}

	return true;
}

//formSadowski validation function
function formSadowskiValidation() {
	if (document.formSadowski.tfName.value == "") {
		alert("Please specify a Name.");
		document.formSadowski.tfName.focus();
		return false;
	}
	
	if(document.formSadowski.mYear.value == "") {
		alert("Please select a Year.");
		document.formSadowski.mYear.focus();
		return false;
	}
	
	if (document.formSadowski.tfAddress.value == "") {
		alert("Please specify a Mailing Address.");
		document.formSadowski.tfAddress.focus();
		return false;
	}
	
	if (document.formSadowski.tfCity.value == "") {
		alert("Please specify a City.");
		document.formSadowski.tfCity.focus();
		return false;
	}	
	
	if (document.formSadowski.tfState.value == "") {
		alert("Please specify a State.");
		document.formSadowski.tfState.focus();
		return false;
	}

/*	if (document.formSadowski.tfState.value != "AL" ||
		document.formSadowski.tfState.value != "AK" ||
		document.formSadowski.tfState.value != "AZ" ||
		document.formSadowski.tfState.value != "AR" ||
		document.formSadowski.tfState.value != "CA" ||
		document.formSadowski.tfState.value != "CO" ||
		document.formSadowski.tfState.value != "CT" ||
		document.formSadowski.tfState.value != "DE" ||
		document.formSadowski.tfState.value != "DC" ||
		document.formSadowski.tfState.value != "FL" ||
		document.formSadowski.tfState.value != "GA" || 
		document.formSadowski.tfState.value != "HI" ||
		document.formSadowski.tfState.value != "ID" ||
		document.formSadowski.tfState.value != "IL" ||
		document.formSadowski.tfState.value != "IN" ||
		document.formSadowski.tfState.value != "IA" ||
		document.formSadowski.tfState.value != "KS" ||
		document.formSadowski.tfState.value != "KY" ||
		document.formSadowski.tfState.value != "LA" ||
		document.formSadowski.tfState.value != "ME" ||
		document.formSadowski.tfState.value != "MD" ||
		document.formSadowski.tfState.value != "MA" || 
		document.formSadowski.tfState.value != "MI" ||
		document.formSadowski.tfState.value != "MN" ||
		document.formSadowski.tfState.value != "MS" ||
		document.formSadowski.tfState.value != "MO" ||
		document.formSadowski.tfState.value != "MT" ||
		document.formSadowski.tfState.value != "NE" ||
		document.formSadowski.tfState.value != "NV" ||
		document.formSadowski.tfState.value != "NH" ||
		document.formSadowski.tfState.value != "NJ" ||
		document.formSadowski.tfState.value != "NM" ||
		document.formSadowski.tfState.value != "NY" || 
		document.formSadowski.tfState.value != "NC" ||
		document.formSadowski.tfState.value != "ND" ||
		document.formSadowski.tfState.value != "OH" ||
		document.formSadowski.tfState.value != "OK" ||
		document.formSadowski.tfState.value != "OR" ||
		document.formSadowski.tfState.value != "PA" ||
		document.formSadowski.tfState.value != "RI" ||
		document.formSadowski.tfState.value != "SC" ||
		document.formSadowski.tfState.value != "SD" ||
		document.formSadowski.tfState.value != "TN" ||
		document.formSadowski.tfState.value != "TX" || 
		document.formSadowski.tfState.value != "UT" ||
		document.formSadowski.tfState.value != "VT" ||
		document.formSadowski.tfState.value != "VI" ||
		document.formSadowski.tfState.value != "VA" ||
		document.formSadowski.tfState.value != "WA" ||
		document.formSadowski.tfState.value != "WV" ||
		document.formSadowski.tfState.value != "WI" ||
		document.formSadowski.tfState.value != "WY") {
		alert("Please specify a valid State.");
		document.formSadowski.tfState.select();
		document.formSadowski.tfState.focus();
		return false;
	}
*/	

	if (document.formSadowski.tfZip.value == "") {
		alert("Please specify a Zip Code.");
		document.formSadowski.tfZip.focus();
		return false;
	}
	
	if (document.formSadowski.tfZip.value.length < 5) {
		alert("Please specify a valid Zip Code.")
		document.formSadowski.tfZip.select();
		document.formSadowski.tfZip.focus();
		return false;
	}
	
	if (document.formSadowski.tfPhone.value == "") {
		alert("Please specify a Phone Number.");
		document.formSadowski.tfPhone.focus();
		return false;
	}
	
	if (document.formSadowski.tfPhone.value.length < 12) {
		alert("Please specify a valid Phone Number.")
		document.formSadowski.tfPhone.select();
		document.formSadowski.tfPhone.focus();
		return false;
	}
	
	if (document.formSadowski.tfEmail.value == "") {
		alert("Please specify an Email address.");
		document.formSadowski.tfEmail.focus();
		return false;
	}
	
	if (document.formSadowski.tfEmail.value.indexOf ('@',0) == -1 || 
		document.formSadowski.tfEmail.value.indexOf ('.',0) == -1 ||
		document.formSadowski.tfEmail.value.length < 6) {      
			alert("Please specify a valid Email address.")      
			document.formSadowski.tfEmail.select();      
			document.formSadowski.tfEmail.focus();      
		return false;      
	}
	
	return true;
}

//function to run on load of Sadowski Form
function onStart() {
	document.formSadowski.tfName.focus();	
}

//document.formFeedback.tfOther.disabled = true;
// -->