_button_default=null;
_isMenuActive=false;
_active_button=null;
imageOK=true;

function Button_on(){
	if (!imageOK) return;
	if (_active_button!=null)
		_active_button.off();
	_isMenuActive=true;
	_active_button=this;
	document[this.name].src=this.onImage.src;
}

function _defButtonOn(){
	if (_button_default==null)
		return;
		
	_button_default.on();
}


function Button_off(){
	if (!imageOK) return;
	_isMenuActive=false;
	_active_button=null;
			
	document[this.name].src=this.offImage.src;
	timerID=setTimeout('if (!_isMenuActive) _defButtonOn()', 1);
}
	
function setDefaultButton(button){
	if (imageOK==false){
		return;
	}
	_button_default=button;
	_active_button=_button_default;
	_button_default.defImage.src=_button_default.onImage.src;
	_button_default.on();
}

function Button(onName, offName, name){
	this.on=Button_on;
	this.off=Button_off;
	if (!document.images){
		imageOK=false;
		return;
	}
	this.nameOn=onName;
	this.nameOff=offName;
	this.name=name;
	this.on=Button_on;
	this.off=Button_off;
	this.onImage=new Image();
	this.onImage.src=this.nameOn;
	this.offImage=new Image();
	this.offImage.src=this.nameOff;
	this.defImage=new Image();
	this.defImage.src=null;
	
}

Navigation_Home = new Button("/Images/Navigation/Home_Hover.gif", "/Images/Navigation/Home.gif", "Image_Navigation_Home");
Navigation_AboutUs = new Button("/Images/Navigation/AboutUs_Hover.gif", "/Images/Navigation/AboutUs.gif", "Image_Navigation_AboutUs");
Navigation_Services = new Button("/Images/Navigation/Services_Hover.gif", "/Images/Navigation/Services.gif", "Image_Navigation_Services");
Navigation_Testimonials = new Button("/Images/Navigation/Testimonials_Hover.gif", "/Images/Navigation/Testimonials.gif", "Image_Navigation_Testimonials");
Navigation_Gallery = new Button("/Images/Navigation/Gallery_Hover.gif", "/Images/Navigation/Gallery.gif", "Image_Navigation_Gallery");
Navigation_ContactUs = new Button("/Images/Navigation/ContactUs_Hover.gif", "/Images/Navigation/ContactUs.gif", "Image_Navigation_ContactUs");
Navigation_RelatedSites = new Button("/Images/Navigation/RelatedSites_Hover.gif", "/Images/Navigation/RelatedSites.gif", "Image_Navigation_RelatedSites");

