function img_path (filen) {

from_root = 'design/buttons/'
root = '/'               //server root is empty string
// -- dont edit below this line --

return root+from_root+filen;
}

function preload_images (page) {
	if (document.images) //test if images enabled
	{
		//Home
		button08 = new Image(); button08.src = img_path ('button08.jpg');
		button08_m = new Image(); button08_m.src = img_path ('button08_m.jpg');
		
		//Powerlines
		button01 = new Image(); button01.src = img_path ('button01.jpg');
		button01_m = new Image(); button01_m.src = img_path ('button01_m.jpg');
			
		//Contracting
		button02 = new Image(); button02.src = img_path ('button02.jpg');
		button02_m = new Image(); button02_m.src = img_path ('button02_m.jpg');
	
		//Solar
		button03 = new Image(); button03.src = img_path ('button03.jpg');
		button03_m = new Image(); button03_m.src = img_path ('button03_m.jpg');
	
		//Alternative Energy
		button04 = new Image(); button04.src = img_path ('button04.jpg');
		button04_m = new Image(); button04_m.src = img_path ('button04_m.jpg');
		
		//Health and Safety
		button05 = new Image(); button05.src = img_path ('button05.jpg');
		button05_m = new Image(); button05_m.src = img_path ('button05_m.jpg');

		//Not Just Work
		button06 = new Image(); button06.src = img_path ('button06.jpg');
		button06_m = new Image(); button06_m.src = img_path ('button06_m.jpg');
		
		//Contact
		button07 = new Image(); button07.src = img_path ('button07.jpg');
		button07_m = new Image(); button07_m.src = img_path ('button07_m.jpg');
		
		//preload page image
		if (page) {
			pageImg = new Image(); pageImg.src = img_path (page+'_on.jpg');
		}

	}	
}

function do_over(imagename)
{
	 if (document.images) 
	 {
		document.getElementById(imagename).src = eval(imagename+"_m.src")
	 }
}

function do_out(imagename, f)
{
	 if (document.images) 
	 {
	 	if (f) {
	 		document.getElementById(imagename).src = eval(imagename+".src")
	 	} else {
	 	document.getElementById(imagename).src = eval(imagename+".src") 
	 	}
	 }
}


