function objetoAjax(){
 var xmlhttp=false;
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
 if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
 }
 return xmlhttp;
}


function lecturaejereporte(){
   
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
//var perd= document.getElementById("perd").value;
//var idtp= document.getElementById("progtp").value;

 divResultado = document.getElementById('validaeje');
 divResultado.innerHTML= '<img src="anim.gif">';
 ajax=objetoAjax();
 var cadena = "lecturareporte.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes;
 //alert(cadena);
 ajax.open("GET", cadena);
 ajax.onreadystatechange=function() {
  if (ajax.readyState==4 && ajax.status==200) {
   divResultado.innerHTML = ajax.responseText
  }
 }
 ajax.send(null)
 }
 
 function lecturaejereporteterm(){
   
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
//var perd= document.getElementById("perd").value;
//var idtp= document.getElementById("progtp").value;
var aleatorio=Math.random();
 divResultado = document.getElementById('validaeje');
 divResultado.innerHTML= '<img src="anim.gif">';
 ajax=objetoAjax();
 var cadena = "lecturareporte.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&aleatorio="+aleatorio;
 //alert(cadena);
 ajax.open("GET", cadena);
 ajax.onreadystatechange=function() {
  if (ajax.readyState==4 && ajax.status==200) {
   divResultado.innerHTML = ajax.responseText
  }
 }
 ajax.send(null)
 }
 
 function GenerarReporte(){
   //alert('uno');
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
//var ids= document.getElementById("ids").value;
//if(ids==0){
var ids= document.getElementById("serv1").value;
//}
var idtp= document.getElementById("progtp").value;
var contrato= document.getElementById("tpcont").value;

var opcperiodo = new Array();
var opchrseje = new Array();
		opcperiodo = document.getElementsByName("perd");
		opchrseje = document.getElementsByName("hrseje");
if(opcperiodo[0].checked==true && opchrseje[0].checked==true){
var cadena = "reportehorasext.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1";
}
if(opcperiodo[0].checked==true && opchrseje[1].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1&tipog=D";
}
if(opcperiodo[0].checked==true && opchrseje[2].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1&tipog=N";
}
if(opcperiodo[0].checked==true && opchrseje[3].checked==true){
var cadena = "reporteextrasnew.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1";
}
if(opcperiodo[1].checked==true && opchrseje[0].checked==true){
var cadena = "reportehorasext.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2";
}
if(opcperiodo[1].checked==true && opchrseje[1].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2&tipog=D";
}
if(opcperiodo[1].checked==true && opchrseje[2].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2&tipog=N";
}
if(opcperiodo[1].checked==true && opchrseje[3].checked==true){
var cadena = "reporteextrasnew.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2";
}
//alert(cadena);
window.open(cadena,"","height=500,width=1250,scrollbars=YES"); 
}


 function GenerarProduccion(){
 var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var idtp= document.getElementById("progtp").value;
var contrato= document.getElementById("tpcont").value;

var opcperiodo = new Array();
var opchrseje = new Array();
		opcperiodo = document.getElementsByName("perd");		
if(opcperiodo[0].checked==true){
var cadena = "reporteproduccionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1";
}
if(opcperiodo[1].checked==true ){
var cadena = "reporteproduccionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2";
}

//alert(cadena);
window.open(cadena,"","height=500,width=1250,scrollbars=YES"); 
}

  function verDetalleProd(cod){  
      
		var dni = document.getElementById("dni"+cod).value; 		
		var anno = document.getElementById("anno").value; 
		var mes = document.getElementById("mes").value;		
		var idj = document.getElementById("idj").value;	
		var ids= document.getElementById("ids").value; 
		var ale=Math.random();
		var cadena = "verproduccionper.php?dni=" + dni +"&idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&ale="+ale;
		//alert(cadena);
	    window.open(cadena,"","width=1000, height=770");
		 /*divResultado = document.getElementById('divproddet');
         divResultado.innerHTML= '<img src="anim.gif">';
		 ajax=objetoAjax();
		 ajax.open("GET", cadena);
         ajax.onreadystatechange=function() {
         if (ajax.readyState==4 && ajax.status==200) {
         divResultado.innerHTML = ajax.responseText
         }
	    }
      ajax.send(null)
	  */
    }


 function GenerarReporteterm(){
   
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;

var idtp= document.getElementById("progtp").value;
var contrato= document.getElementById("tpcont").value;

var opcperiodo = new Array();
var opchrseje = new Array();
		opcperiodo = document.getElementsByName("perd");
		opchrseje = document.getElementsByName("hrseje");
if(opcperiodo[0].checked==true && opchrseje[0].checked==true){
var cadena = "reportehorasext.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1";
}
if(opcperiodo[0].checked==true && opchrseje[1].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1&tipog=D";
}
if(opcperiodo[0].checked==true && opchrseje[2].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=1&tipog=N";
}
if(opcperiodo[1].checked==true && opchrseje[0].checked==true){
var cadena = "reportehorasext.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2";
}
if(opcperiodo[1].checked==true && opchrseje[1].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2&tipog=D";
}
if(opcperiodo[1].checked==true && opchrseje[2].checked==true){
var cadena = "reporteguardias.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&contrato="+contrato+"&periodo=2&tipog=N";
}
window.open(cadena,"","height=500,width=1250,scrollbars=YES"); 
}
function regresarMP(){
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var ugid= document.getElementById("ugid").value;
var tusu= document.getElementById("tusu").value;
//alert(tusu);
//var save= document.getElementById("save").value;
if(tusu==1){
document.location= "../personal/menuadminprog.php?idj="+idj+"&ids="+ids+"&ugid="+ugid+"&tusu="+tusu;
}else{
document.location= "../personal/menuadmin.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
}
}

