/****** 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 + "locate_over.gif";
	newimage2.src = rPath + "htariff_over.gif";
	newimage3.src = rPath + "shop_over.gif";
	newimage4.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";

}

/****** FORM FUNCTIONS ******/

function errorCheck() {			
		
	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();		
	}
}


/****** PRELOADER ******/

function ProdLoader(id){
var image1 = new Image();
image1.src = rPath + id + ".jpg";	
//alert(image1.src);
}

/****** WINDOW OPENER ******/

function openindex(element) { 
//alert(element);
var pix= new Image();
pix.src = rPath + element + ".jpg";
var up1 = pix.height;
var across1 = pix.width;
var up2 = up1+80;
var across2 =across1+40;
//var OpenWindow=window.open("prodwin.php?id="+element+"&h="+up1+"&w="+across1, "new"+element, "height="+up2+", width="+across2+", "); 
var OpenWindow=window.open("picwin.php?id="+element+"&w="+across1, "new"+element, "height="+up2+", width="+across2+", "); 
}

/****** WINDOW OPENER ******/

function openindex2(element) { 
//alert(element);
var pix= new Image();
pix.src = rPath + element + ".swf";
var up1 = pix.height;
var across1 = pix.width;
var up2 = up1+80;
var across2 =across1+40;
//var OpenWindow=window.open("prodwin.php?id="+element+"&h="+up1+"&w="+across1, "new"+element, "height="+up2+", width="+across2+", "); 
var OpenWindow=window.open("picwin.php?id="+element+"&w="+across1, "new"+element, "height="+up2+", width="+across2+", "); 
}
