     var inc=1;
     var conttab=0;
     var ids=new Array();
     function creartabla(com,tab,fi,ff,p,c,to,d,cp,lm,pr,cn,idd,dpn,totnoche,totsem,totmes,totanos,exist){
	 var exist=exist;
	     reinicia();
		 if(exist===undefined){exist="";}
		 for(i=0;i<ids.length;i++){
	     if(ids[i]==undefined){}
		 else{
		  calculatotal(ids[i]);
		     }
	    }	
		  //com=$complejo
	      //tab=$clave 
	      //fi=$fini 
	      //ff=$ffin 
	      //p=$propiedad 
	      //c=$clave 
	      //to=$totapagar 
	      //d=$deposito 
	      //cp=$capacidad 
	      //lm=$limite 
	      //pr=tarifa (ta,tm,tb,tmb)
	      //cn=contador
	      //idd=$iddp
	      //dpn=$desc
	     idn=inc;
		 ids[idn-1]=idn;
		 chk=document.getElementById("chk"+pr+tab);
		 if(chk){chk.value=idn-1;}
	     var marco=document.getElementById("tablas");
		 var table=objeto("table",pr+tab+exist,"850","","datos",'');
		 table.setAttribute("name",idn-1);
		 var tr,td;
		 //primer tr
		 tr=objeto("tr","","","","trst");
		
		td=objeto("td","","","","","left");
		 td.setAttribute('colspan',5);
		 td.innerHTML="<font style='margin-left:180px;'><b>DEPARTAMENTO "+tab+"</b></font>";
		 var anos=document.getElementById("noanios").value;
		 var meses=document.getElementById("nomeses").value;
		 var semanas=document.getElementById("nosem").value;
		 var dias=document.getElementById("nodias").value;
		 ipt=inputs("hidden","comples"+idn,"comples[]",com,3);td.appendChild(ipt);
		 ipt=inputs("hidden","depars"+idn,"depars[]",tab,3);td.appendChild(ipt);
		 
		 
		 ipt=inputs("hidden","nov"+idn,"nov[]",1,3);td.appendChild(ipt);
		 ipt=inputs("hidden","idd"+idn,"idd[]",idd,3);td.appendChild(ipt);
		 ipt=inputs("hidden","desc"+idn,"desc[]",dpn,3);td.appendChild(ipt);
		 ipt=inputs("hidden","comp"+idn,"comp[]",com,3);td.appendChild(ipt);
		 ipt=inputs("hidden","inc"+idn,"inc[]",idn,3);td.appendChild(ipt);
		 ipt=inputs("hidden","tarifa"+idn,"tarifa[]",pr,3);td.appendChild(ipt);
		 ipt=inputs("hidden","noanios"+idn,"noanios[]",anos,3);td.appendChild(ipt);
		 ipt=inputs("hidden","nomeses"+idn,"nomeses[]",meses,3);td.appendChild(ipt);
		 ipt=inputs("hidden","nosem"+idn,"nosem[]",semanas,3);td.appendChild(ipt);
		 ipt=inputs("hidden","nodias"+idn,"nodias[]",dias,3);td.appendChild(ipt);
		 ipt=inputs("hidden","totnoche"+idn,"totnoche[]",totnoche,3);td.appendChild(ipt);
		 ipt=inputs("hidden","totsem"+idn,"totsem[]",totsem,3);td.appendChild(ipt);
		 ipt=inputs("hidden","totmes"+idn,"totmes[]",totmes,3);td.appendChild(ipt);
		 ipt=inputs("hidden","totanos"+idn,"totanos[]",totanos,3);td.appendChild(ipt);
	 	 /* a=document.createElement("a");
	 	 
		 a.href="javascript:remover('"+pr+tab+"','"+conttab+"');";
		 a.innerHTML="cerrar";
		 td.appendChild(a);*/
		 tr.appendChild(td);
		 td=objeto("td","","","","","right");
		 td.setAttribute('colspan',5); 
		 td.innerHTML=" <input type='button' value='Solicitar Descuento' name='soldesc"+idn+"' id='soldesc"+idn+"' onclick='soldesc("+idn+")' ><b>Vista previa (correo) <input type='checkbox' name='mailsi"+idn+"' id='mailsi"+idn+"' checked='checked'></b>";
		 tr.appendChild(td);
		 table.appendChild(tr);
		 //termina primer tr

		//segundo tr
		 tr=objeto("tr","","","","trssb");
		 td=objeto("td","","","","","center"); td.innerHTML="Estacionamiento"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Cama extra"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Cuna"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Mascota"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="No. personas"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Descuento"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Divisa"; tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA SEGUNDO TR
		  //SEGUNDO TR
		 tr=objeto("tr","","","","trss1");
		 td=objeto("td","","","","","center");
		     ipt=inputs("checkbox","estmnto"+idn,"estmnto[]","n",3);
			 ipt.setAttribute("onclick","javascript:if(!this.checked){calculatotal("+idn+");this.value='n'}else{calculatotal("+idn+");this.value='s'}");			 
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","camaex"+idn,"camaex[]","0",3);
			 ipt.setAttribute("onkeypress","javascript:if (event.keyCode < 45 || event.keyCode > 57){ event.returnValue=false;};");
			 ipt.setAttribute("onkeyup","javascript:calculatotal("+idn+");");
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("checkbox","cuna"+idn,"cuna[]","n",3);
			 ipt.setAttribute("onclick","javascript:if(!this.checked){calculatotal("+idn+");this.value='n'}else{calculatotal("+idn+");this.value='s'}");
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("checkbox","mascota"+idn,"mascota[]","n",3);
			ipt.setAttribute("onclick","javascript:if(!this.checked){calculatotal("+idn+");this.value='n'}else{calculatotal("+idn+");this.value='s'}");
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","npers"+idn,"npers[]","",3);
			 ipt.setAttribute("onkeypress","javascript:if (event.keyCode < 45 || event.keyCode > 57){ event.returnValue=false;};");
			 ipt.setAttribute("onkeyup","javascript:calculatotal("+idn+");");
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
			 ipt=inputs("hidden","motivodesc"+idn,"motivodesc[]","",3);
			 td.appendChild(ipt);
			 ipt=inputs("hidden","autorizadesc"+idn,"autorizadesc[]","",3);
			 td.appendChild(ipt);
		     ipt=inputs("hidden","descsol"+idn,"descsol[]","",3);
			 td.appendChild(ipt);
			 ipt=inputs("hidden","solicitud"+idn,"solicitud[]","0",3);
			 td.appendChild(ipt);
		     ipt=inputs("text","descuento"+idn,"descuento[]","",3);
			 ipt.setAttribute("onkeypress","javascript:if (event.keyCode < 45 || event.keyCode > 57){ event.returnValue=false;};");
			 ipt.setAttribute("onkeyup","javascript:if(this.value>100){this.value=100};if(this.value<0){this.value=0};if(this.value>=0 && this.value<=100 ){calculatotal(idn);};");
			 ipt.setAttribute("readonly",true);
		 td.appendChild(ipt);
		    textNode = document.createTextNode("%");
		  td.appendChild(textNode); 

                	
 tr.appendChild(td);
		 divisa=document.getElementById("dolar").value;
		 td=objeto("td","","","","","center");td.innerHTML="$ ";ipt=inputs("text","dolar"+idn,"divisa[]",divisa,3,"ipt");ipt.setAttribute("readonly",true);
			 ipt.setAttribute("style","border:none;text-align:right");td.appendChild(ipt);tr.appendChild(td);
		 
		 table.appendChild(tr);
		 //TERMINA SEGUNDO TR
		 //PERSONAS EXTRA TR
		 tr=objeto("tr","huespedes"+idn,"","","trss11");
		 td=objeto("td","","","","","center"); td.setAttribute('colspan',5);
		     tabpex=objeto("table","tab"+idn,"","","","center");
		         tabpex.setAttribute("class","datos");
				     trpex=objeto("tr","","","","");
					     tdpex=objeto("td","","129","","","center");
						     tdpex.innerHTML="Apellido Paterno";
		             trpex.appendChild(tdpex);
					     tdpex=objeto("td","","129","","","center");
						     tdpex.innerHTML="Apellido Materno";
		             trpex.appendChild(tdpex);
					     tdpex=objeto("td","","129","","","center");
						     tdpex.innerHTML="Nombre";
		             trpex.appendChild(tdpex);
					    tdpex=objeto("td","","20","","","center");
						     ele = document.createElement('a');
                                 img=objeto("img","",15,15);
                                 img.setAttribute("src","images/media.png");
	                         ele.appendChild(img);
	                         ele.setAttribute("href","javascript:crear('','"+idn+"')");
	                         ele.setAttribute("onmouseover","javascript:altbtn(event,'Agregar huesped');");
	                         ele.setAttribute("onmouseout","javascript:cierrate('altboton');");
		                 tdpex.appendChild(ele);
		             trpex.appendChild(tdpex);
		     tabpex.appendChild(trpex);
		 td.appendChild(tabpex);
		 tr.appendChild(td);
		 td=objeto("td","","","","","center");tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA PERSONAS EXTRA TR
		//TERCER TR
		 tr=objeto("tr","","","","trssb");
		 td=objeto("td","","","","","center"); td.setAttribute('colspan',3); td.innerHTML="Fecha"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Propiedad"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Clave"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Monto"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Deposito"; tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA TERCER TR
		 //CUARTO TR
		 tr=objeto("tr","","","","trss1");
		 td=objeto("td","","","","","center");
		  td.setAttribute('colspan',3); 
		     ipt=inputs("text","fini"+idn,"fini[]",fi,15,"ipt");
			 ipt.setAttribute("readonly",true);
			 ipt.setAttribute("style","border:none;text-align:right");
		 td.appendChild(ipt);
		     tx=objeto("font","","","","");
			 tx.innerHTML=" - ";
			 td.appendChild(tx);
		     ipt=inputs("text","ffin"+idn,"ffin[]",ff,15,"ipt");
			 ipt.setAttribute("readonly",true);
			  ipt.setAttribute("style","border:none;");
		 td.appendChild(ipt);
		 tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","deparprop"+idn,"deparprop[]",p,15,"ipt");
			 ipt.setAttribute("readonly",true);
			 ipt.setAttribute("style","border:none;text-align:center");
		 td.appendChild(ipt);
		 tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","clavedep"+idn,"clavedep[]",c,3,"ipt");
			 ipt.setAttribute("readonly",true);
			  ipt.setAttribute("style","border:none;text-align:center");
		td.appendChild(ipt);tr.appendChild(td);
		td=objeto("td","","","","","center");td.innerHTML="$ ";
		     tot=parseFloat(to);
		     t=tot.toFixed(2);
		     ipt=inputs("text","monto"+idn,"monto[]",t,3,"ipt");
			 ipt.setAttribute("readonly",true);
			 ipt.setAttribute("style","border:none;text-align:right");
		td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");td.innerHTML="$ ";ipt=inputs("text","deposito"+idn,"deposito[]",d,3,"ipt"); ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");td.appendChild(ipt);tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA CUARTO  TR
		 //QUINTO TR
		 tr=objeto("tr","","","","trssb");
		 td=objeto("td","","","","","center"); td.setAttribute('colspan',2); td.innerHTML="Persona extra"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Estacionamiento"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Cama extra"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Cuna"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Mascota"; tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Subtotal"; tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA QUINTO  TR
		   //SEXTO TR
		 tr=objeto("tr","","","","trss1");
		 td=objeto("td","","","","","center");
		  td.setAttribute('colspan',2); 
		     ipt=inputs("text","persext"+idn,"persext[]","0.00",3,"ipt");td.innerHTML="$ ";
		     ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");
		  td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","estmnto2"+idn,"estmnto2[]","0.00",3,"ipt");td.innerHTML="$ ";
			 ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","camaex2"+idn,"camaex2[]","0.00",3,"ipt");td.innerHTML="$ ";
			 ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");
		td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","cuna2"+idn,"cuna2[]","0.00",3,"ipt");td.innerHTML="$ ";
			 ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");
		 td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");
		     ipt=inputs("text","mascota2"+idn,"mascota2[]","0.00",3,"ipt");td.innerHTML="$ ";
			 ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");
		 td.appendChild(ipt);tr.appendChild(td); 
		 td=objeto("td","","","","","center");
			 sbt=parseFloat(to);
			 s=sbt.toFixed(2);
		     ipt=inputs("text","subtotal"+idn,"subtotal[]",s,3,"ipt");td.innerHTML="$ ";
			 ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");
		 td.appendChild(ipt);tr.appendChild(td);
		 
		 table.appendChild(tr);
		 //TERMINA SEXTO  TR
		
		 
	
		 //SEPTIMO TR
		 tr=objeto("tr","ivatx"+idn,"","","trssb");tr.setAttribute("style","display:none;");
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="IVA";tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA SEPTIMO  TR
		 
		  //OCTAVO TR
		 tr=objeto("tr","ivav"+idn,"","","trss11");
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center");ipt=inputs("text","iva"+idn,"iva[]","0.00",3,"ipt");ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");td.innerHTML="$ ";td.appendChild(ipt);		 
		 tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA OCTAVO  TR*/
		 
		  //COMTXT TR
		 tr=objeto("tr","comistx"+idn,"","","trssb");tr.setAttribute("style","display:none;");
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Comisión";tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA COMTXT  TR
		 
		 	   //COMISION TR
		 tr=objeto("tr","comisv"+idn,"","","trss11");
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center");ipt=inputs("text","comision"+idn,"comision[]","0.00",3,"ipt");ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");td.innerHTML="$ ";td.appendChild(ipt);		 
		 tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA COMISION  TR*/
		 
		 
		  //NOVENO TR
		 tr=objeto("tr","","","","trssb");
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); td.innerHTML="Total"; tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA NOVENO  TR
		 
		  //DECIMO TR
		 tr=objeto("tr","","","","trss1");
		 td=objeto("td","","","","","center");td.innerHTML="Capacidad: " ;ipt=inputs("text","cap"+idn,"cap[]",cp,1,"ipt"); ipt.setAttribute("readonly",true);ipt.setAttribute("style","border:none;text-align:left");td.appendChild(ipt);tr.appendChild(td);
		 td=objeto("td","","","","","center");td.innerHTML="L&iacute;mite: "; ipt=inputs("text","lim"+idn,"lim[]",lm,1,"ipt"); ipt.setAttribute("readonly",true);ipt.setAttribute("style","border:none;text-align:left");td.appendChild(ipt); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 td=objeto("td","","","","","center"); tr.appendChild(td);
		 tot=parseFloat(to)+parseFloat(s);
		 tot=tot.toFixed(2);
		 td=objeto("td","","","","","center");ipt=inputs("text","total"+idn,"total[]",tot,3,"ipt");ipt.setAttribute("readonly",true); ipt.setAttribute("style","border:none;text-align:right");td.innerHTML="$ ";td.appendChild(ipt);
		 ipt=inputs("hidden","cont"+idn,"cont[]",1,3);td.appendChild(ipt);
		 ipt=inputs("hidden","ant"+idn,"ant[]",0,3);td.appendChild(ipt);
		 ipt=inputs("hidden","ant2"+idn,"ant2[]",d,3);td.appendChild(ipt);
		 ipt=inputs("hidden","x"+idn,"x[]",1,3);td.appendChild(ipt);
		 
		 tr.appendChild(td);
		 table.appendChild(tr);
		 //TERMINA DECIMO  TR*/
		 marco.appendChild(table);
		 sumatodos(inc);
		 inc++;
		 conttab++;
		document.getElementById("tipocomp").disabled=false;
		val=document.getElementById("tipocomp").value;
		 //val2=document.getElementById("tipopago").value;
		fpago(val);
		 //document.getElementById("tipopago").value=val2;
	 }
	 
	 function remover(tab,v){
	     restaval(ids[v]);		
	     var marco=document.getElementById("tablas");
         marco.removeChild(document.getElementById(tab));
	     //ids.splice(v,1);	
	     ids[v]=undefined;
		 conttab=conttab-1;
		if(conttab<=0){
		    //document.getElementById("tipocomp").value="";
		    //document.getElementById("tipocomp").disabled=true;
			 //fpago("");
		 }
	 }
	 function objeto(t,i,a,h,c,al){
	     //   t = tipo de elemento
	     //   i = id de elemento
	     //   a = ancho de elemento
	     //   h = altura de elemento
	     //   c = clase de elemento
	     //   al = align de elemento
	     //   n = nombre de elemento
	     e=document.createElement(t);
		 e.id=i;
		 e.setAttribute('width',a);
		 e.setAttribute('height',h);
		 e.setAttribute('class',c);
		 e.setAttribute('align',al);
		 return e;
	 }
	 function inputs(t,i,n,v,s,c){
	     //   t = tipo de input
	     //   i = id de input
	     //   n = nombre de input
	     //   v = valor de input
	     //   s = size de input
	     e=document.createElement("input");
		 e.type=t;
		 e.id=i;
		 e.name=n;
		 e.value=v;
		 e.size=s;
		 e.setAttribute("class",c);
		 return e;
	 }
	 
	 function cargavalores(id,es,ca,cu,ma,np,de,dol,mot,aut,desc){

	     var estmnto=document.getElementById("estmnto"+id);
	     var camaex=document.getElementById("camaex"+id);
	     var cuna=document.getElementById("cuna"+id);
	     var mascota=document.getElementById("mascota"+id);
	     var npers=document.getElementById("npers"+id);
	     var descuento=document.getElementById("descuento"+id);
	     var dolar=document.getElementById("dolar"+id);
	    
		 
		 estmnto.checked=es;
		 camaex.value=ca;
		 cuna.checked=cu;
		 mascota.checked=ma;
		 npers.value=np;
		 descuento.value=de;
		 dolar.value=dol;
		
	  var motivo=document.getElementById("motivodesc"+id);
	  var autoriza=document.getElementById("autorizadesc"+id);
	  var descsol=document.getElementById("descsol"+id);
	  descsol.value=desc;
	  autoriza.value=aut;
	  motivo.value=mot;
	 }
	  
	 function soldesc(idn)
	 {

	do
	 { xq=parseInt(prompt("introduce el % de descuento (valores admitidos de 0 a 100)"));}
	  while(isNaN(xq)||xq>100)
	 if(xq){		
			yq=prompt("Introduce el motivo por el cual solicitas el descuento");
				 if(yq){
						document.getElementById("descsol"+idn).value=xq;
						document.getElementById("motivodesc"+idn).value=yq;
						document.getElementById("autorizadesc"+idn).value=0;
						document.getElementById("solicitud"+idn).value=1;
						alert("El descuento a sido solicitado cuando sea aprovado por direccion reciviras una notificacion");
						}
		}
	 }
	
	
	  