function regresarMPterm(){
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var ugid= document.getElementById("ugid").value;
//alert(tusu);
//var save= document.getElementById("save").value;

document.location= "../personal/adminterminal.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;

}

function regresarMPP1(){
var idj= document.getElementById("idj").value;
var ugid= document.getElementById("ugid").value;
//alert(tusu);
//var save= document.getElementById("save").value;
document.location= "../personal/adminterminal.php?idj="+idj +"&ugid="+ugid;

}

function regresarAtras(){
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var ugid= document.getElementById("ugid").value;
//var save= document.getElementById("save").value;
var tusu= document.getElementById("tusu").value;
if(tusu==1){
document.location= "menureporte.php?idj="+idj+"&ids="+ids+"&ugid="+ugid+"&tusu="+tusu;
}else{
document.location= "menureporte.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
}
}

function buscarpersonal(){
var nombre = document.getElementById("nombre").value;
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var idtp= document.getElementById("progtp").value;
var ugid= document.getElementById("ugid").value;
var tc= document.getElementById("tpcont").value;
var rad = document.getElementsByName("bprog");
var tusu = document.getElementById("tusu").value;
var aleatorio=Math.random();
//alert(tusu);
if(rad[0].checked){
var tprog = 1;
}
if(rad[1].checked){
var tprog = 2;
}
if(rad[2].checked){
var tprog = 3;
}
divResultado = document.getElementById('buscalistado');
 divResultado.innerHTML= '<img src="anim.gif">';
 ajax=objetoAjax();
 if(tusu==1){
 var cadena = "buscarprogramacion.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tc="+tc+"&tprog="+tprog+"&nombre="+nombre+"&ugid="+ugid+"&tusu="+tusu+"&aleatorio="+aleatorio;
 }else{
 var cadena = "buscarprogramacion.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tc="+tc+"&tprog="+tprog+"&nombre="+nombre+"&ugid="+ugid+"&aleatorio="+aleatorio;
 }
 //alert(cadena);
 ajax.open("GET", cadena);
 ajax.onreadystatechange=function() {
  if (ajax.readyState==4 && ajax.status==200) {
   divResultado.innerHTML = ajax.responseText
  }
 }
 ajax.send(null)
}

function buscarpersonalenter(){
if(event.keyCode==13){
buscarpersonal();
}
}

function buscarpersonaladm(){
var nombre = document.getElementById("nombre").value;
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var idtp= document.getElementById("progtp").value;
var ugid= document.getElementById("ugid").value;
var tc= document.getElementById("tpcont").value;
var rad = document.getElementsByName("bprog");
var aleatorio=Math.random();
//alert(tusu);
if(rad[0].checked){
var tprog = 1;
}
if(rad[1].checked){
var tprog = 2;
}
if(rad[2].checked){
var tprog = 3;
}
divResultado = document.getElementById('buscalistado');
 divResultado.innerHTML= '<img src="anim.gif">';
 ajax=objetoAjax();

 var cadena = "buscarprogramacionadm.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tc="+tc+"&tprog="+tprog+"&nombre="+nombre+"&ugid="+ugid+"&aleatorio="+aleatorio;

 //alert(cadena);
 ajax.open("GET", cadena);
 ajax.onreadystatechange=function() {
  if (ajax.readyState==4 && ajax.status==200) {
   divResultado.innerHTML = ajax.responseText
  }
 }
 ajax.send(null)
}

function buscarpersonalenteradm(){
if(event.keyCode==13){
buscarpersonaladm();
}
} 

function listartipopersonal(){
	
   var idj = document.getElementById("idj").value;
   var ids = document.getElementById("serv1").value;
      
  
 divResultado = document.getElementById('divtp');
 divResultado.innerHTML= '<img src="anim.gif">';
 ajax=objetoAjax();
 ajax.open("GET", "combotipopersona.php?idj="+idj+"&ids="+ids);
 ajax.onreadystatechange=function() {
  if (ajax.readyState==4 && ajax.status==200) {
   divResultado.innerHTML = ajax.responseText
  }
 }
 ajax.send(null)
 listarpersonalterm1();
}

