// JavaScript Document
function cover_open(what_cover){
	document.getElementById("cover").style.display = "block";
	document.getElementById(what_cover).style.display = "block";
}
function cover_close(what_cover){
	document.getElementById("cover").style.display = "none";
	document.getElementById(what_cover).style.display = "none";
	window.resizeBy("1px","1px");
}
//Preload the navigation images

image1=new Image();
image1.src="images/layout/nav_button.gif";

image2=new Image();
image2.src="images/layout/nav_button2.gif";

image3=new Image();
image3.src="images/layout/nav_button3.gif";

image4=new Image();
image4.src="images/layout/nav2_button.gif";

image5=new Image();
image5.src="images/layout/nav2_button2.gif";

//validation of form information
function check_email(who) {
	var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
	return(email.test(who));
}//end check_email

function verify(form){
	if(form=='mailer'){	
		var f=document.forms['mailer'];
	}else if(form=='applyer'){
		var f=document.forms['applyer'];
	}

	if (f.name.value==""){alert('Please enter your name');}else
	if (f.email.value==""){alert('Please enter your email address');}else
	if (!check_email(f.email.value)){alert('Please double check your email address');}else
	if (f['message'].value==""){alert('You forgot to enter your comments or question.');}else
	if(f.resume){if (f.resume.value==""){alert('Please attach a resume.');}else{f.submit();}
	}else{
		f.submit();		
	}//end if emptys
	
}//end verify

//prevent right click on images
var message="Sorry but we've disabled the right click function to help protect our content.";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

