document.oncontextmenu = function(){return false}
function SmallWindow(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=800,height=380,left=100"); SmallWin.window.focus() 
} 

function SmallWindow2(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=780,height=380,left=100"); SmallWin.window.focus() 
} 
function SmallWindow3(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=800,height=420,left=100"); SmallWin.window.focus() 
} 
function SmallWindowctc(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=800,height=550,left=100"); SmallWin.window.focus() 
} 

function SmallWindow4(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=800,height=500,left=100"); SmallWin.window.focus() 
} 


function SmallWindow34(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=666,height=400,left=100"); SmallWin.window.focus() 
} 
function SmallWindow_print(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=730,height=380,left=100"); SmallWin.window.focus() 
} 
function SmallWindow_popup(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=400,height=180,left=300,top=200"); SmallWin.window.focus() 
} 
function SmallWindow_digitacion(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=630,height=480,left=100"); SmallWin.window.focus() 
} 
function SmallWindow_conformidad(wintype) { 
SmallWin=window.open(wintype,"SmallWin","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=500,height=250,left=300,top=200"); SmallWin.window.focus() 
} 
function SmallWindow_cargo(wintype) { 
SmallWinCargo=window.open(wintype,"SmallWinCargo","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width=800,height=420,left=140, top=100"); SmallWinCargo.window.focus() 
} 
// ************ VALIDANDO NÚMEROS *************************
function verfos()
{
	
	ordens=document.getElementById("numorden");
	tipo=document.getElementById("rp");
	
	if (tipo.selectedIndex==-1){ 
	alert("Debe seleccionar un Tipo de Servicio")
	tipo.focus()
	return 0;
	}
	
	

	if (ordens.value.length==0){
		ordens.value="";
		ordens.select()
		ordens.focus()
	alert ("Ingrese Orden de Servicio \n  POR FAVOR")
	return 0;
	}

	document.forms["frm"].submit();	
	return 1;


}


function validarEntero(valor){ 
      //intento convertir a entero. 
      //si era un entero no le afecta, si no lo era lo intenta convertir 
       valor = parseInt(valor) 

      //Compruebo si es un valor numérico 
      if (isNaN(valor)) { 
         //entonces (no es numero) devuelvo el valor cadena vacia 
		 
         return "" 
      }else{ 
         //En caso contrario (Si era un número) devuelvo el valor 
         return valor 
      } 
} 


// ************** VALIDANDO ORDEN *****************
function compruebaValidoR(valor){ 
   CPValido=true 
   //si no tiene 5 caracteres no es válido 
   if (valor.value.length != 6) 
   CPValido=false
   else{ 
	for (i=0;i<6;i++)
	  { 
         CActual = valor.value.charAt(i) 
		 if (validarEntero(CActual)=="" && validarEntero(CActual)!=0 ){
			CPValido=false 
		   break; 
         } 
      }
   } 
   if (!CPValido){ 
         //si no es valido, Lo aviso 
         alert ("Debe ser Orden válido") 
		 //selecciono el texto 
		 
         valor.select() 
		 valor.value=""
		 valor.focus()	
   }
} 


var nav4 = window.Event ? true : false; 
function Press(evt){ 
// Nota: Enter = 13
var key = nav4 ? evt.which : evt.keyCode; 
	if (key > 31 && (key < 48 || key > 57)){
		return false;
		alert("Valor no válido")
		
	}
	if (key==13)
	{
	compruebaValidoR(evt.value)
	}
}

function acceptNumNumero(evento){
var key = (window.Event)? evento.which : evento.keyCode;
if((key>=48 && key<=57) || 
(key==8) || (key==13) || (key==45))
return true;
else
return false;
}


function acceptNumNumeroOrden(evento){
var key = (window.Event)? evento.which : evento.keyCode;
if((key>=48 && key<=57) || 
(key==8) || (key==13))
return true;
else
return false;
}
function esInteger(e) {
	var charCode;
	if (navigator.appName == "Netscape"){ // me fijo
		charCode = e.which; // leo la tecla en ASCII que ingreso
	}else{
		charCode = e.keyCode; // leo la tecla en ASCII que ingreso
	}
	if (charCode > 31 && (charCode < 48 || charCode > 57)){
		return false;
		
	}
}

function Verificar()
{
	  var ctrl=window.event.ctrlKey;
	  var tecla=window.event.keyCode;
	  if (ctrl && tecla==67) {event.keyCode=0; event.returnValue=false;}
	  if (ctrl && tecla==86) {event.keyCode=0; event.returnValue=false;}
}

