function url(img){
    var t = document.getElementsByTagName("script");
    var p = t[ t.length - 1 ].src;
    var pa = p.split( '/' );
    newP = "";
    for ( i = 0; i < pa.length-1; i++ ) {
    	newP += pa[i];
    	newP += "/";
    }
  return newP+img;
}

function preLoad() {
	if (document.images) {
		Home_on= new Image();
		Home_on.src=url('images/navHome_on.gif');
		Home_off= new Image();
		Home_off.src=url('images/navHome.gif');
		History_on= new Image();
		History_on.src=url('images/navHistory_on.gif');
		History_off= new Image();
		History_off.src=url('images/navHistory.gif');
		Facilities_on= new Image();
		Facilities_on.src=url('images/navFacilities_on.gif');
		Facilities_off= new Image();
		Facilities_off.src=url('images/navFacilities.gif');
		Location_on= new Image();
		Location_on.src=url('images/navLocation_on.gif');
		Location_off= new Image();
		Location_off.src=url('images/navLocation.gif');
		Photos_on= new Image();
		Photos_on.src=url('images/navPhotos_on.gif');
		Photos_off= new Image();
		Photos_off.src=url('images/navPhotos.gif');
		Rates_on= new Image();
		Rates_on.src=url('images/navRates_on.gif');
		Rates_off= new Image();
		Rates_off.src=url('images/navRates.gif');
		Contact_on= new Image();
		Contact_on.src=url('images/navContact_on.gif');
		Contact_off= new Image();
		Contact_off.src=url('images/navContact.gif');
	}
}

function TurnOn(imgName) {
	if (document.images) {
		imgOn=eval(imgName + "_on.src");
		document[imgName].src= imgOn;
	}
}

function TurnOff(imgName) {
	if (document.images) {
		imgOff=eval(imgName + "_off.src");
		document[imgName].src= imgOff;
	}
}

