// ********************* Funciones Para los menus que siempre te salgan en pantalla con el nombre tabla_desplazar function hide() { } var nombreCookieSelected = "lista_indice_sel"; var nombreCookieDeselected = "lista_indice_des"; function toggleNodo(item){ if (item.checked) addNodo(item.name); else delNodo(item.name); var nodo = getElement("seleccion_cuenta_registros"); if (nodo!=null) nodo.innerHTML=""+getCuentaSeleccionados(); } function eliminaDelimitadores(valor) { while (valor.length>0 && valor.substring(0,1)==",") { valor = valor.substring(1); } while (valor.length>0 && valor.substring(valor.length-1)==",") { valor = valor.substring(0,valor.length-1); } return valor; } function getString(valor) { if (valor==null) res=""; else res=valor; return res; } function addNodo(strId) { var listaSel = ","+getString(getCookie(nombreCookieSelected))+","; var listaDes = ","+getString(getCookie(nombreCookieDeselected))+","; var posSel; posSel =listaSel.indexOf(","+strId+","); if (posSel!=-1) { } else { listaSel = strId+listaSel; listaSel = eliminaDelimitadores(listaSel); SetCookie( nombreCookieSelected, listaSel); } var posDes; posDes =listaDes.indexOf(","+strId+","); if (posDes!=-1) { listaDes = replaceSubstring( listaDes, ","+strId+",", "," ); listaDes = eliminaDelimitadores(listaDes); SetCookie( nombreCookieDeselected, listaDes); } else { } } function delNodo(strId) { var listaSel = ","+getString(getCookie(nombreCookieSelected))+","; var listaDes = ","+getString(getCookie(nombreCookieDeselected))+","; var posDes; posDes =listaDes.indexOf(","+strId+","); if (posDes!=-1) { } else { listaDes = strId+listaDes; listaDes = eliminaDelimitadores(listaDes); SetCookie( nombreCookieDeselected, listaDes); } var posSel; posSel =listaSel.indexOf(","+strId+","); if (posSel!=-1) { listaSel = replaceSubstring( listaSel, ","+strId+",", "," ); listaSel = eliminaDelimitadores(listaSel); SetCookie( nombreCookieSelected, listaSel); } else { } /*if (pos!=-1) { lista = replaceSubstring( lista, ","+strId+",", "," ); SetCookie( nombreCookieDeselected, lista); }*/ } function indiceLoad() { var i; var listaSeleccionados = getString(getCookie(nombreCookieSelected)); var listaDeseleccionados = getString(getCookie(nombreCookieDeselected)); var vSel = listaSeleccionados.split(","); var vDes = listaDeseleccionados.split(","); //alert(listaSeleccionados); //alert(listaDeseleccionados); for (i=0;i]*='+nombreNodo+'_)([0-9]*)','g'); res = res.replace(re, '<$1'+subindice); re = new RegExp('<([^>]*="'+nombreNodo+'_)([0-9]*)','g'); res = res.replace(re, '<$1'+subindice); //alert(5); nododiv.innerHTML=nododiv.innerHTML+"
"+res+"[ Borrar ]"; //alert(nododiv.innerHTML); //alert(6); if (valor==null) valor="A01"; if (valor!=null) { nuevoNodo = nombreNodo + "_" + subindice; //alert(nuevoNodo); document.formulario[nuevoNodo].value=valor; //alert(8); } } function changeValoresPrecio(item) { var f = document.formulario; var iva; var precio_siniva = f["precio_siniva"].value; var pvp_final=f["pvp_final"].value; nameItem=""; if (item!=null) { nameItem = item.name; } if (nameItem=="pvp_final") { if (!esVacio(pvp_final)) { pvp_final = parseFloat( str2double(pvp_final) ); iva = f["iva"].value; if (iva=="") { f["iva"].value="4"; iva="4"; } if (!esVacio(iva)) { iva = parseFloat( str2double(iva) ); precio_siniva = pvp_final/((100+iva)/100); f.precio_siniva.value = FormatNumber(precio_siniva,4,true,false,false) ; } } else { f.precio_siniva.value = ""; } } else { if (!esVacio(precio_siniva)) { precio_siniva = parseFloat( str2double(precio_siniva) ); iva = f["iva"].value; if (iva=="") { f["iva"].value="4"; iva="4"; } if (!esVacio(iva)) { iva = parseFloat( str2double(iva) ); total = precio_siniva*(100+iva)/100; f.pvp_final.value = FormatNumber(total,2,true,false,false) ; } } else { f.pvp_final.value = ""; } } var base = f["base"].value; var pvp_final_canarias = f["pvp_final_canarias"].value; if (nameItem=="pvp_final_canarias") { if (!esVacio(pvp_final_canarias)) { pvp_final_canarias = parseFloat( str2double(pvp_final_canarias) ); igic = f["igic"].value; if (igic=="") { f["igic"].value="0"; igic="0"; } if (!esVacio(igic)) { igic = parseFloat( str2double(igic) ); aiem = f["aiem"].value; if (aiem=="") { f["aiem"].value="4"; aiem="4"; } if (!esVacio(aiem)) { aiem = parseFloat( str2double(aiem) ); base = pvp_final_canarias / ((100+igic+aiem) /100); f.base.value = FormatNumber(base,4,true,false,false) ; } } } else { f.base.value = ""; } } else { if (!esVacio(base)) { base = parseFloat( str2double(base) ); igic = f["igic"].value; if (igic=="") { f["igic"].value="0"; igic="0"; } if (!esVacio(igic)) { igic = parseFloat( str2double(igic) ); aiem = f["aiem"].value; if (aiem=="") { f["aiem"].value="4"; aiem="4"; } if (!esVacio(aiem)) { aiem = parseFloat( str2double(aiem) ); total = base* (100+igic+aiem) /100; f.pvp_final_canarias.value = FormatNumber(total,2,true,false,false) ; } } } else { f.pvp_final_canarias.value = ""; } } } function findScrollTop() { if (window.pageYOffset != null) return window.pageYOffset; if (document.body.scrollWidth != null) return document.body.scrollTop; return null; } var offsetTablaInicial = null; function miOnScroll() { var top; //alert("scroll"); if ( offsetTablaInicial==null) { offsetTablaInicial = document.all["tabla_desplazar"].offsetTop; } else { top = findScrollTop(); if (top!=null) { if (top>offsetTablaInicial) { document.all["tabla_desplazar"].style.top = top; } else { document.all["tabla_desplazar"].style.top = offsetTablaInicial; } } } } function getValor(item) { var res=null; if (item!=null) { if (item.value==null) { for (i=0;i=delim.length) { if (res.substring(0,delim.length)==delim) { res = res.substring(delim.length); } } return res; } /* dado campo_1_idcampopersonalizado te obtiene el 1 */ function getIdcampo(str) { var res; res=str; res = getLeftToLast(res,"_",1); res = getRightToLast(res,"_",1); return res; } function getRightToLast(cadena, delim, num) { var pos; var res=""; var tmp=cadena; for(i=0;i=delim.length) { if (res.substring(0,delim.length)==delim) { res = res.substring(delim.length); } } return res; } function getLeftToLast(cadena, delim, num) { var pos; var res=cadena; for(i=0;iX "+valor+"
"; res = res + ";"+atributo; if (res.substring(0,1)==";") res = res.substring(1); // estoy quitando la coima. doc.formulario['campocontributor_'+ campo + '_contributorrole'].value = res; } if (window.opener!=null) { window.close(); } } function replaceSubstring(inputString, fromString, toString) { // Goes through the inputString and replaces every occurrence of fromString with toString var temp = inputString; if (fromString == "") { return inputString; } if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation) while (temp.indexOf(fromString) != -1) { var toTheLeft = temp.substring(0, temp.indexOf(fromString)); var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length); temp = toTheLeft + toString + toTheRight; } } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop var midStrings = new Array("~", "`", "_", "^", "#"); var midStringLen = 1; var midString = ""; // Find a string that doesn't exist in the inputString to be used // as an "inbetween" string while (midString == "") { for (var i=0; i < midStrings.length; i++) { var tempMidString = ""; for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; } if (fromString.indexOf(tempMidString) == -1) { midString = tempMidString; i = midStrings.length + 1; } } } // Keep on going until we build an "inbetween" string that doesn't exist // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string while (temp.indexOf(fromString) != -1) { var toTheLeft = temp.substring(0, temp.indexOf(fromString)); var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length); temp = toTheLeft + midString + toTheRight; } // Next, replace the "inbetween" string with the "toString" while (temp.indexOf(midString) != -1) { var toTheLeft = temp.substring(0, temp.indexOf(midString)); var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length); temp = toTheLeft + toString + toTheRight; } } // Ends the check to see if the string being replaced is part of the replacement string or not return temp; // Send the updated string back to the user } // Ends the "replaceSubstring" function function str2double(str) { var dvalue; dvalue = parseFloat(replaceSubstring( replaceSubstring(str,".",""),",",".") ); return dvalue; } //Pasa un valor real a cadena con 2 decimales y separador de miles. function double2moneda (numero) { //1. Redondeo a 2 decimales var cadena = Math.round( numero * 100)+""; if (cadena.length==1) { cadena = "0"+cadena+"0"; } else if (cadena.length==2) { cadena = "0"+cadena; } //alert(numero+" ::: "+cadena+" :: "+cadena.length); var res = cadena.substring( 0, cadena.length-2) + "," + cadena.substring( cadena.length-2, cadena.length); //alert("Cadena="+cadena+"; res="+res+"; numero="+numero+"; otro="+cadena.substring( cadena.length-2, cadena.length)); var parteEntera = res.substring( 0, res.length-3); var num = ""; var lon = parteEntera.length; for (j = 0; j < lon; j++){ if ((j % 3 == 0) && (j > 0)) num = "." + num; num = parteEntera.charAt(lon - j - 1) + num; } res = num + res.substring( res.length-3, res.length); return res; } function aniadirQuery(url, resto) { var res; if (url.indexOf('?')==-1) { res = url +'?'+resto; } else { res = url +'&'+resto; } return res; } function construyeUrlMenosMas(url,lista,itemsMas) { var res,urlBase,resto,w,x,i,atributo,valor,nresto; var v = url.split("?"); if (v.length==1) { res = url+"?"+itemsMas; } else { nresto=""; urlBase = v[0]; resto = v[1]; w = resto.split("&"); for (i=0;i0) valor = x[1]; if (valor!="") { if (!perteneceLista(atributo,lista)) { nresto = nresto + "&" + atributo + "=" + valor; } } } } nresto += "&" + itemsMas; if (nresto!="") nresto=nresto.substring(1); res = urlBase + "?" + nresto; } return res; } function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas) /********************************************************************** IN: NUM - the number to format decimalNum - the number of decimal places to format the number to bolLeadingZero - true / false - display a leading zero for numbers between -1 and 1 bolParens - true / false - use parenthesis around negative numbers bolCommas - put commas as number separators. RETVAL: The formatted number! **********************************************************************/ { if (isNaN(parseInt(num))) return "NaN"; var tmpNum = num; var iSign = num < 0 ? -1 : 1; // Get sign of number // Adjust number so only the specified number of numbers after // the decimal point are shown. tmpNum *= Math.pow(10,decimalNum); tmpNum = Math.round(Math.abs(tmpNum)) tmpNum /= Math.pow(10,decimalNum); tmpNum *= iSign; // Readjust for sign // Create a string object to do our formatting on var tmpNumStr = new String(tmpNum); // See if we need to strip out the leading zero or not. if (!bolLeadingZero && num < 1 && num > -1 && num != 0) if (num > 0) tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length); else tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length); // See if we need to put in the commas if (bolCommas && (num >= 1000 || num <= -1000)) { var iStart = tmpNumStr.indexOf("."); if (iStart < 0) { iStart = tmpNumStr.length; } iStart -= 3; while (iStart >= 1) { tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length) iStart -= 3; } } // See if we need to use parenthesis if (bolParens && num < 0) tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")"; var pos = tmpNumStr.indexOf("."); if (pos<0) { tmpNumStr = tmpNumStr+"."; for (i=0;i 0) && (str.indexOf("@") > 0); if (res) { //pos = str.indexOf("@"); //dominio = str.substring(pos); } // comprobar que no tenga acentos var forbidden = "áéíóúÁÉÍÓÚ"; for (i=0;i0) res = true; } return res; } function esNumericoVolumen(str){ var validRegExp = /^([1-9]+)(\.[1-9]+)?$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esNumericoRomanos(str){ var validRegExp = /^[IVXLCDM]+$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esLoginValido(str){ var validRegExp = /^[A-Za-z0-9]+$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esShortnameValido(str){ var validRegExp = /^[A-Za-z0-9_]+$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esDilveIdValido(str){ var validRegExp = /^[A-Za-z0-9][A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esDilveIdValido2(str){ var validRegExp = /^........[A-Za-z0-9][A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?[A-Za-z0-9]?$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esNombreFicheroValido(strIn){ str = getNombreFile(strIn); var validRegExp = /^[A-Za-z0-9_\-]+$/i; res=true; if (str.search(validRegExp) == -1) { res=false; } return res; } function getNombreFile(str) { var res=""; var strfile = ""; var pos = -1; strfile = str.replace( '/','\\'); pos = strfile.lastIndexOf("\\"); res = strfile.substring(pos+1); res = res.toLowerCase(); return res; } function esNombreDescargaErroneo(str){ var validRegExp = /^[A-Za-z0-9]+$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esNumerico(str){ var validRegExp = /^[0-9]+$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function esAnnio(str){ var validRegExp = /^[0-9][0-9][0-9][0-9]$/i; res=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { res=false; } return res; } function numDigitos(numero, numDigitos) { var res=""+numero; while (res.length "9"))) return false; } // All characters are numbers. return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year){ // February has 29 days in any year evenly divisible by four, // EXCEPT for centurial years which are not also divisible by 400. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function isDate(dtStr){ var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strMonth=dtStr.substring(0,pos1) var strDay=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ //alert("The date format should be : mm/dd/yyyy") return false } if (strMonth.length<1 || month<1 || month>12){ //alert("Please enter a valid month") return false } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ //alert("Please enter a valid day") return false } if (strYear.length != 4 || year==0 || yearmaxYear){ //alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear) return false } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ //alert("Please enter a valid date") return false } return true } function ValidateForm(){ var dt=document.frmSample.txtDate if (isDate(dt.value)==false){ dt.focus() return false } return true } /*** FIN FUNCIONES DE FECHA ***/ /*** FIN FUNCIONES DE FECHA ***/ /*** FIN FUNCIONES DE FECHA ***/ function clickMenu(item) { var nodo, i; /*var strMenus="editorial,busquedas,cargas,descargas,seleccion,principal,default"; var v=strMenus.split(","); nombre = (item.id).substring(2); for (i=0;i=3) { jAlert("No se pueden introducir más de 3 resúmenes","Aviso"); return; } numeroResumen++; } var res = nuevoTexto; var re; re = new RegExp('<([^>]*=campo'+strTitle+'_)([0-9]*)','g'); res = res.replace(re, '<$1'+idCampos); re = new RegExp('<([^>]*="campo'+strTitle+'_)([0-9]*)','g'); res = res.replace(re, '<$1'+idCampos); re = new RegExp('<([^>]*id=campo'+strTitle+'_)([0-9]*)','g'); res = res.replace(re, '<$1'+idCampos); re = new RegExp('<([^>]*id="campo'+strTitle+'_)([0-9]*)','g'); res = res.replace(re, '<$1'+idCampos); re = new RegExp('Campo ([0-9]*):','g'); res = res.replace(re, 'Campo '+idCampos); //alert(res); var strSpan = nodo.id.substring(0, nodo.id.length-4 ) + "span"; var span = getElement( strSpan ); elem = document.createElement("div"); elem.id = "campo"+strTitle+"_" + idCampos+ "_span" idCampos++; elem.innerHTML = res; span.parentNode.appendChild( elem ); return idCampos-1; } function getPadreConId(nodo) { var res=null; //alert(nodo); if (nodo.id!=null) { if (nodo.id!="") { res = nodo; } } if (res==null) res = getPadreConId(nodo.parentNode); return res; } function getIdentificadorPadre(nodo) { var nodoPadre = getPadreConId(nodo); var res=nodoPadre.id; return res; } function getIdentificadorPadreIndice(nodo) { var nodoPadre = getPadreConId(nodo); var v = nodoPadre.id.split("_"); var res=""; res = v[1]; return res; } /* function eliminarCampo(strId,strTitle) { if (confirm("¿Seguro que desea eliminar este dato?")) { if (strId!="campo"+strTitle+"_1_span") { var nodo = getElement(strId); nodo.parentNode.removeChild( nodo ); } } }*/ function eliminarCampo(nodo,strTitle) { var nodoPadre = getPadreConId(nodo); jConfirm('¿Seguro que desea borrar este elemento?','Confirmación',function(r){ if(r){ if(strTitle=="othertext") numeroResumen--; var nodo = nodoPadre; nodo.parentNode.removeChild( nodo ); }return false;}); } // Dado un nodo que tiene un nobre tal que "camposubject_1_href" elimina el nodo que tiene como base "subject" function eliminarCampoBase(item) { var name = ""+item.id; name = name.substr(5); name = getLeftNumber(name,"_",1); return eliminarCampo(item.parentNode.parentNode,name); } function comprobarEstado() { jConfirm("Va a abrir un archivo de más de 250 KB. ¿Desea continuar?","Confirmación",function(r){ if(r){return true; }else{return false; }}); } function esUnicamenteDilveIdFromCodigo(codigo) { var ean = trim(codigo); //Miro si es EAN var validRegExp = /^[0-9].*$/i; esEan=true; // search email text for regular exp matches if (str.search(validRegExp) == -1) { esEan=false; } return !esEan; } function selectAll(valor) { var f = document.SeleccionForm; res=""; patron="_"; var elements = f.elements; for(i=0;i 9) { result_dni=false; }else { if (longitud < 9) { dif= 9 - longitud; str2=""; for (i=0;i <= dif-1 ; i++) { str2=str2.concat("0"); } valor=str2.concat(valor); result_dni = comprobarDni(valor); } result_dni = comprobarDni(valor); } break; } } return result_dni; } function comprobarDni(dni) { var i=0; var posicion=0; var letra=""; while (dni[i] == 0) { i++; } dni=dni.substr(i,dni.length); cadena = "TRWAGMYFPDXBNJZSQVHLCKET"; posicion = parseInt(dni.substr(0, dni.length-1),10) % 23; letra = cadena.substr(posicion, 1); if(dni.substr(dni.length-1, 1) == letra) { correcto=true; }else correcto=false; return correcto; } function comprobarNie(nie) { correcto=true; switch(nie.substr(0,1)) { case "X": { nie=nie.replace('X','0'); break; } case "Y": { nie=nie.replace('Y','1'); break; } case "Z": { nie=nie.replace('Z','2'); break; } default: { correcto=false; break; } } if(correcto) { correcto = comprobarDni(nie); } return correcto; } function comprobarNif(cif) { var Pattern1 = /^(K|P|Q|S)[0-9]{7}[A-Z]$/; var Pattern2 = /^(A|B|E|H)[0-9]{8}$/; switch (true) { case (cif.search(Pattern1) != -1): { result_cif= realizarCalculos(cif,false); break; } case (cif.search(Pattern2) != -1): { result_cif= realizarCalculos(cif,true); break; } default: { result_cif= realizarCalculos(cif,"letra_o_numero"); break; } } return result_cif; } function realizarCalculos(cif,digControlNum) { var valor_cif=cif.substr(1,7); var suma_pares=0; for(i=1;i<=valor_cif.length-1;i=i+2) { suma_pares=suma_pares + parseInt(valor_cif.charAt(i),10); } var suma_impares=0; var aux_producto=""; for(j=0;j<=valor_cif.length-1;j=j+2) { aux_producto=String(parseInt(valor_cif.charAt(j),10)*2); var aux_suma=0; for(z=0;z<=aux_producto.length-1;z++) { aux_suma=aux_suma + parseInt(aux_producto.charAt(z),10); } suma_impares=suma_impares + aux_suma; } total=String(suma_pares + suma_impares); if (total.length == 2) { aux_total=total.charAt(1); }else aux_total=total.charAt(0); if (parseInt(aux_total,10) != 0) { total_10 = 10 - aux_total ; }else { total_10 = aux_total; } if(digControlNum == true) { if(total_10 == parseInt(cif.substr(8,8),10)) { result_calculos=true; }else { result_calculos=false; } }else if(!digControlNum) { cadena = "JABCDEFGHI"; if(cadena.charAt(total_10) == cif.substr(8,8)) { result_calculos = true; }else result_calculos = false; }else { cadena = "JABCDEFGHI"; if(total_10 == parseInt(cif.substr(8,8),10)) { result_calculos=true; }else if(cadena.charAt(total_10) == cif.substr(8,8)) { result_calculos = true; }else result_calculos = false; } return result_calculos; } function quitarEspaciosGuiones(cadena) { cadena=cadena.replace(new RegExp("-", 'g'),""); cadena=cadena.replace(new RegExp(" ", 'g'),""); cadena=cadena.replace(new RegExp("[.]", 'g'),""); return cadena; }