
//window.defaultStatus = 'duischool.net';

var menuItems = new Array('home','directions','contact');
var hlc = '#ffffcc';
var dc = '';


function mOver(obj){
	obj.style.backgroundColor = hlc;
	window.status = obj.innerText;
}

function mOut(obj){
	obj.style.backgroundColor = dc;
	window.status = window.defaultStatus;
}



/*************************************/



function showDiv(divID,bool){
	document.getElementById(divID).className = (bool) ? 'divOn' : 'divOff';
}

function switchView(pageURL){
	window.location = pageURL;	
}

function switchView_old(divID){
	for(i=0;i<menuItems.length;i++){
		if ( menuItems[i] != divID ) {
			showDiv(menuItems[i],false); // hide this page
		}
		else {
			showDiv(divID,true); // show the selected page
		}
	}	
}


function validate(theForm){
	msg ='';

	if(theForm.FirstName.value==''){
		msg += 'First Name\n';
	}

	if(theForm.LastName.value==''){
		msg += 'Last Name\n';
	}

	if(theForm.Phone.value=='' && theForm.Email.value==''){
		msg += 'Contact phone or E-mail\n';
	}

	if(!theForm.HowFoundSite || theForm.HowFoundSite.selectedIndex==0 ){
		msg += 'How did you find this site?\n';
	}

	if(msg==''){
		theForm.btnSubmit.disabled = true;
		return true;
	}
	else{
		alert('The following fields are incomplete:\n\n' + msg);
		return false;
	}
}
