// JavaScript Document
function showMenu(d){
	var id = d.id.substring(5);

	divs = document.getElementsByTagName('DIV');
	
	for(i=0;divs.length>i;i++){						
		
		if (divs[i].id.indexOf('menu') == 0){
			var menuID = divs[i].id.substring(4);
			
			if (menuID != id)
			{
				ts1 = document.getElementById('td'+menuID);
				ts1.style.backgroundImage = 'url(/img/menu_bg_n.gif)';
			}
		}
		
		if( divs[i].id.indexOf('menu') == 0 && divs[i].id!='menu'+id){
			divs[i].style.display='none';			
		}
	}
	
	st = document.getElementById('menu'+id).style;
	st.display = (st.display!='block')?'block':'none'; 
	
	ts = document.getElementById('td'+id);

  	switch (ts.style.backgroundImage) {
	  	case 'url(/img/menu_bg_n.gif)':
	  		ts.style.backgroundImage = 'url(/img/menu_bg_o.gif)';	  		
	  		break;
	  	case 'url(/img/menu_bg_o.gif)':
	  		ts.style.backgroundImage = 'url(/img/menu_bg_n.gif)';	  		
	  		break;
  	}
}

function initMenu(id){
	divs = document.getElementsByTagName('DIV');
	
	for(i=0;divs.length>i;i++){
		if(divs[i].id.indexOf('menu')==0&&divs[i].id!='menu'+id)
			divs[i].style.display='none';
	  }

	st = document.getElementById('menu'+id);

	if (st) {
		st=st.style;
		st.display = (st.display!='block')?'block':'none';
	} 
}

function PopUp(url, w, h) {
    var u, t, l = (screen.availWidth-w)/2;
    t = (screen.availHeight-h)/2;
    u = new Date().getTime();
    vindue=window.open(url,"popup"+u,"width="+w+",height="+h+",left="+l+",top="+t+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
    vindue.focus();
}
