// JavaScript Document
/*
Con un clic en la fila se carge en la pagina de edit, o consulta.
Con el efecto que al pasar el mouse se ponga de otro color el fondo de la Fila
*/
var curSelection=null;
function setMyStyle(src, toClass) {
 if (null != src)
 src.className = toClass;
}


function abrirPop(page, Popwidth, Popheight, Popscroll, Popresize ) {
	OpenWin = this.open(page, "CtrlWindow", "width="+Popwidth+",height="+Popheight+",top=0,left=0,toolbar=no,location=no,menubar=no,scrollbars="+Popscroll+",resizable="+Popresize);
	OpenWin.focus();

}

function chequea(campo,boton, i){
	var val=i.value;
	
	if (campo.checked){
		i.value=val + 1;
		if(i.value!=0) boton.disabled=false;
	} else {
		i.value=val - 1;
		if(i.value==0) boton.disabled=true;
	}
	alert(i.value);
}

function borrarConfirm(formObj) { 
	reg=parseInt(document.formaBorrar.registros.value);
	if(reg!=0) 	{
		if(!confirm("Esta seguro de borrar este registro?")) { 
			return false;
		} 
		else {
	   		document.formaBorrar.submit();
   		}
	}
	
}

/* Mostrar u Ocultar un Div*/

function toggleLayer(whichLayer, h)
{
if (document.getElementById){
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	//style2.display = style2.display? "":"block";
	if (h=='no') style2.display = "none";
	else style2.display = "block";
		
}
else if (document.all){
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	if (h=='no') style2.display = "none";
	else style2.display = "block";
}
else if (document.layers){
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	if (h=='no') style2.display = "none";
	else style2.display = "block";
	}
}
