function OpenWin(url,name,attr) {
 var fw;
 if (attr) fw=window.open(url,name,attr);
 else if (name) fw=window.open(url,name);
 else if (url) fw=window.open(url);
 fw.focus();
// _LvWinFocus(fw);
}

function CloseWin(name) {
	window.close();
}

function fEnviar(pUrl) {
	document.forms[0].action=pUrl;
	document.forms[0].submit();
}


function fIrA(pUrl) {
	document.location.href=pUrl;
}

function fMostrarOcultarCapa(pId) {
	var obj=document.getElementById(pId);
	if (obj.style.display =='none') {
		obj.style.display ='block';
	} else {
		obj.style.display='none';
	}
}


//FUNCIONES PARA SELECCIONAR LOS ELEMENTOS EN LA TABLA
var ClsAnt="";
var CodAnt=String("");

function fSelec(pId) {
	fDeselec(CodAnt,ClsAnt);
	if (CodAnt==pId) {//ya esta seleccionado;
		ClsAnt="";
		CodAnt="";
	} else { //seleccionar
		document.getElementById("hi_cod").value=pId;
		var oLin=document.getElementById("ln"+pId);
		CodAnt=pId;
		ClsAnt=oLin.className;
		oLin.className="lnsel";
	}
}

function fDeselec(pId,pClase) {
	if (String(pId).length==0) return;
	document.getElementById("hi_cod").value="";
	document.getElementById("ln"+pId).className=pClase;
}

function fHaySeleccion() {
	if (String(document.getElementById("hi_cod").value).length > 0) return true;
	alert('Debe seleccionar una linea');
	return false;
}

function AbrirDemos(w,h){
	lURL = "http://217.127.119.202:31899";
	lAtr="width="+w+",height="+h+",scrollbars=yes";
	window.open(lURL,"DEMOS",lAtr);
}
