function menu_clear() {

var divs = document.getElementById('menu_divs');

var i = 0;


for (var i=0; i<divs.childNodes.length;i++) {
	if (divs.childNodes[i].id) { 
	divs.childNodes[i].style.left = "-500px";
	divs.childNodes[i].style.top = "-500px";
	}

}

}


function menu_show(menu_name, m_x, m_y, wte) {


if (document.getElementById(menu_name).style.left != "-500px")
{
	menu_clear();

} else {
	menu_clear();
if (navigator.appName == "Microsoft Internet Explorer") {
	m_x =  wte.offsetLeft + document.getElementById("menu").offsetLeft - m_x;

	}
else 	 {
	m_x =  wte.offsetLeft + document.getElementById("menu").offsetLeft ;

}

//alert(m_y);
	document.getElementById(menu_name).style.left = m_x +  "px";
	document.getElementById(menu_name).style.top = m_y + "px";

}
	
}


function menu_br_show(menu_p) {
menu_p.style.borderTop="3px solid #203E86";
}

function menu_br_clear(menu_p) {
menu_p.style.borderTop="0px solid";
}

function close_pix() {
var div_out = document.getElementById('message_div');
div_out.innerHTML = '';
div_out.style.width = '10px';
div_out.style.height =  '10px';
div_out.style.top = '-1000px';
div_out.style.left = '-1000px';
}

function open_pix(pix_path, w_w, w_h) {
var div_out = document.getElementById('message_div');
var x_w = document.documentElement.scrollTop + (document.documentElement.clientHeight/2) - (w_h/2);
var y_w = document.documentElement.scrollLeft + (document.documentElement.clientWidth/2) - (w_w/2);

div_out.innerHTML = '<IMG src="'+pix_path+'" style="border:1px solid #888888; cursor:pointer;" onClick="close_pix();" />';


div_out.style.width = 'auto';
div_out.style.height =  'auto';

div_out.style.top = x_w+'px';
div_out.style.left = y_w+'px';

}



function absPosition(obj) {
      var x = y = 0;
      while(obj) {
            x += obj.offsetLeft;
            y += obj.offsetTop;
            obj = obj.offsetParent;
      }
      return {x:x, y:y};
}

