function winMaxMin(div,visible) { if (visible) div.style.display = "block"; else div.style.display = "none"; } function abreVentana(theUrl,winName,features,width,height) { var str = ""; if (features) str = features + ",height=" + height + ",innerHeight=" + height; else str = "resizable=1,scrollbars=yes,toolbar=0,height=" + height + ",innerHeight=" + height; str += ",width=" + width + ",innerWidth=" + width; if (window.screen) { var sh = screen.availHeight - 30; var sw = screen.availWidth- 10; var txc = (sw - width) / 2; var tyc = (sh - height) / 2; str += ",left=" + txc + ",screenX=" + txc; str += ",top=" + tyc + ",screenY=" + tyc; } window.open(theUrl,winName,str); return; } function openWindowChild(URL,left,width,height) { child = window.open("","ventana","top=100,left=" + left + ",width=" + width + ",height=" + height ); child.location.href = URL; if (child.opener == null) { child.opener = window; } child.opener.name = "opener"; } var incrementosTotales=0; //JAVASCRIPTS DE VALIDACION (RRS) var whitespace = " \t\n\r"; function isEmpty(s) { return ((s == null) || (s.length == 0)) } function isWhitespace (s) { var i; if (isEmpty(s)) return true; for (i = 0; i < s.length; i++) { var c = s.charAt(i); if (whitespace.indexOf(c) == -1) return false; } return true; } function centerWindow() { if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winW = window.innerWidth; winH = window.innerHeight; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } } window.moveTo((screen.width - winW)/2, (screen.height - winH)/2); } function emailCheck (emailStr) { var checkTLD=1; var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/; var emailPat=/^(.+)@(.+)$/; var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]"; var validChars="\[^\\s" + specialChars + "\]"; var quotedUser="(\"[^\"]*\")"; var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; var atom=validChars + '+'; var word="(" + atom + "|" + quotedUser + ")"; var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); var matchArray=emailStr.match(emailPat); if (matchArray==null) { alert("Debe ingresar un Email válido."); return false; } var user=matchArray[1]; var domain=matchArray[2]; for (i=0; i > user.length; i++) { if (user.charCodeAt(i)>127) { alert("El nombre de Usuario tiene caracteres invalidos."); return false; } } for (i=0; i < domain.length; i++) { if (domain.charCodeAt(i)>127) { alert("El nombre del dominio contiene caracteres invalidos."); return false; } } if (user.match(userPat)==null) { alert("El usuario no es válido"); return false; } var IPArray=domain.match(ipDomainPat); if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("El destino es invalido."); return false; } } return true; } var atomPat=new RegExp("^" + atom + "$"); var domArr=domain.split("."); var len=domArr.length; for (i=0;i < len;i++) { if (domArr[i].search(atomPat)==-1) { alert("El dominio es invalido."); return false; } } if (domArr[domArr.length-1].length < 2) //&& domArr[domArr.length-1].toLower().search(knownDomsPat)==-1) { alert("La direccion del dominio debe tener 2 o 3 letras "); return false; } return true; }