<!--

// rollover script

var oldSrc;

	//preload all images
	 var num = document.images.length;
         var img,posn,temp,orig,newsrc;
         var preload = new Array();
         for(var i = 0; i<num; i++) {
                 img = document.images[i].src;
                 posn = img.indexOf("toolbar_");
                         if(posn > -1){
							dot = img.lastIndexOf(".");
							temp = img.substr(dot,img.length);
							orig = img.substr(0,dot);
							newsrc = orig + "_over" + temp;

							preload[i] = new Image();
							preload[i].src = newsrc;
                         }else{
                         posn = img.indexOf("nav_");
                         if(posn > -1){
							dot = img.lastIndexOf(".");
							temp = img.substr(dot,img.length);
							orig = img.substr(0,dot);
							newsrc = orig + "_over" + temp;
							preload[i] = new Image();
							preload[i].src = newsrc;
                         }
                         }
         }
		//-------------------------------
		//initiate the navigation script(shtml version//not used)
		//initNavigation();
		//-------------------------------		 


function getSrc(n){
    img = n.toString();
         eval("n = document." + img + ".src");
         if(n.indexOf("_over")< 0){
                 dot = n.lastIndexOf(".");
                 temp = n.substr(dot,n.length).toString();
                 orig = n.substr(0,dot).toString();
                 newsrc = orig + "_over" + temp;
                 newsrc = newsrc.toString();
		 return newsrc;
         }
        else{return n;}
 }

    function swap(imgname) {
       n = arguments[0].toString();
                   eval("oldSrc = document." + n + ".src");		
                   old = n;
                  eval("document." + n + ".src = getSrc('" + imgname + "')");
 }


function restore(){
      eval("document." + img + ".src=oldSrc");

 }
// -->

var revert = new Array();
	var inames = new Array('nav_1', 'nav_2', 'nav_3', 'nav_4', 'nav_5', 'nav_6', 'nav_7', 'nav_8', 'tool_6', 'tool_7', 'tool_8');
	var ipath = "/development/reports/ehs/2004/_images/"
	
	if (document.images) { // Preload
	  var flipped = new Array();
	  for(i=0; i< inames.length; i++) {
		flipped[i] = new Image();
		flipped[i].src= ipath + inames[i] +"_over.gif";
	  }
	}
	
	function over(num) {
	  if(document.images) {
		revert[num]=document.images[inames[num]].src;
		document.images[inames[num]].src= flipped[num].src;
	  }
	}
	function out(num) {
	  if(document.images) document.images[inames[num]].src= revert[num];
	}

//----------------
// function to pop up photos in their own window throughout the report
//----------------
	function popPhoto(photo,w,h){
		newWindow =  window.open("/development/reports/ehs/2004/ehs_image.asp?image="+ photo,"image",
		"width=100, height=100, resizable=no,scrollbars=no,status=0,location=no" );
		var width = w + 35;
		var height = h + 80;
		newWindow.resizeTo(width, height);
		}




