window.addEvent('domready', function() {
	if(hideList=="ja" && $chk($('list')))
		$('list').remove();                 
	
	$$('.readmore a').each(function(link){
		link.innerHTML = read_more;
	});

	$('right-column').getElements('div.element').each(function(element){
		element.addEvent('mouseenter', function(){
			this.addClass('hover');
			this.setStyle('cursor','pointer');
		});
		element.addEvent('mouseleave', function(){
			this.removeClass('hover');
			this.setStyle('cursor','normal');
		});
	
		element.addEvent('click',function(){    
			location.href = $(this).getProperty('url');
		});
	});

   if($chk($('li'+level2ID)))
		  $('li'+level2ID).addClass('selected');
   if($chk($('li'+level3ID)))
		  $('li'+level3ID).addClass('selected');
   if($chk($('li'+level4ID)))
		  $('li'+level4ID).addClass('selected');
   if($chk($('li'+level5ID)))
		  $('li'+level5ID).addClass('selected');   
		  
	
	//CONTACT
	if($chk($('#region-select')) && $$('#region-select .toggler').length>0){
		var selected_index = 0;
		/* GET START INDEX */
		$$('#region-select .toggler').each(function(element,index){
			if(element.getProperty('id')==level4ID){
				selected_index = index;
			}
		});
	}
	
	
	if($chk($("products-drop-down"))){
    	$("menu").getElements("li").each(function(element){
        	if($(element).getProperty("dropdown") == "products-drop-down"){                      
				$(element).addClass("products-drop-down-holder");
				$(element).getElement("a").setProperty("href","javascript:void(0)");
				$(element).adopt($("products-drop-down"));

	           	//$("products-drop-down").setStyle("width",$(element).getSize().size.x+"px");

				$(element).addEvent("mouseover", function(){
					$(element).addClass("active");
					$("products-drop-down").setStyle("display","block");								  
				});

				$(element).addEvent("mouseout", function(){
					$(element).removeClass("active");
					$("products-drop-down").setStyle("display","none");								  
				});

/*				$(element).addEvent("mouseenter", function(event){
					showProducts();
				});
	
				$(element).addEvent("mouseleave", function(event){
					setTimeout(hideProducts,1000);
				});       
				
				$("products-drop-down").addEvent("mouseover", function(event){
					showProducts();													   
				});
				
				$("products-drop-down").addEvent("mouseleave", function(event){
					setTimeout(hideProducts,1000);												   
				});*/
        	}
    	});
	}	
});

//CONTACT
function InsertLocationInformation(menutitle,description){
    if(menutitle.trim().length>0){
        document.write('<h3>'+menutitle+'</h3>');
    }
    if(description.trim().length>0){
        document.write('<p>'+description+'</p>');
    }    
}

function showProducts() {
    $("products-drop-down").setStyle("display","block");                                        
    $("products-drop-down").getParent().addClass("active");
}

function hideProducts(){
    $("products-drop-down").setStyle("display","none");
    $("products-drop-down").getParent().removeClass("active");
}