/*function addnew(opc)
{
	switch(opc)
	{
	case 1: {if (document.frmNuevo.txtnom.value == "") {	alert("Debe Introducir el nombre de la Oficina."); return 0;	} break;}
	case 2: {if (document.frmNuevo.txtnom.value == "" || document.frmNuevo.txtnomc.value == "" || document.frmNuevo.txtpas.value == "") {	alert("Debe Introducir el nombre Completo, nombre de usuario y contraseña."); return 0; }break;}
	case 3: {if (document.frmNuevo.txtnom.value == "") {	alert("Debe Introducir el nombre del cliente."); return 0;	} break;}
	case 4: {if (document.frmNuevo.txtdir.value == "") {	alert("Debe Introducir direccion del inmueble."); return 0;	} break;}
	case 7: {if (document.frmNuevo.txtnom.value == "") {	alert("Debe Introducir el nombre de la Provincia."); return 0;	} break;}
	case 8: {if (document.frmNuevo.txtnom.value == "") {	alert("Debe Introducir el nombre Completo, nombre de usuario y contraseña."); return 0; }break;}
	case 9: {if (document.frmNuevo.txtnom.value == "") {	alert("Debe Introducir el nombre de la Zona."); return 0;	} break;}
	}
	document.frmNuevo.submit();	
    
}
function upd(opc)
{
switch(opc)
	{
	case 1: {if (document.frmupd.txtnom.value == "") {	alert("Debe Introducir el nombre de la Oficina."); return 0;	}break;}
	
	case 2: {if (document.frmupd.txtnom.value) {	alert("Debe Introducir el nombre Completo,nombre de usuario y contraseña."); return 0; }break;}
	case 3: {if (document.frmupd.txtnom.value == "") {	alert("Debe Introducir el nombre del cliente."); return 0;	}break;}
	case 4: {if (document.frmupd.txtdiru.value == "") {	alert("Debe Introducir la dirección del inmueble"); return 0;	}break;}
	case 7: {if (document.frmupd.txtnom.value == "") {	alert("Debe Introducir el nombre de la Provincia"); return 0;	}break;}
	case 8: {if (document.frmupd.txtnom.value == "") {	alert("Debe Introducir el nombre de la Poblacion"); return 0; }break;}
	case 9: {if (document.frmupd.txtnom.value == "") {	alert("Debe Introducir el nombre de la Zona"); return 0; }break;}
	}

	//document.frmupd.accion.value = 2;
	document.frmupd.submit();  
}*/
function borralo(url,inc)
{
 
if (window.confirm("Esta seguro de Eliminar el Registro?"))
	{
	 window.open(url + "&cod=" + inc,"_parent");
	}
}
function resalta(caja)
{

caja.value =  caja.value  + "<strong>" ;

}
function finresalta(caja)
{

caja.value =  caja.value  + "</strong>" ;

}
function IsNumeric(valor) 
{ 
var log=valor.length; var sw="S"; 
for (x=0; x<log; x++) 
{ v1=valor.substr(x,1); 
v2 = parseInt(v1); 
//Compruebo si es un valor numérico 
if (isNaN(v2)) { sw= "N";} 
} 
if (sw=="S") {return true;} else {return false; } 
} 

function aumenta(boton)
{
	
	if (IsNumeric(boton.value))
	{
	 boton.value ++;
	}
	else { boton.value = 0; }
}
function disminuye(boton)
{
	
	if (IsNumeric(boton.value))
	{
	 if (boton.value>0)
	     boton.value --;
	 else
		 boton.value =0;
	
	}
	else 
		{ 
		boton.value = 0; 
		}
}
function meteper(codigo)
{
	window.open("index.php?idx=2&frm=1&cod=" + codigo + "&pera=1&per=" + document.frmupd.cmbperu.value,"_parent");
}

function delper(codigo,permiso)
{
	window.open("index.php?idx=2&frm=1&cod=" + codigo + "&pera=2&per=" + permiso,"_parent");
}
