version=navigator.appVersion; var b=navigator.appName; if (b=="Netscape") this.b="ns"; else if (b=="Microsoft Internet Explorer") this.b="ie"; v=parseInt(this.version); ns4=(this.b=="ns" && this.v==4); ns6=(this.b=="ns" && this.v==5); ie=(this.b=="ie" && this.v>=4); /************************************** FUNCIONES GENERALES ********************************************/ function AbrirVentana(lugar, nombre, propiedades) { var x=screen.width; var pop_x=560; var posx=Math.round((x-pop_x)/2); var sprops="top=50,left="+posx+","+propiedades; window.open(lugar, nombre, sprops); } /*********************************** FIN FUNCIONES GENERALES *******************************************/ /*************************************** VERIFICAR MAIL ************************************************/ function emailCheck (emailStr){ 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("La dirección de correo parece ser inválida (verifique las @ y .)") return false } var user=matchArray[1] var domain=matchArray[2] if (user.match(userPat)==null) { //alert("El nombre de usuario parece ser inválido.") return false } var IPArray=domain.match(ipDomainPat) if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { //alert("La dirección IP de destino es inválida!") return false } } return true } var domainArray=domain.match(domainPat) if (domainArray==null) { //alert("El dominio no parece ser válido.") return false } var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { //alert("Las direcciones deben terminar con dominios de tres letras, o el código de país de dos letras.") return false } if (len<2) { var errStr="Dominio Inválido!"; //alert(errStr) return false } return true; } /************************************ FIN VERIFICAR MAIL ***********************************************/ /************************************** ENLACES INTERES ************************************************/ function expand_collapse(id){ var hide = 'hide_'+id; var hideValue = document.getElementById(hide).value; if(hideValue==0){ document.getElementById(hide).value=1; collapse(id); }else{ document.getElementById(hide).value=0; expand(id) } } function expand(id){ collapseAll(); var catid = 'link_'+id; var image = 'image_'+id; document.getElementById(catid).style.display='block'; document.getElementById(image).src='/pfw_files/tpl/Structure/news2.jpg'; } function collapse(id){ var catid = 'link_'+id; var image = 'image_'+id; document.getElementById(catid).style.display='none'; document.getElementById(image).src='/pfw_files/tpl/Structure/news.jpg'; } function expandAll(){ form=document.linkform; elem=form.elements; var nom = ''; var link = ''; var image = ''; for(var i=0;i