function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i\n"; } else { if (extension == "jpg" || extension == "jpeg" || extension == "gif" || extension == "png") { var salida = "\n\n"; } else { // flash var salida = ""; salida += ""; salida += ""; salida += ""; salida += ""; salida += ""; salida += "\n"; } } document.Codigo.code.value = salida; } function trim(str) { return ltrim(rtrim(str)); } function ltrim(str) { var resultstr = ""; var i; for ( i = 0; (i < str.length) && (str.charAt(i) == " "); i++) ; while (i < str.length) { resultstr += str.charAt(i); i++; } return resultstr } function rtrim(str) { var resultstr = "" var i; for (i = str.length-1; (i > -1) && (str.charAt(i) == " "); i--); while (i > -1) { resultstr = str.charAt(i) + resultstr; i--; } return resultstr } function limpia(palabra) { var tmp = palabra.split('\n'); var estado = 0; var limpio = new Array(); var temp = ""; var i = 0; for (i = 0 ; i < tmp.length ; i++) { if (tmp[i] != "\n" && tmp[i] != "\r\n") { limpio[limpio.length] = tmp[i]; } } palabra = limpio.join(' '); for (i = 0 ; i < palabra.length ; i++) { if (palabra[i] != ' ') estado = 0; else if (palabra[i] == ' ' && estado == 0) estado = 1; else if (palabra[i] == ' ' && estado == 1) continue; temp += palabra.charAt(i); } return trim(temp); } function limpia_keys(keywords) { var tmp = keywords.split('\n'); var tmpcad = ""; var limpio = new Array(); var i = 0; var j = 0; for (i = 0 ; i < tmp.length ; i++) { tmpcad = limpia(tmp[i]); if (tmp[i] != '') { limpio[limpio.length] = tmpcad; } } return limpio.join('\n'); } function valida() { var title = document.meta.title.value; var description = document.meta.description.value; var keywords = document.meta.keywords.value; if (title && description && keywords) { document.meta.generate.disabled = false; } else { document.meta.generate.disabled = true; } } function rellena() { var title = document.meta.title.value; var keywords = document.meta.keywords.value; var description = document.meta.description.value; var i = 0; title = limpia(title); description = limpia(description); keywords = limpia_keys(keywords); document.meta.title.value = title; document.meta.keywords.value = keywords; document.meta.description.value = description; var sec = document.meta.section.options[document.meta.section.selectedIndex].value; var lang = document.meta.lang.options[document.meta.lang.selectedIndex].value; if (lang == '*') { alert('Debes seleccionar al menos el Idioma.'); return false; } if (!title || !keywords || !description) { alert('Rellena Formulario'); return false; } return true; } var hexadecimal = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"); function rgb2hex(R, G, B) { if (R > 255 || G > 255 || B > 255) { alert('Las cifras no pueden ser mayores que 255'); return false; } if (R < 0 || G < 0 || B < 0) { alert('Las cifras no pueden ser menores que 0'); return false; } var Rrest = R % 16; var R = (R - Rrest) / 16; var Grest = G % 16; var G = (G - Grest) / 16; var Brest = B % 16; var B = (B - Brest) / 16; var red = hexadecimal[R] + hexadecimal[Rrest]; var green = hexadecimal[G] + hexadecimal[Grest]; var blue = hexadecimal[B] + hexadecimal[Brest]; return '#'+red+green+blue; } function indexOf (what) { var i = new Number(); for (i=0 ; i < hexadecimal.length ; i++) { if (hexadecimal[i] == what.toUpperCase()) { return i; } } return 0; } function muestra_color(objeto, color) { if (!color) { color = getColor(objeto); } document.pal.sample.style.background = color; } function hex2rgb(RGB) { var valor = new Array; var cifras = new Array; RGB = RGB.replace("#",""); valor[0] = parseInt(indexOf(RGB.substr(0,1))); valor[1] = parseInt(indexOf(RGB.substr(1,1))); valor[2] = parseInt(indexOf(RGB.substr(2,1))); valor[3] = parseInt(indexOf(RGB.substr(3,1))); valor[4] = parseInt(indexOf(RGB.substr(4,1))); valor[5] = parseInt(indexOf(RGB.substr(5,1))); cifras[0] = valor[0] * 16 + valor[1]; cifras[1] = valor[2] * 16 + valor[3]; cifras[2] = valor[4] * 16 + valor[5]; return Array(cifras[0], cifras[1], cifras[2]); } function chkColorImg(color) { if (color == 'red') { return true; } else { return false; } } function getColor(objeto) { if (document.layers) { eval('var hex = window.document.layers[objeto].bgColor'); } else if (document.all) { eval('var hex = window.document.all[objeto].style.background'); } return hex; } function colores(inicio) { var index = document.pal.sel.value; if (!index) { alert('Haga click sobre el campo a cambiar y posteriormente seleccione el color en la paleta'); return; } document.pal.elements[index].value = inicio; document.pal.elements[index].style.background = inicio; var RGB = new Array(); RGB = hex2rgb(inicio); if (((RGB[0] + RGB[1] + RGB[2]) / 3) >= 85) { document.pal.elements[index].style.color = '#000000'; } else { document.pal.elements[index].style.color = '#FFFFFF'; } update_elem(index, inicio); } function paleta() { var i = j = 0; var R = G = B = 0; var paso = 51; document.write(''); for (G = 0; G <= 255 ; G = G + paso) { document.write(''); for (R = 0; R <= 255 ; R = R + paso) { for (B = 0; B <= 255 ; B = B + paso) { color = rgb2hex(R,G,B); document.write(''); } } document.write("\n"); } document.write('
   
'); } function check_contract() { var contrato = document.getElementById("check_contrato"); if (!contrato.checked) { alert(_JS_TEXTOS['DEBEACEPTARCONTRATO']) return false; } else return true; } function ventanaSecundaria (URL, ancho, alto){ window.open(URL,"ventana1","width=" + ancho + ", height= " + alto + ", scrollbars=no, menubar=no, location=no, resizable=no") } function cambia_categoria() { // Leemos el pais elegido var pais; pais = document.admin_cat.codcate[document.admin_cat.codcate.selectedIndex].value; //alert(pais); // Si hemos seleccionado alguno, ponemos sus provincias if (pais != "") { // Seleccionamos el array de provincias mis_sub_value=eval("categoria_value_" + pais); mis_sub_text=eval("categoria_text_" + pais); // Calculamos número de provincias num_sub = mis_sub_value.length; // Lo ponemos como tamaño del select document.admin_cat.codsubcate.length = num_sub; // Por defecto ponemos selected a la primera opción var mi_sub = 0; // Introducimos en el select de provincias las que tenemos en el array for(i=0; i < num_sub;i++) { document.admin_cat.codsubcate.options[i].value=mis_sub_value[i]; document.admin_cat.codsubcate.options[i].text=mis_sub_text[i]; if (mis_sub_value[i]==mi_sub) document.admin_cat.codsubcate.options[i].selected = true; } } else { // Si no he seleccionado país, elimino las provincias del select document.admin_cat.codsubcate.length = 1; // Ponemos una opción vacía document.admin_cat.codsubcate.options[0].value = ""; document.admin_cat.codsubcate.options[0].text = "Subcategoria"; } } function cambia_categoria3() { // Leemos el pais elegido var pais pais = document.ins_cont_nrs.c[document.ins_cont_nrs.c.selectedIndex].value //alert(pais); // Si hemos seleccionado alguno, ponemos sus provincias if (pais != "") { // Seleccionamos el array de provincias mis_sub_value=eval("categoria_value_" + pais); mis_sub_text=eval("categoria_text_" + pais); // Calculamos número de provincias num_sub = mis_sub_value.length; // Lo ponemos como tamaño del select document.ins_cont_nrs.cs.length = num_sub; // Por defecto ponemos selected a la primera opción var mi_sub = 0; // Introducimos en el select de provincias las que tenemos en el array for(i=0; i < num_sub;i++) { document.ins_cont_nrs.cs.options[i].value=mis_sub_value[i]; document.ins_cont_nrs.cs.options[i].text=mis_sub_text[i]; if (mis_sub_value[i]==mi_sub) document.ins_cont_nrs.cs.options[i].selected = true; } } else { // Si no he seleccionado país, elimino las provincias del select document.admin_cat.codsubcate.length = 1; // Ponemos una opción vacía document.ins_cont_nrs.cs.options[0].value = ""; document.ins_cont_nrs.cs.options[0].text = "Subcategoria"; } } function cambia_categoria2() { // Leemos el pais elegido var pais pais = document.ins_cont_nrs.codcate[document.ins_cont_nrs.codcate.selectedIndex].value; //alert(pais); // Si hemos seleccionado alguno, ponemos sus provincias if (pais != "") { // Seleccionamos el array de provincias mis_sub_value=eval("categoria_value_" + pais); mis_sub_text=eval("categoria_text_" + pais); // Calculamos número de provincias num_sub = mis_sub_value.length; // Lo ponemos como tamaño del select document.ins_cont_nrs.codsubcate.length = num_sub; // Por defecto ponemos selected a la primera opción var mi_sub = 0; // Introducimos en el select de provincias las que tenemos en el array for(i=0; i < num_sub;i++) { document.ins_cont_nrs.codsubcate.options[i].value=mis_sub_value[i]; document.ins_cont_nrs.codsubcate.options[i].text=mis_sub_text[i]; if (mis_sub_value[i]==mi_sub) document.ins_cont_nrs.codsubcate.options[i].selected = true; } } else { // Si no he seleccionado país, elimino las provincias del select document.ins_cont_nrs.codsubcate.length = 1; // Ponemos una opción vacía document.ins_cont_nrs.codsubcate.options[0].value = ""; document.ins_cont_nrs.codsubcate.options[0].text = "Subcategoria"; } } function seleccionar(f,estado) { ff = f.elements; for(var i=0, total = ff.length ; i'; rm.style.display = ''; pre.style.display = ''; break; case 'MM': var texto = '( Necesario: \'.mid\' )'; pre.style.display = ''; break; case 'MR': var texto = '( Necesario: \'.mp3\' )'; pre.style.display = ''; break; case '': var texto = ''; break; } document.getElementById('texto').innerHTML = texto; } function abrir(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir){ var opciones = "fullscreen=" + pantallacompleta + ",toolbar=" + herramientas + ",location=" + direcciones + ",status=" + estado + ",menubar=" + barramenu + ",scrollbars=" + barrascroll + ",resizable=" + cambiatamano + ",width=" + ancho + ",height=" + alto + ",left=" + izquierda + ",top=" + arriba; var ventana = window.open(direccion,"venta",opciones,sustituir); } function f_borra_foto() { var borrar = confirm("Desea borrar la imagen."); if (borrar) { } } function mostrareditar(t){ var tabla = document.getElementById('tabla_modificar'); tabla.style.display = ''; document.getElementById('submit_modi').name = t; } function mostrareditar_cont(t, f){ var tabla = document.getElementById('tabla_modificar'); var fila = document.getElementById(f); if(fila_ant != ''){ var aux_fila = document.getElementById(fila_ant); aux_fila.style.border = '1px solid white'; } fila.style.border = '1px solid #61A7D9'; tabla.style.display = ''; document.getElementById('submit_modi_name').name = t; document.getElementById('submit_modi_desc').name = t; fila_ant = f; }