//**********************************************************************
// Parámetros de configuración
//**********************************************************************
if (typeof(sClassMenuList)=='undefined') var sClassMenuList="MenuLink";
if (typeof(sBgClassMenuList)=='undefined') var sBgClassMenuList="MenuBgColor";
if (typeof(sBorderClass)=='undefined') var sBorderClass="fondoNegro";
if (typeof(sImgPath)=='undefined') var sImgPath="/images/";
if (typeof(sSpacerImg)=='undefined') var sSpacerImg="spacer.gif";
//***********************************************************************
var menu_layer
var nIdSetTimeOut
var obj_menu_list=null;
function menu_list(pnX,pnY,pnWithMenuList,pnTimeout){
	this.nX=pnX;
	this.nY=pnY;
	this.nTimeout=pnTimeout;
	this.nWidth=pnWithMenuList;
	this.arrElements=new Array();
	this.oLayer=null;
	this.sBgColorClass=sBgClassMenuList;
	this.sTextClass=sClassMenuList;
	this.sBorderClass=sBorderClass;
	this.add_link=add_link;
	this.show_menu_list=show_menu_list;
	this.hide_menu_list=hide_menu_list;
	this.hide_menu_list_timeout=hide_menu_list_timeout;
	this.init=init_menu_list;
	this.generate_menu_list_HTML=generate_menu_list_HTML;
	this.scroll=scroll_menu;
	this.visible=false;
	this.out_menu_list=out_menu_list;
	this.over_menu_list=over_menu_list;
	this.do_on_scroll=do_on_scroll;
}
function scroll_menu(pnPosY){
	var nPosX=(document.layers)?this.oLayer.left:this.oLayer.style.left;
	moveLayerTo(this.oLayer,nPosX,pnPosY);
}
function menu_element(psDisplayName,psURL){
	this.displayName=psDisplayName || "&nbsp;";
	this.URL=psURL || "javascript:;";
}
function add_link(psDescription,psURL){
	this.arrElements[this.arrElements.length]=new menu_element(psDescription,psURL);
}
function show_menu_list(x,y){
	window.clearTimeout(nIdSetTimeOut);
	if (!this.oLayer) return;
	//if (this.visible) return;
	moveLayerTo(this.oLayer,x,y);
	showLayer(this.oLayer);
	this.visible=true;
}
function hide_menu_list(){
	window.clearTimeout(nIdSetTimeOut);
	if (!this.oLayer) return;
	//if (!this.visible) return;
	hideLayer(this.oLayer);
	this.visible=false;
}
function hide_menu_list_timeout(){
	window.clearTimeout(nIdSetTimeOut);
	if (!this.oLayer) return;
	//if (!this.visible) return;
	nIdSetTimeOut=window.setTimeout("hideLayer(menu_layer);",this.nTimeout);
}
function over_menu_list(){
	var nYscroll=0;
	nYscroll=(document.all)?document.body.scrollTop:window.pageYOffset;
	if (obj_menu_list.arrElements.length>0) {
		obj_menu_list.show_menu_list(obj_menu_list.nX,nYscroll);
	}
}
function out_menu_list(){
		obj_menu_list.hide_menu_list_timeout();
}
function do_on_scroll(){
	if (this.visible)
		this.scroll((document.all)?document.body.scrollTop:window.pageYOffset);
}
function init_menu_list(psLayerName){
	var objLayer =findObj(psLayerName);
	if (!objLayer) return;
	this.oLayer=objLayer;
	this.oLayer.onmouseover=over_menu_list;
	this.oLayer.onmouseout=out_menu_list;
	menu_layer=this.oLayer;
}
function generate_menu_list_HTML(){
	var nAditionalRows=2;
	var sHTML="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\""+(this.nWidth)+"\">";
	for (var i=0;i<this.arrElements.length;i++){
		sHTML+="<tr><td class=\""+this.sBorderClass+"\"><img src=\""+sImgPath+sSpacerImg+"\" width=\"1\" height=\"20\"></td><td class=\""+this.sBgColorClass+"\" width=\""+(this.nWidth-2)+"\"><a class=\""+this.sTextClass+"\" href=\""+this.arrElements[i].URL+"\" onmouseover=\"obj_menu_list.over_menu_list();changeClass(this,\'"+this.sBorderClass+"\');\" onmouseout=\"obj_menu_list.out_menu_list();changeClass(this,\'"+this.sBgColorClass+"\');\" target=\"_top\">"+this.arrElements[i].displayName+"</a></td><td class=\""+this.sBorderClass+"\"><img src=\""+sImgPath+sSpacerImg+"\" width=\"1\" height=\"1\"></td></tr>"
	}
	sHTML+="<tr><td class=\""+this.sBorderClass+"\" height=\"1\" colspan=\"3\"><img src=\""+sImgPath+sSpacerImg+"\" width=\"1\" height=\"1\"></td></tr>";
	sHTML+="</table>";
	writeLayer(this.oLayer, sHTML);
}
function changeClass(pobjNode,psClass){
	if (document.getElementById)
		pobjNode.parentNode.className=psClass;
	else if (document.all)
		pobjNode.parentElement.className=psClass;
}