/* All scripts on this page Copyright 1998-2006 Brent Scott - ScottMedia. Please contact info@scott-media.com to use scripts. */

// Check for Netscape 4 or lower, and kindly inform the user that they are living in the dark ages.
	if(document.layers){
	  alert('You are using Netscape version 4. This Web site is not compatible with that browser. \n Please use a newer browser.');
    }
	else if((!document.layers)&&(!document.all)&&(!document.getElementById)){
		alert('You are using a very old, non-compatible browser. This Web site will not appear or function as intended');
	}
	
// preloads

function loadImages() {
  if(document.images){
    // over states
	image1 = new Image;
	image1.src = "images/home_ov.jpg";
	image2 = new Image;
	image2.src = "images/about_ov.jpg";
	image3 = new Image;
	image3.src = "images/forms_ov.jpg";
	image4 = new Image;
	image4.src = "images/links_ov.jpg";
	image5 = new Image;
	image5.src = "images/contact_ov.jpg";

	// active states
	image6 = new Image;
	image6.src = "images/home_a.jpg";
	image7 = new Image;
	image7.src = "images/about_a.jpg";
	image8 = new Image;
	image8.src = "images/forms_a.jpg";
	image9 = new Image;
	image9.src = "images/links_a.jpg";
	image10 = new Image;
	image10.src = "images/contact_a.jpg";
	
	
 // check for current page, and set active link.	
 where = document.location;
 temp = new String(where);
 if (temp.indexOf("index")!= -1){
  imageSwap('home',2)
  }
 if (temp.indexOf("about")!= -1){
  imageSwap('about',2)
  }
 if (temp.indexOf("forms")!= -1){
  imageSwap('forms',2)
  }
 if (temp.indexOf("links")!= -1){
  imageSwap('links',2)
  }
 if (temp.indexOf("contact")!= -1){
  imageSwap('contact',2)
  } 

}
}

function imageSwap(pic,inout) {
  if (document.images) {

		currentImage = document.images[pic].src;
        imgtemp = new String(currentImage); 
		 				       //  alert(imgtemp);
         if (imgtemp.indexOf("_a") == -1) {
	  		if (inout == 1) {
	    		document.images[pic].src = 'images/'+pic+'_ov.jpg';
	  		}
	  		else if (inout == 0) {
	    		document.images[pic].src = 'images/'+pic+'.jpg';
	 		}
	  		else if (inout == 2) {
	   			document.images[pic].src = 'images/'+pic+'_a.jpg';
	  		}
  	}
  }
}
