String.prototype.trim = function() { var x = this; x = x.replace(/^\s*(.*)/, "$1"); x = x.replace(/(.*?)\s*$/, "$1"); return x; } function mayus(e) { e.value = e.value.toUpperCase(); } //MEtodo que solo permite texto de a..z A..Z 0..9 y los simbolos \u00F1 \u00E1‘ ' - . / y espacio(32) function validaCaracteres(e){ var allowedCode = [241,209,39,45,46,47,32]; var charCode = (e.charCode) ? e.charCode : ((e.keyCode) ? e.keyCode : ((e.which) ? e.which : 0)); if (charCode > 31 && (charCode <= 64 || charCode > 90) && (charCode < 97 || charCode > 122) && (charCode < 48 || charCode > 57) && (allowedCode.indexOf(charCode) == -1)) { e.preventDefault(); return false; } } function doAction( dispatch ){ document.forms[0].dispatch.value = dispatch; //document.forms[0].submit(); } function doActionImg( dispatch ){ document.forms[0].dispatch.value = dispatch; document.forms[0].submit(); } //function soloNumeros(myfield, e){ // return restrict(myfield, e); //} //function soloNumerosPunto(myfield, e){ // return restrict(myfield, e, "0123456789."); //} //function soloNumerosGuiones(myfield, e){ // return restrict(myfield, e, "0123456789-"); //} // //function soloLetrasNumeros(myfield, e){ // return restrict(myfield, e, " 0123456789ABCDEFGHIJKLMNĂ‘OPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz"); //} // //function paraContrasena(myfield, e){ // if( !restrict(myfield, e, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") ){ // mensaje('Ha intentado ingresar caractĂ©res no validos para la contraseña'); // return false; // } // return true; //} // //function mensaje(msg){ // //document.getElementById('screenMessage').innerText = msg; // alert(msg); //} // //function emailValidation(str) { // var at="@" // var dot="." // var lat=str.indexOf(at) // var lstr=str.length // var ldot=str.indexOf(dot) // if (str.indexOf(at)==-1){ // //alert("Invalid E-mail ID") // return false // } // // if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ // //alert("Invalid E-mail ID") // return false // } // // if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ // //alert("Invalid E-mail ID") // return false // } // // if (str.indexOf(at,(lat+1))!=-1){ // //alert("Invalid E-mail ID") // return false // } // // if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ // //alert("Invalid E-mail ID") // return false // } // // if (str.indexOf(dot,(lat+2))==-1){ // //alert("Invalid E-mail ID") // return false // } // // if (str.indexOf(" ")!=-1){ // //alert("Invalid E-mail ID") // return false // } // // if (str.indexOf("..")!=-1){ // //alert("Invalid E-mail ID") // return false // } // // if( str.substring( strl.length - 1 ) == "." ){ // return false; // } // // return true //} // ///** // * @access private // */ //function restrict(myfield, e, redefinidos){ // // if( redefinidos ){ // permitidos = redefinidos; // }else{ // permitidos = "0123456789"; // } // // var key; // var keychar; // // if (window.event) // key = window.event.keyCode; // else if (e) // key = e.which; // else // return true; // // keychar = String.fromCharCode(key); // // // control keys // if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)){ // return true; // // // allowed chars // }else if (permitidos.indexOf(keychar) > -1){ // return true; // }else{ // return false; // } //} // //function abrePopup(url, w, h, wname){ // // var popW = ( w ? w : 800 ); // var popH = ( h ? h : 400 ); // var winleft = (screen.width - popW) / 2; // var winUp = (screen.height - popH) / 2; // var wn = ( wname ? wname : 'pop'); // //var winUp = 2; // winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no'; // // popup = window.open(url, wn, winProp); // //popup = window.open(url, 'pop', ''); // popup.focus(); //} //-------------------------------------------------------------------------------------- //Disable right click /* function clickIE4(){ if (event.button == 2){ return false; } } function clickNS4(e){ if (document.layers || document.getElementById && !document.all){ if (e.which == 2 || e.which == 3){ return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clickNS4; }else if (document.all && !document.getElementById){ document.onmousedown = clickIE4; } document.oncontextmenu = new Function("return false") */ //--------------------------------------------------------------------------------------