function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}
var http = createRequestObject();

function show() {
	window.print();
	//window.location = pag;
	window.history.back();
}

function Imprimir() {
	setTimeout("show()",100);
}

function cambiaRegimen(reg, val) {
	alert("Cambiando de Regimen...");
	var misma_pagina = String(self.location);
	var pagina = misma_pagina.split("?");
	window.location = pagina[0] + '?IDreg=' + reg;
}

function muestra_opc(i) {
	//alert("hola");
	eval("document.getElementById('opciones_" + i + "').style.display = 'block'");	
}

function oculta_opc(i) {
	//alert("hola");
	eval("document.getElementById('opciones_" + i + "').style.display = 'none'");	
}

function Imprimir() {
	setTimeout("show()",100);
}

function regresar() {
	window.history.back();
}

function cerrarPopup() {
	window.close();	
}

function validaBusq() {
	if(document.frmPersonal.paterno.value == "" && document.frmPersonal.codigo.value == "" && document.frmPersonal.nro.value == "" && document.frmPersonal.nroref.value == "") {
		alert("Debe ingresar una referencia de búsqueda");
		document.frmPersonal.paterno.focus();
		return false;
	}
	return true;
}

function validaasignacion() {
	if(document.frmasignacion.usuario_asign.value == "" ) {
		alert("Debe Elejir a quien se asignaran los documentos");
		document.frmasignacion.usuario_asign.focus();
		return false;
	}
	return true;
}