function informaprog(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("prog");
if(rad[0].checked){
var cadena = "programacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "programacionindividualmes.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[2].checked){
//var cadena = "listadoprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
falta();
}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function informaprogterm(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("prog");
if(rad[0].checked){
var cadena = "programacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "programacionindividualmes.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[2].checked){
//var cadena = "listadoprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
falta();
}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function informadesmedpdf(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var rad = document.getElementsByName("rddm");
if(rad[0].checked){
var cadena = "listardesmed.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0";
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "listardesmed.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&tipo=1&idtp=0";
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
}

function informadesmedxls(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var rad = document.getElementsByName("rddm");
if(rad[0].checked){
var cadena = "listardesmed.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0";
falta();
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "listardesmed.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&tipo=1";
falta();
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
}

function informavacapdf(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var rad = document.getElementsByName("tpconvaca");
var tipo = document.getElementsByName("rdvaca");

if(rad[0].checked){
	if(tipo[0].checked){
	var cadena = "listarvaca.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0&tpvaca=0";
	}
	if(tipo[1].checked){
	var cadena = "listarvaca.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0&tpvaca=1";
	}
	if(tipo[2].checked){
	var cadena = "listarvaca.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0&tpvaca=2";
	}
    window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
	if(tipo[0].checked){
	var cadena = "listarvaca.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0&tpvaca=0&tipo=1";
	}
	if(tipo[1].checked){
	var cadena = "listarvaca.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0&tpvaca=1&tipo=1";
	}
	if(tipo[2].checked){
	var cadena = "listarvaca.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp=0&tpvaca=2&tipo=1";
	}
	window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
}

function informavacaxls(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var rad = document.getElementsByName("tpconvaca");
var tipo = document.getElementsByName("rdvaca");
falta();
}
function reporteblanco(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("formato");
if(rad[0].checked){
var cadena = "programacionmensualblanco.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
falta();
}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function informacanthrsprog(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("hrsprog");
if(rad[0].checked){
var cadena = "sustentohrsprog.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tipo=1";
window.open(cadena,"","height=500,width=500,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "sustentohrsprog.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tipo=2";
window.open(cadena,"","height=500,width=500,scrollbars=YES");
}
if(rad[2].checked){
var cadena = "sustentohrsprog.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tipo=3";
window.open(cadena,"","height=500,width=500,scrollbars=YES");
}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function informacanthrsprogterm(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("hrsprog");
if(rad[0].checked){
var cadena = "sustentohrsprog.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tipo=1";
window.open(cadena,"","height=500,width=500,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "sustentohrsprog.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tipo=2";
window.open(cadena,"","height=500,width=500,scrollbars=YES");
}
if(rad[2].checked){
var cadena = "sustentohrsprog.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp+"&tipo=3";
window.open(cadena,"","height=500,width=500,scrollbars=YES");
}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function informareprog(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("reprog");
if(rad[0].checked){
var cadena = "reprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
var cadena = "reprogramacionindividualmes.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[2].checked){
//var cadena = "listadoprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
falta();
}
if(rad[3].checked){
//var cadena = "listadoprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
var cadena = "reportereprogramacion.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");

}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function informareprogterm(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("reprog");
if(rad[0].checked){
var cadena = "reprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
if(rad[1].checked){
//var cadena = "reprogramacionindividualmes.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
falta2();
}
if(rad[2].checked){
//var cadena = "listadoprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
falta();
}
if(rad[3].checked){
//var cadena = "listadoprogramacionmensual.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
var cadena = "reportereprogramacion.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes+"&idtp="+idtp;
window.open(cadena,"","height=500,width=1250,scrollbars=YES");

}
//window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}
function informaprogindiv(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("ids").value;
//var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("progd");
if(rad[0].checked){
var cadena = "programaciondeldiames.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes;
}
if(rad[1].checked){
var cadena = "reprogramaciondeldiames.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes;
}
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}


function informaprogindivterm(){
var mes = document.getElementById("mes").value;
var anno= document.getElementById("anno").value;
var idj= document.getElementById("idj").value;
var ids= document.getElementById("serv1").value;
//var idtp= document.getElementById("progtp").value;
var rad = document.getElementsByName("progd");
if(rad[0].checked){
var cadena = "programaciondeldiames.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes;
}
if(rad[1].checked){
var cadena = "reprogramaciondeldiames.php?idj="+idj+"&ids="+ids+"&anno="+anno+"&mes="+mes;
}
window.open(cadena,"","height=500,width=1250,scrollbars=YES");
}

function falta(){
alert("NO DISPONIBLE");
}

function falta2(){
alert("REPROGRAMACION AUN NO VALIDADO");
}

 
 function serialize(arr) 
{ 
var res = 'a:'+ arr.length +':{'; 
for(var i=0; i<arr.length; i++) 
{ 
if( arr[i]==0 ){
//res += 'i:'+i+';s:0:"'+arr[i]+'";'; 
res += 'i:'+i+';s:1:"'+arr[i]+'";'; 
}else if(arr[i]>0 && arr[i]<10){
//res += 'i:'+i+';s:1:"'+arr[i]+'";'; 
res += 'i:'+i+';s:1:"'+arr[i]+'";'; 
}else{
//res += 'i:'+i+';s:'+arr[i].length+':"'+arr[i]+'";'; 
res += 'i:'+i+';s:'+arr[i].length+':"'+arr[i]+'";'; 
}
//alert(arr[i]);
} 
res += '}'; 
//alert(res);
return res; 
} 