// EAN				---- 		this script has been developed specially for IE verdions (employer demand)


function lamp_menuControl(){
	var menu = document.getElementById("lamp_menu_frame");
	var menu_length = menu.childNodes.length;
	//the page's logo
	var logoImage = document.getElementById("img_logo");
	
	
	//default settings
	var visible_group_ID = ( document.getElementById("default_visible_group") ).getAttribute("value");
	var visible_group = document.getElementById(visible_group_ID);
	var focus_button_ID = "L_"+ visible_group_ID.substring(6);
	var focus_button = document.getElementById( focus_button_ID );

	focus_button.style.backgroundColor = "orange";
	
	
	
	for(var i = 0 ; i < menu_length ; i++){
		if(menu.childNodes[i].getAttribute("id").indexOf("L_") >= 0){
		
			menu.childNodes[i].onmouseover = function(){
				this.style.cursor = "pointer";
				this.style.backgroundColor = "orange";
			}
		
			menu.childNodes[i].onmouseout = function(){
				
				if( this!= focus_button){
					this.style.cursor = "default";
					this.style.backgroundColor = "Transparent";
				}
			}
		
			menu.childNodes[i].onclick = function(){
				//make the related group visible
				var group_target_ID = "group_"+ this.getAttribute("id").substring(2);
				var group_target = document.getElementById(group_target_ID);
				
				//make the related button highligthed
				this.style.backgroundColor = "orange";
				focus_button.style.backgroundColor = "Transparent";
				focus_button = this;
				
				//change logo if necessary
				if( this.getAttribute("id").indexOf("cosmetico") >= 0 )
					logoImage.src = "IMAGES/img_lamps/cosmedico/cosmedico_LOGO.gif";
				else
					logoImage.src = "IMAGES/img_lamps/philips/philips_LOGO.gif";
				
				if( group_target!= visible_group ){
					group_target.className = "visible";
					visible_group.className = "invisible";
					visible_group = group_target;
				}
			}			
			
			
		}//--- end if
	}//---end for
}
