/****** GLOBAL VARIABLES ******/

var rPath= "images/";

/****** IMAGE PRELOADERS ******/

function preLoader(){

for (x=0; x<=4; x++) {
	imagevar="newimage" + x +" = new Image();"	
	eval(imagevar);
	
}
	newimage0.src = rPath + "home_over.gif";
	newimage1.src = rPath + "cominfo_over.gif";
	newimage2.src = rPath + "project_over.gif";
	newimage3.src = rPath + "contact_over.gif";	
}

/****** BUTTON FUNCTIONS ******/

function buttonover(id) {
document.images[id].src=rPath + [id] +"_over.gif";
}

function buttonup(id) {

document.images[id].src=rPath + [id] +"_up.gif";

}


/****** CHANGE TWO FRAMES ******/

function changehome(){
parent.left.location="leftbar_home.php";
parent.content.location="home.php";
}

function changecominfo(){
parent.left.location="leftbar_cominfo.php";
parent.content.location="cominfo.php";
}

function changeproject(){
parent.left.location="leftbar_project.php";
parent.content.location="projects.php";
}

function changecontact(){
parent.left.location="leftbar_contact.php";
parent.content.location="contact.php";
}

/****** FORM FUNCTIONS ******/

function errorCheck() {	
	
	if (document.email_form.eadd.selectedIndex=="0"){
		alert("Please select a name from the drop down box");
		return false;
	}	
		
		
	if ((document.email_form.name.value=="")||(document.email_form.name.value==" ")){
		alert("Please fill in the 'your name' field");
		return false;
	}
	if ((document.email_form.visitormail.value=="")||(document.email_form.visitormail.value==" ")){
		alert("Please fill in the 'your email' field");
		return false;
	}	
	if ((document.email_form.subject.value=="")||(document.email_form.subject.value==" ")){
		alert("Please fill in the 'subject' field");
		return false;
	}
	if ((document.email_form.notes.value=="")||(document.email_form.notes.value==" ")){
		alert("Please type a message");
		return false;
	}	
		
	else {				
		document.email_form.submit();		
	}
}


