// dreamweaver crappy code

function restoreImage() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showImage() { //v3.0
  var i,j=0,x,a=showImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//onload

window.onload=function(){
	MM_preloadImages('images/menu/home-on.gif','images/menu/services-on.gif','images/menu/qualityProcess-on.gif','images/menu/projects-on.gif','images/menu/photos-on.gif','images/menu/contactUs-on.gif');
	}

//image menu//

//array of images   
var imageNames = new Array();
imageNames[1] = "home";
imageNames[2] = "services";
imageNames[3] = "qualityPolicy";
imageNames[4] = "projects";
imageNames[5] = "photos";
imageNames[6] = "contactUs";
directory = "menu";
//roll over
timer = setTimeout('restorePageImage()',500);
function showImage(imageNumber) {
	clearTimeout(timer);
	for (i=1;i<imageNames.length;i++){
		if (imageNames[i] != "") {
		theImage = document.getElementById(imageNames[i]);
		theImage.src = 'images/'+directory+'/'+imageNames[i]+'-off.gif';
		}
	}	
	if (imageNumber != 0){	
		theImage = document.getElementById(imageNames[imageNumber]);
		theImage.src = 'images/'+directory+'/'+imageNames[imageNumber]+'-on.gif';
	}	
}
//roll out
function restoreImage() {
	timer = setTimeout('restorePageImage()',500);	
}
//
function restorePageImage() {
	for (i=1;i<imageNames.length;i++){
		if (imageNames[i] != "") {
		theImage = document.getElementById(imageNames[i]);
		theImage.src = 'images/'+directory+'/'+imageNames[i]+'-off.gif';
		}
	}	
	if (restoreImageNumber != 0){
	theImage = document.getElementById(imageNames[restoreImageNumber]);
	theImage.src = 'images/'+directory+'/'+imageNames[restoreImageNumber]+'-on.gif';	
	}
}

//create menu
function createMenu() {
document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr><td><a href="index.htm" onmouseout="restoreImage()" onmouseover="showImage(1)"><img src="images/menu/home-off.gif" alt="Home" name="Image4" width="98" height="30" border="0" id="home" /></a></td>');
document.write('<td><a href="services.htm" onmouseout="restoreImage()" onmouseover="showImage(2)"><img src="images/menu/services-off.gif" alt="Services" name="Image5" width="79" height="30" border="0" id="services" /></a></td>');
document.write('<td><a href="qualityPolicy.htm" onmouseout="restoreImage()" onmouseover="showImage(3)"><img src="images/menu/qualityPolicy-off.gif" alt="Quality Process" name="Image6" width="108" height="30" border="0" id="qualityPolicy" /></a></td>');
document.write('<td><a href="projects.htm" onmouseout="restoreImage()" onmouseover="showImage(4)"><img src="images/menu/projects-off.gif" alt="Projects" name="Image7" width="74" height="30" border="0" id="projects" /></a></td>');
document.write('<td><a href="photos.htm" onmouseout="restoreImage()" onmouseover="showImage(5)"><img src="images/menu/photos-off.gif" alt="Photos" name="Image8" width="65" height="30" border="0" id="photos" /></a></td>');
document.write('<td><a href="contactUs.htm" onmouseout="restoreImage()" onmouseover="showImage(6)"><img src="images/menu/contactUs-off.gif" alt="Contact Us" name="Image9" width="85" height="30" border="0" id="contactUs" /></a></td>');
document.write('<td><img src="images/menu/rightCorner.gif" width="151" height="30" /></td></tr></table>');
}
