function abrirVentana(url, width, height, name) { if (name==null) {name='nueva_ventana';} var str = "height=" + height + ",innerHeight=" + height; str += ",width=" + width + ",innerWidth=" + width; if (window.screen) { var ah = screen.availHeight - 30; var aw = screen.availWidth - 10; var xc = (aw - width) / 2; var yc = (ah - height) / 2; str += ",left=" + xc + ",screenX=" + xc; str += ",top=" + yc + ",screenY=" + yc; } str += ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no"; objwin=window.open(url, name, str); objwin.focus(); } function getObj(id) {if (document.getElementById) {return document.getElementById(id)} else if (document.all) {return document.all[id]} else {return document.all[id]}} function setget_attr(obj, prop, val) { if (!val) return obj.getAttribute(prop); else { if (prop=="onmouseover" || prop=="onmouseout" || prop=="onclick" || typeof val=="function") { if (BrowserDetect.browser=="Explorer") val = Function(val); } obj.setAttribute(prop,val); } } function rnd(max) { var x = Math.random() * max; x = x + 1; return parseInt(x); } function goprint(url) { abrirVentana(getUrlPrint(location.href)+"&imprimir=ok", 999, 600, "_imprimir") } function getUrlPrint(url) { var aux=url.split("?"); var dir=aux[0]; if (aux.length>1) { aux=aux[1].split("&"); n=""; for (var i=0;i 0) { alert('Dirección de correo incorrecta o email no válido.|Los emails no coinciden.'); form.email.focus(); return false; } return true; } function validar_recomendar(form) { if (form.miemail.value.indexOf('@') < 0 || form.miemail.value.indexOf('.') < 0 || form.miemail.value.indexOf(',') > 0) { DHTMLALERT('Por favor, indique su dirección de email'); form.miemail.focus(); return false; } if (form.minombre.value == '') { DHTMLALERT('Por favor, indique su nombre'); form.minombre.focus(); return false; } if (form.tunombre.value == '') { DHTMLALERT('Por favor, indique el nombre de su amigo'); form.tunombre.focus(); return false; } if (form.tuemail.value.indexOf('@') < 0 || form.tuemail.value.indexOf('.') < 0 || form.tuemail.value.indexOf(',') > 0) { DHTMLALERT('Por favor, indique la dirección de email de su amigo'); form.tuemail.focus(); return false; } return true;} var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i 0) { DHTMLALERT(mensaje); form.email.focus(); return false; } if (valor!=confirm_email) {DHTMLALERT(mensaje_extra);form.email.focus();return false;} } else { if (valor=="") {DHTMLALERT(mensaje);eval("form."+campo+".focus()");return false;} } } var o=getObj("btn_submit"); if (o!=null) {o.disabled=true;} return true; } function validar_form_update(form) { var campo,mensaje,valor; for (var i=0;i 0) { DHTMLALERT(mensaje); form.email.focus(); return false; } } else { if (valor=="") {DHTMLALERT(mensaje);eval("form."+campo+".focus()");return false;} } } return true; } function updown_carrito(despl,id,limit) { if (limit==null) {limit=0;} var objcant=getObj("cantidad_"+id); if (isNaN(objcant.value)) {objcant.value=1;return;} var cant=objcant.value; cant=parseInt(cant)+despl; if (cant 0) { DHTMLALERT(aux[0]); form.tiny_email.focus(); return false; } if (form.tiny_nombres.value=="" || form.tiny_nombres.value=="Nombre") {DHTMLALERT('Por favor, ingrese su nombre.');return false;} if (form.tiny_apellidos.value=="" || form.tiny_apellidos.value=="Apellido") {DHTMLALERT('Por favor, ingrese su apellido.');return false;} return true; } function hide_testimonio() { var ly_transparente=getObj("ly_transparente"); ly_transparente.style.display="none"; force_hide('ly_testimonio_form'); } function validar_recomendar_usuarios(form) { if (form.nombres.value=="") {DHTMLALERT("Por favor, ingrese su nombre.");form.nombres.focus();return false;} if (form.apellidos.value=="") {DHTMLALERT("Por favor, ingrese su apellido.");form.apellidos.focus();return false;} m="Dirección de correo incorrecta o email no válido.|Los emails no coinciden.".split("|"); if (form.email.value.indexOf('@') < 0 || form.email.value.indexOf('.') < 0 || form.email.value.indexOf(',') > 0) { DHTMLALERT(m[0]); form.email.focus(); return false; } if (form.id_pais.value=="") {DHTMLALERT("Por favor, seleccione su país.");form.id_pais.focus();return false;} if (form.texto.value=="") {DHTMLALERT("Por favor, indique el mensaje.");form.texto.focus();return false;} var o=document.getElementsByName("calificacion"); var chk=false; for (var i=0;i"; lc.style.display=""; sp.innerHTML=imagen; } } else { lc.style.display="none"; ly.style.display="none"; td.className=""; } } } function hide_cargando2(i) { var lc=getObj("div_cargando2"+i); lc.style.display="none"; } function cart2mail() { var o; o=getObj("e_nombres"); if (o.value=="") {parent.DHTMLALERT('Por favor, ingrese su nombre.');o.focus();return;} var n=o.value; o=getObj("e_apellidos"); if (o.value=="") {parent.DHTMLALERT('Por favor, ingrese su apellido.');o.focus();return;} var a=o.value; o=getObj("e_email"); if (o.value.indexOf('@') < 0 || o.value.indexOf('.') < 0 || o.value.indexOf(',') > 0) { parent.DHTMLALERT('Por favor, indique su dirección de email'); o.focus(); return; } var m=o.value; var url="/scripts/send_cart_mail.php?m="+m+"&n="+n+"&a="+a; crear_script_tag(url); } function crear_script_tag(file) { var head = document.getElementsByTagName('head').item(0) var scriptTag = document.getElementById(file); if(scriptTag==null) scriptTag = document.createElement('script'); var vch="?"; if (file.indexOf("?")!=-1) vch="&"; scriptTag.src = file+vch+Math.random()*1000000; scriptTag.type = 'text/javascript'; scriptTag.id = file; head.appendChild(scriptTag) } function start_frame_cart(destino) { if ( parent.cart_iframe != undefined && parent.cart_iframe != null) { parent.cart_iframe.location.href=destino; } else { var url="/scripts/select_framed.php?cart="+escape(destino)+"&url_actual="+escape(location.href); crear_script_tag(url); } } function video(id) { var url="/scripts/get_video.php?id="+id; crear_script_tag(url); } function set_player(flv) { var o=getObj("ly_player"); o.innerHTML=flv; force_display("ly_player_container"); } function close_player() { var o=getObj("ly_player"); o.innerHTML=""; force_hide("ly_player_container"); } function regen() {i=getObj("img_ver");i.src=DIR+"/includes/img.php?"+Math.random();}