function preloadImgs() {
  if(document.images) { 
    if(!document.arrImg) 
      document.arrImg = new Array();
    var i, x = document.arrImg.length, args = preloadImgs.arguments; 
    for(i = 0; i < args.length; i++) 
			if (args[i].indexOf("#") != 0) { 
				document.arrImg[x] = new Image; 
				document.arrImg[x].src = args[i];
				x += 1;
			}
  }
}
//Check browser compatibility so that the code will will not execute
//for browsers below 4.x
var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
  isNav4 = (navigator.appName == "Netscape") ? true : false;
  isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
}


//Since you access "layers" in IE and NS differently,
//you have to see if document.layers and document.all works.
//These simple boolean tests verify that.
var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false

//show a div
function showDiv(id) {
	if (ns4) {
		for(i = 0; i < show.arguments.length; i++){
			document.layers[show.arguments[i]].visibility = "show"
			}
		}
	else if (ie4){
		for(i = 0; i < show.arguments.length; i++){
			document.all[show.arguments[i]].style.visibility = "visible"
		}
	}
}

//hide a div
function hideDiv(id) {
	if (ns4){
		for(i = 0; i < hide.arguments.length; i++){
			document.layers[hide.arguments[i]].visibility = "hide"
			}
		}
	else if (ie4){
		for(i = 0; i < hide.arguments.length; i++){
			document.all[hide.arguments[i]].style.visibility = "hidden"
		}
	}
}

//Function that loops through all like-named divs in a document and hides
//them. Then, the function will show the one specified.
//This is great for using "arrays" of divs on a page.
//For instance, if you have several divs named xLayer1, xLayer2, etc
//and you want to show xLayer7, you'd call the function like so:
//showDivEx('Layer', 'xLayer7');
function showDivEx(divSearchString, divName) {
  if (isNav4 || isIE4) {
    if (ns4){
      for(i = 0; i < document.layers.length; i++){
        var x
        x = document.layers[i].id
        //if the string is found....
        if (x.indexOf(divSearchString) != -1){
          //set visibility to hidden
          document.layers[i].visibility = "hide"
    	  }		
      }
      //then - set this div to visible
      document.layers[divName].visibility = "show"
      } else 
       if (ie4) {
        for(i = 0; i < document.all.length; i++){
          var x
          x = document.all[i].id
          if (x.indexOf(divSearchString) != -1){
            document.all[i].style.visibility = "hidden"
    	    }		
        }
        document.all[divName].style.visibility = "visible"
      }
  } else alert('You do not have a browser capable of this action');

}//end function


//loops through all images containing 'string' and turns them
// all off - THEN - turns on the one passed in the function (imgName)
function turnImageOn(string,imgName) {
	for(i = 0; i < document.images.length; i++){
	x = document.images[i].name
		//if the string is found....
		if (x.indexOf(string) != -1){
		//replace image with the "off" version
		document.images[i].src = "images/" + x + "-off.gif"
		}		
	}
	//the - set this image to the "on" state
	document.images[imgName].src = "images/" + imgName + "-over.gif"
}
