//////////////////////////////////////////////////////////////////////////////////////////////////////////
// INFOSOFT SA DE CV
// Fecha: 01-28-2005
// Updates:04-14-2005,2007-01-15
// Author:Rodolfo Machon
// Nombre del archivo: menu.js
// Description:Save(),ConstructTable()
//////////////////////////////////////////////////////////////////////////////////////////////////////////
var OpenWindow = new Array(100);
var OpenWindowCount = 0;
function MenuOpenOption(component,clase,left,top,id_field,height,width,resizable,toolbar,location,status,scrollbars,menubar,parametros){
	var id		= "";
	var lan		= this.document.data.lan.value;
	var appid	= this.document.data.appid.value;
	if(id_field!=""){id = eval("this.document.data."+id_field+".value");}
	if (!parametros) {parametros=""}	
	if (!OpenWindow[OpenWindowCount] || OpenWindow[OpenWindowCount].closed){
		win ="window.open('../bin/"+component+".pl?lan="+lan+"&appid="+appid+"&clase="+clase+"&id="+id+parametros+"','"+component+clase+"','left="+left+",top="+top+",height="+height+",width="+width+",resizable="+resizable+",toolbar="+toolbar+",location="+location+",status="+status+",scrollbars="+scrollbars+",menubar="+menubar+"')";
		OpenWindow[OpenWindowCount]=eval(win);
		OpenWindowCount++;
	}
	else{OpenWindow[OpenWindowCount].focus()}
}
function MenuOpenURL(theURL,winName,features) {
	winName+=OpenWindowCount;
	if (!OpenWindow[OpenWindowCount] || OpenWindow[OpenWindowCount].closed){
		win ="window.open(theURL,winName,features)";
		OpenWindow[OpenWindowCount]=eval(win);
		OpenWindowCount++;
	}
	else{OpenWindow[OpenWindowCount].focus()}
}
function Show(option) {
	for (var i=0; i<arraylayers.length; i++){
		document.getElementById(arraylayers[i]).style.visibility='hidden';
	}
	document.getElementById(option).style.visibility='visible';
}
function Limpiar() {
	//alert();
	for (var i=0; i<arraylayers.length; i++){
		document.getElementById(arraylayers[i]).style.visibility='hidden';
	}
}
function ShowLayer(option) {
	var mask= "0";
	var msk	= "";
	for (var i=0; i<arraylayers.length; i++){
		document.getElementById(arraylayers[i]).style.visibility='hidden';
	}
	for (i=option.length;i>2;i--){
		var pos	  = option.substr(0,i-1);
		msk	  += mask;
		var layer = pos+msk;
		document.getElementById(layer).style.visibility='visible';
	}	
	document.getElementById(option).style.visibility='visible';
}
function HideLayer(option) {
	document.getElementById(option).style.visibility='hidden';
}
function HideOption(option) {
	for (var i=0; i<arraylayers.length; i++){
		document.getElementById(arraylayers[i]).style.visibility='hidden';
	}	
}
