
var activemenu;
var timer = new Object();
timer.submenu = null;

function showSub(id){
	
	if(activemenu){
		activeid = document.getElementById(activemenu);
		activeid.style.display = 'none';
	}
	
	if(id){
	
		activemenu = id;
		
		id = document.getElementById(id);
		
		if(id){
			
			var item = id.getElementsByTagName('div');
			for (var r=0; r<item.length; ++r) {

				if(item[r].getAttribute('url')){
	
					item[r].onmouseover = function(){
						this.style.backgroundColor = '#732A79';
						this.style.color = '#ffffff';
					};
					
					item[r].onmouseout = function(){
						this.style.backgroundColor = '#C3AECA';
						this.style.color = '#ffffff';
					};
					
					item[r].onclick = function(){
						window.location.href = this.getAttribute('url');
					};
				}
			}
								 			
			id.onmouseover = function(){
			clearTimeout(timer.submenu);
		};
		
		id.onmouseout = function(){
			timer.submenu = setTimeout("document.getElementById('"+ this.id +"').style.display='none'",500);
		};
		
		id.style.display = 'block';
		
		}else
			activemenu = 0;	

	}					 				
	
}
