function openPopUp(C,A){var B=window.open(A,C,"width="+(window.screen.width-200)+",height="+(window.screen.height-200)+",Resizable=yes,Scrollbars=yes,statusbar=no,MenuBar=no")}function printItem(D,A){var C=document.getElementById(D);var B=window.open("","winPrinItem","Width=500,Height=620,Resizable=yes,Scrollbars=yes,statusbar=no,MenuBar=no");B.document.open();B.document.write("<html><head><link href='"+A+"' rel='stylesheet' type='text/css'></head><body onLoad='window.print()' style='background:white'>");B.document.write(C.innerHTML);B.document.write("</body></html>");B.document.close()}function printItemFABM(E,A,B){var D=document.getElementById(E,A);var C=window.open("","winPrinItem","Width=500,Height=620,Resizable=yes,Scrollbars=yes,statusbar=no,MenuBar=no");C.document.open();C.document.write("<html><head><link href='../css/admin.css' rel='stylesheet' type='text/css'><style>.mnu_ac{display:none} .sit-b2{display:none} .no-imp{display:none}</style></head><body onLoad='window.print()' style='background:white'>");C.document.write("<p><h3>"+A+"</h3> ("+B+")</p>");C.document.write(D.innerHTML);C.document.write("</body></html>");C.document.close()}function openPrint(B,A){A.action=B;A.target="_blank";A.submit()}function openWinParent(A){if(window.opener&&!window.opener.closed){var B=confirm("Desea cerrar esta ventana?");if(B){window.opener.location=A;window.opener.focus();window.close()}else{window.opener.location=A;window.opener.focus()}}else{alert("La ventana principal se encuentra cerrada")}}function validator_required(D,C,A){var B=document.getElementById("label_"+D.id);if(D!=null){if(D.type.substring(0,6)=="select"){if(D.options[D.selectedIndex].text=="Seleccione ..."){alert("El campo "+C+" es obligatorio");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}else{if(D.type.substring(0,8)=="checkbox"){if(!D.checked){alert("El campo "+C+" es obligatorio");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}else{var E=D.value;if(E==""||E=="0"||E==" "){alert("El campo "+C+" es obligatorio");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}}}}function validator_url(C,B,A){}function validator_email(D,C,A){var B=document.getElementById("label_"+D.id);if(D.value.length>0){if(D.value.indexOf("@")<2||D.value.length<5||D.value.indexOf(".")<2||D.value.indexOf(",")>0||D.value.indexOf(" ")>0){alert("El campo "+C+" no contiene un email valido");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}}function validator_numeric(D,C,A){var B=document.getElementById("label_"+D.id);if(D.value.length>0){cv="0123456789";for(i=0;i<D.value.length;i++){if(cv.indexOf(D.value.charAt(i))<0){alert("El campo "+C+" no contiene un numero valido.");if(B){B.className="lbl_req";D.focus()}return false}}if(B){B.className=""}}}function validator_time(D,C,A){var B=document.getElementById("label_"+D.id);if(D.value.length>0){if(D.value.length!=8||isNaN(D.value.substr(0,2))||isNaN(D.value.substr(3,2))||isNaN(D.value.substr(6,2))){alert("El campo "+C+" no contiene una hora valida.\nDebe ingresarla con el formato HH:MM:SS.\nEjemplo: 18:30:00");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}}function validator_date(D,C,A){var B=document.getElementById("label_"+D.id);if(D.value.length>0){if(D.value.length!=10||D.value.substr(0,4)=="0000"||isNaN(D.value.substr(0,4))||D.value.substr(5,2)=="00"||isNaN(D.value.substr(5,2))||D.value.substr(7,2)=="00"||isNaN(D.value.substr(7,2))){alert("El campo "+C+" no contiene una fecha valida.\nDebe ingresarla con el formato aaaa-mm-dd.\nEjemplo: 2006-05-31");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}}function validator_float(D,C,A){var B=document.getElementById("label_"+D.id);if(D.value.length>0){cv="0123456789.";for(i=0;i<D.value.length;i++){if(cv.indexOf(D.value.charAt(i))<0){alert("El campo "+C+" no contiene un numero valido.\nPara separar decimales utilice el punto.\nEjemplo: 1233.55");if(B){B.className="lbl_req"}D.focus();return false}}if(B){B.className=""}}}function validator_txt_length_max(D,C,A){var B=document.getElementById("label_"+D.id);if(D.value.length>parseInt(A)){alert(" El valor ingresado en el campo "+C+" supera la longitud maxima de "+A+" caracteres");if(B){B.className="lbl_req"}D.focus();return false}else{if(B){B.className=""}}}function onchangeSelect(B,A,D){var C=A.options[A.selectedIndex].value;document.location.href=B+"&"+D+"="+C}function refSeleccionadas(form,origen,destino){var c=0;var origen=eval("document.forms['"+form+"']."+origen);var texto="";for(i=0;i<origen.options.length;i++){if(origen.options[i].selected){texto+=origen.options[i].value;texto+=","}}texto=texto.substring(0,texto.length-1);var destino=eval("document.forms['"+form+"']."+destino);if(destino.value.length>0){destino.value=destino.value[destino.value.length-1]==","?destino.value+texto:destino.value+","+texto}else{destino.value=texto}}function imprimirListado(A,I){var B=document.getElementById(A);var G=document.getElementById("titsec");var C=document.getElementById("registros");var H=window.open("","il","");H.document.open();H.document.write("<html><head><title>"+G.innerHTML+'</title><style>@media print{BODY{font-family:Arial;font-size:6pt}TABLE{font-family:Arial;font-size:6pt}}BODY{font-family:Arial;font-size:9px}TABLE{font-family:Arial;font-size:9px}</style></head><body onLoad="window.print()">');H.document.write('<center><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td rowspan=2><img src="../img/SC.jpg" style="padding:5px"></td><td style="vertical-align:middle"><h4>'+G.innerHTML+'</h4></td></tr><tr><td style="vertical-align:middle"><p>'+C.innerHTML+'</p></td></tr></table><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">');if(I=="L"){var F=new Array();for(var E=0;E<B.rows.length;E++){tr=B.rows[E];if(E==0){for(var D=1;D<tr.cells.length;D++){F[D]=tr.cells[D].innerHTML}}else{H.document.write('<tr><td width="100%"><table width="100%">');for(var D=1;D<tr.cells.length;D++){if(tr.cells[D].innerHTML==""){tr.cells[D].innerHTML="&nbsp;"}H.document.write('<tr><td width="30%" style="text-align:right;padding-right:10px"><b>'+F[D]+"</b></td><td>"+tr.cells[D].innerHTML+"</td></tr>")}H.document.write("</table></td></tr>")}}}else{for(var E=0;E<B.rows.length;E++){tr=B.rows[E];if(E==0){H.document.write("<tr>");for(var D=1;D<tr.cells.length;D++){H.document.write("<th>"+tr.cells[D].innerHTML+"</th>")}H.document.write("</tr>")}else{H.document.write("<tr>");for(var D=1;D<tr.cells.length;D++){if(tr.cells[D].innerHTML==""){tr.cells[D].innerHTML="&nbsp;"}H.document.write("<td>"+tr.cells[D].innerHTML+"</td>")}H.document.write("</tr>")}}}H.document.write("</table></center></body></html>");H.document.close()}function expPdf(D){var E=document.getElementById("lform");var C=document.createElement("input");C.setAttribute("type","hidden");C.setAttribute("name","op");C.setAttribute("id","op");C.setAttribute("value","exp");var B=document.createElement("input");B.setAttribute("type","hidden");B.setAttribute("name","f");B.setAttribute("id","f");B.setAttribute("value","pdf");var A=document.createElement("input");A.setAttribute("type","hidden");A.setAttribute("name","opet");A.setAttribute("id","opet");A.setAttribute("value",D);E.appendChild(C);E.appendChild(B);E.appendChild(A);E.target="_blank";E.submit();E.removeChild(C);E.removeChild(B)}function onchangeRefresh(B,A,D){var C=A.value;document.location.href=B+"&"+D+"="+C}function getPosicion(C){var B=0;var A=0;while(C.offsetParent){B+=C.offsetLeft;A+=C.offsetTop;C=C.offsetParent}B+=C.offsetLeft;A+=C.offsetTop;return{x:B,y:A}}function openPopUpWinContenido(F,E,B){var C=400;var A=400;switch(B){case 1:C=250;A=250;break}var D=window.open("",F,"width="+C+",height="+A+",Resizable=yes,Scrollbars=yes,statusbar=no,MenuBar=no");D.document.open();D.document.write(E);D.document.close()};