
function checkForm(f){

	for(i=0; i<f.length; i++){
		if(f[i].value == "" && f[i].className == 'required'){
			alert("Please fill out all required fields.");
			return false;
		} else if(f[i].name == "email" && f[i].value.indexOf('@') == -1){
			alert("Please enter a valid email address.");
			return false;
		}
	}
	
	return true;
}


function submitForm(f){
	if(checkForm(f)){
		f.submit();
	}

}


// ------------------------------------------

//funtion to select a menu and go
function jumpPage(newLoc) {
 newPage = newLoc.options[newLoc.selectedIndex].value
 if (newPage != "") {
 window.location.href = newPage
 }
}
//end of funtion to select a menu and go

//start function to change image rollovers//

 if (document.images) {


 }
 function ImgRoll(imgName,newImg) {
	 //alert(imgName);
	// alert(imgName.substring(imgName.length,2));
	//if(imgName.substring(imgName.length,4)=='_ro'){

  //alert('hi');
	//}
	// if (str.substring(0, str.length-1)==_ro)

	// alert(newImg);
 if (document.images) {
   document[imgName].src= eval(newImg + ".src")
 }
 }
 function Head_highlight(id){
	// document.getElementById(id).class="highlight";
 }
 function Head_Normal(id){
	// document.getElementById(id).class="normal";
 }

function highlightPage(id,imgName2) {
	//alert(imgName2);
document.getElementById(id).src=eval(imgName2 +".src")
     }

//pop up window function//

 leftPos = 0
 if (screen) {
 leftPos = screen.width-800
 }

function windowOpener(url,width,height,offsetLeft,menubar) {
winWidth = 520
winHeight = 440
winLeft = leftPos
winMenu = "no"

if (width) winWidth = width
if (height) winHeight = height
if (offsetLeft) winLeft -= offsetLeft
if (menubar) winMenu = menubar

newWindow = window.open(url, 'newin', 'scrollbars=no,resizable=no,status=no,width='+winWidth+',height='+winHeight+',left='+winLeft+',menubar='+winMenu+',top=100px,');
newWindow.focus();
}

//end of pop up window function//


//layer navigaiton function/

var activeSub=0;
var SubNum=0;

 //global variables

 var timerID = null;
 var timerOn = false;
 var timecount = 1000;
 var what = null;
 var newbrowser = true;
 var check = false;

 function init(){
 if (document.layers) {
 layerRef="document.layers";
 styleSwitch="";
 visibleVar="show";
 screenSize = window.innerWidth;
 what ="ns4";


}else if(document.all){
 layerRef="document.all";
 styleSwitch=".style";
 visibleVar="visible";
 screenSize = document.body.clientWidth + 10;
 what ="ie";

 }else if(document.getElementById){
 layerRef="document.getElementByID";
 styleSwitch=".style";
 visibleVar="visible";
 what="moz";

 }else{
 what="none";
 newbrowser = false;
 }


 window.status='';
 check = true;
 }

 // This Function turns the layers on and off
 function showLayer(layerName){
	 //alert(layerName);
  if(check){
  if (what =="none"){
return;
}
 else if (what == "moz"){
 document.getElementById(layerName).style.visibility="visible";
}
 else{
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
 }
 }
 else {
 return;}
 }

 function hideLayer(layerName){
 if(check){
 if (what =="none"){
 return;
 }
 else if (what == "moz"){
 document.getElementById(layerName).style.visibility="hidden";
 }
 else{
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
 }

 }
 else {
 return;}
 }

 function hideAll(){
 hideLayer('nav1');
 hideLayer('nav2');
 hideLayer('nav3');
 hideLayer('nav4');
 hideLayer('nav5');
  
 }


 function startTime() {
 if (timerOn == false) {
 timerID=setTimeout( "hideAll()" , timecount);
 timerOn = true;

 }

 }


 function stopTime() {
 if (timerOn) {
 clearTimeout(timerID);
 timerID = null;
 timerOn = false;
 }
 }

 function onLoad(){
init();

 }