//---- abrirventana(url,ancho,alto)----------------------------------- // ---- ImprimirPagina() --------------------------------------------- //Imprime la parte central del cuerpo de la pagina // ---- VentanaCompleta() -------------------------------------------- //Expande la ventana para mostrarla en pantalla completa //-- interlineado(tablaInicial, estilo1, estilo2, numFilaAplicar)----- //-- trim(inputString) ----------------------------------------------- // -- show(div) // -- hide(div) // -- checkEmail(str) // -- CambiarClase(Node,Nivel) // -- CambiarFondoOff(Node,Nivel) // -- CambiarFondoOn(Node,Nivel) // -- AcoplarVentana() // -- EsEntero() // -- checkEmail() //-------------------------------------------------------------------- //-------------------------------------------------------------------- function abrirventana(url,ancho,alto,valorOpciones){ if (ancho=='')var ancho=550; if (alto=='') var alto=550; var left=(screen.width - ancho)/2; var top=(screen.height - alto)/2; switch ( valorOpciones ) { case 1: opciones='width='+ancho+',height='+alto+',left='+left+',top='+top+',location=yes,toolbar=yes,status=yes,menubar=yes,directories=yes,resizable=yes,scrollbars=yes,copyhistory=yes'; break; case 2: opciones='width='+ancho+',height='+alto+',left='+left+',top='+top+',location=no,toolbar=no,status=no,menubar=no,directories=no,resizable=yes,scrollbars=no,copyhistory=no'; break; default: opciones='width='+ancho+',height='+alto+',left='+left+',top='+top+',location=no,toolbar=no,status=no,menubar=no,directories=no,resizable=yes,scrollbars=yes,copyhistory=no'; break; } window.open(url,'',opciones); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- function ImprimirPagina() { //Imprime la parte central del cuerpo de la pagina abrirventana("/funciones/javascript/imprimirpagina.php",500,500); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- function VentanaCompleta() { window.moveTo(0,0); if (document.all) { top.window.resizeTo(screen.availWidth,screen.availHeight); } else if (document.layers||document.getElementById) { if (top.window.outerHeight0) Altura=Altura+40; if (Ancho>0) Ancho=Ancho+10; window.resizeTo(Ancho,Altura); var Left=(screen.width - Ancho)/2; var Top=(screen.height - Altura)/2; window.moveTo(Left,Top); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- //-----Rutinas de menu------------------------------------------------ function showObj(_o) { var _s=""; for(var i in _o) { _s+=i+"="+_o[i]+"
"; } var _x=window.open(); _x.document.open(); _x.document.write(_s); _x.document.close(); } /* Tree View Grid Properties & Functions */ var plusImage = "/javascript/example/ex_1015/plus1.gif"; var minusImage = "/javascript/example/ex_1015/minus1.gif"; var imageTagPrefix = "img"; var nodeSeparator = "."; var nodeHighlightColor = "lightblue"; var nodeMouseOverColor = "wheat"; var n = 1; /* Function to Collapse a Node Function will be called Recursively till the Last Child of the Node */ //------------------------------------------------------------------------ //------------------------------------------------------------------------ function Collapse(Node) { objNode = document.getElementById(Node); //objNode.style.backgroundColor=nodeHighlightColor; /* Get n'th child of Node */ objChildNode = document.getElementById(Node + nodeSeparator + n); /* Get image object of Node */ objImg = document.getElementById(imageTagPrefix + nodeSeparator + Node); /* Check if Child exists. If does not exist then Reset n = 1 & exit function & */ if(objChildNode != null) { /* Toggle the Child Status i.e. if visible then make it invisible & vis-versa */ if (objChildNode.style.display == "") { /* Close all the Childs, Sub-Childs and so on of the Node*/ if (objImg != null)objImg.src = plusImage; closeAllChilds(Node) return; }else{ objChildNode.style.display = ""; if (objImg != null)objImg.src = minusImage; } /* Call Collapse for the Next Child be increamenting n*/ n = n + 1; Collapse(Node); }else n = 1; } //------------------------------------------------------------------------ //------------------------------------------------------------------------ function ExplicitCollapse(Node,p_direction) { objNode = document.getElementById(Node); //objNode.style.backgroundColor=""; objChildNode = document.getElementById(Node + nodeSeparator + n); objImg = document.getElementById(imageTagPrefix + nodeSeparator + Node); if(objChildNode != null) { if (p_direction == "0") { objChildNode.style.display = "none"; if (objImg != null)objImg.src = plusImage; if(!closeAllChilds(objChildNode.id)) return false; }else { objChildNode.style.display = ""; if (objImg != null)objImg.src = minusImage; } n = n + 1; ExplicitCollapse(Node,p_direction); }else n = 1; } /* Function to close all the childs of a Node As Each Child Node ID contains its Parent Node ID, Close all the rows having the Node ID as a prefix in their IDs. */ //------------------------------------------------------------------------ //------------------------------------------------------------------------ function closeAllChilds(nNode) { var tempNode,objTempNode,objNode,tempImg,objBody; objNode= document.getElementById(nNode); //objNode.style.backgroundColor=""; /* Get the Parent Element of Node ie. the Table Object */ objTable = objNode.parentElement?objNode.parentElement:objNode.parentNode; var browserName=navigator.appName; if (browserName=="Microsoft Internet Explorer") { tagNm = objTable.tagName; }else { tagNm = "TBODY"; } /* Get the Parent Element is not a Table then exit function */ if(tagNm.toUpperCase() == "TBODY") { /* For each TR of the Table*/ for(i=0;i= 0) { objTempNode = document.getElementById(tempNode); tempImg = document.getElementById(imageTagPrefix+ nodeSeparator + tempNode); if (tempImg != null) tempImg.src = plusImage; objTempNode.style.display = "none"; //objTempNode.style.backgroundColor=""; } } } }else { //alert("Table Tag not found"); return false; } return true; } /* Function to keep a Node open onLoad This function also opens up the corresponding Parent Nodes of that perticular Node */ //------------------------------------------------------------------------ //------------------------------------------------------------------------ function OpenNode(strNode,p_direction) { var objNode; var arrNode = strNode.split(nodeSeparator); var str = ""; for(i=0;i=0 && currentCaracter <=9 ) && currentCaracter !='-') return false; } else { if ( !(currentCaracter>=0 && currentCaracter<=9) ) return false; } } return true; } //------------------------------------------------------------------------ //------------------------------------------------------------------------ function checkEmail(str) { var at="@"; var dot="."; var lat=str.indexOf(at) ; var lstr=str.length ; var ldot=str.indexOf(dot); if (str.indexOf(at)==-1){ return false; } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false; } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false; } if (str.indexOf(at,(lat+1))!=-1){ return false; } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false; } if (str.indexOf(dot,(lat+2))==-1){ return false; } if (str.indexOf(" ")!=-1){ return false; } return true ; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- //--------------------------------------------------------------------- function vaciar(campo) { campo.value=''; }