if(!window.saveInnerWidth){window.onresize=resize;window.saveInnerWidth=window.innerWidth;window.saveInnerHeight=window.innerHeight}function resize(){if(saveInnerWidth<window.innerWidth||saveInnerWidth>window.innerWidth||saveInnerHeight>window.innerHeight||saveInnerHeight<window.innerHeight){window.history.go(0)}}var bLoaded={b1:false,b2:false};function bannerLoaded(c){var b=(document.getElementById(c).contentDocument)?document.getElementById(c).contentDocument:document.frames[c].document;if(b.getElementById(c).offsetHeight<=20&&!(c=="bannerSuperior234")&&!(c=="bannerSuperior")){$("#"+c).hide()}if(c=="bannerSuperior"){bLoaded.b1=true}if((c=="bannerSuperior234")||!document.getElementById("bannerSuperior234")){bLoaded.b2=true}if(bLoaded.b1&&bLoaded.b2){b=(document.getElementById("bannerSuperior").contentDocument)?document.getElementById("bannerSuperior").contentDocument:document.frames.bannerSuperior.document;if(document.getElementById("bannerSuperior234")){var a=(document.getElementById("bannerSuperior234").contentDocument)?document.getElementById("bannerSuperior234").contentDocument:document.frames.bannerSuperior234.document}else{var a=""}if((b.getElementById("bannerSuperior").offsetHeight>20)&&((a=="")||(a.getElementById("bannerSuperior234").offsetHeight>20))){$("#bannerSuperiorBg").css("margin-top","0")}bLoaded.b1=false;bLoaded.b2=false}}function handlerResize(){location.reload();return false}var NS6=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)>4);var IE=(navigator.appName.substring(0,9)=="Microsoft"&&parseInt(navigator.appVersion)>3);var isNS=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4);var pos=new Array();function cargar(imagen,foto){foto2=new Image();foto2.src=imagen;if(NS6||isNS||IE){document[foto].src=eval("foto2.src")}}function ensenar(b,a){$("#"+b).show();$("#"+a).attr("href","javascript:esconder('"+b+"', '"+a+"')")}function ensenarLucene(c,a){$("#masProvincias, #masPaises, #masCategorias").css("visibility","hidden");var b=$("#"+a).offset();$("#"+c).css({top:b.top-30+"px",left:(($(window).width()-$("#botonera").width())/2)+210+"px",visibility:"visible"}).show()}function esconder(b,a){$("#"+b).hide()}function esconderLucene(b,a){$("#"+b).css("visibility","hidden");$("#"+a).attr("href","javascript:ensenarLucene('"+b+"', '"+a+"')")}function seccionOnOff(a){($("#"+a).is(":hidden"))?$("#"+a).show():$("#"+a).hide()}$("#pclave").focus();String.prototype.toUrl=function(){var a=this.toLowerCase().replace(/ÿ/g,"y").replace(/ñ/g,"n").replace(/ç/g,"c");a=a.replace(/[àáâãäå]+/g,"a");a=a.replace(/[èéêë]+/g,"e");a=a.replace(/[ìíîï]+/g,"i");a=a.replace(/[òóôõöø]+/g,"o");a=a.replace(/[ùúûü]+/g,"u");a=a.replace(/[^a-z0-9 ]+/g," ");a=$.trim(a);a=a.replace(/ /g,"-");a=a.replace(/[-]{2,}/g,"-");return encodeURIComponent(a)};function ValidaBusM(){var c=document.busca;var n=$.trim(c.pclave.value);var f=true;c.busReal.value=n;if(n.length<3){alert("La longitud de la palabra clave debe ser superior a 2 carácteres.");c.pclave.value=n;c.pclave.focus();f=false}else{var m=n.match(new RegExp("[%/<>]"));if(m){alert("El caracter "+m+" no está permitido.");f=false}else{if(n.length>100){alert("La longitud de la palabra clave debe ser inferior a 100 carácteres.");c.pclave.focus();f=false}}}if(f){c.buscbot.value="Buscando...";c.buscbot.style.cursor="wait";document.body.style.cursor="wait";n=n.toUrl();var l;var j=new Array("","venta-productos","compra-productos","empresas");l="http://"+document.location.hostname+"/"+j[c.tipobusca.value];if(typeof(c.tipoBuscaNav)=="undefined"||(typeof(c.tipoBuscaNav)!="undefined"&&c.tipoBuscaNav.value==2)){l+="/"+n+"_b"}else{var b=document.location.href;var e=b.split("/");var k=e.length;var d=e[k-1];var a="";if(b.indexOf("_b")==-1){if(d.indexOf("_")!=-1){e[k-1]=d.substring(0,d.indexOf("_"));var h=d.substring(d.indexOf("_")).split("_");h[h.length-2]="1";a=h.join("_")}e[k]=n+"_b";k++}else{e[k-1]=n+d.substring(d.indexOf("_b"))}for(var g=4;g<k;g++){l+="/"+e[g]}l+=a}c.action=l}return f}var mouse={x:0,y:0};document.onmousemove=function(a){if(!a){a=window.event}mouse.x=a.clientX;mouse.y=a.clientY};function cerrarImgZoom(){$("#fotoZoom").css({display:"none",width:"200px",height:"100px"});$("#barraFotoZoom").css("width","100%");$("#capaImgZoom").css({width:"50px",height:"40px",display:"none",background:""});$("#imgZoom").css("visibility","visible")}function cargaImgZoom(c,d){var b={x:mouse.x,y:mouse.y};var a=new Image();obj=document.getElementById("imgZoom");$("#fotoZoom").css({top:b.y+$(window).scrollTop()-66+"px",left:b.x+$(window).scrollLeft()+"px",display:"block"});a.onload=function(){var e=a.width;var f=a.height;$("#fotoZoom").css({top:b.y+$(window).scrollTop()-(f/2)-16+"px",left:b.x+$(window).scrollLeft()+"px",width:e+16+"px",height:f+34+"px"});$("#barraFotoZoom").width(e+16+"px");$("#capaImgZoom").css({width:e+"px",height:f+"px",background:"url("+a.src+")"}).show();obj.style.visibility="hidden"};a.src=c}function abrirModalDialog(b,e,d,j,h){var a=(d==null)?a=300:d;var g=(j==null)?g=400:j;var f=(h==1)?f="yes":"no";anE=screen.width;alE=screen.height;x=anE/2-a/2;y=alE/2-g/2;var c=null;c=open(b,e,"toolbar=no,location=no,directories=no,scrollbars="+f+",status=no,menubar=no,resizable=no,width="+a+",height="+g+",top="+y+",left="+x);c.focus()}$(document).ready(function(){$("#idLinkFotoAmpliar").click(function(){cargaImgZoom(this.href,0);return false});$("#idLinkFotoMasImagenes").click(function(){cargaImgZoom(this.href,0);return false});$("#zoom a").click(function(){cargaImgZoom(this.href,0);return false})});var MAIL=new Array();MAIL[0]=["hotmail.es"];MAIL[1]=["hotamail.com"];MAIL[2]=["hotmial.com"];MAIL[3]=["wanado.es"];MAIL[4]=["hotmil.com"];MAIL[5]=["hotmal.com"];MAIL[6]=["hotmali.com"];MAIL[7]=["yaho.es"];MAIL[8]=["www."];MAIL[9]=["hotamil.com"];function Valida(a){if((!a.clasificado.checked&&!a.datos.checked&&!a.tiempo.checked&&!a.info.checked)&&(a.comentarios.value=="")){alert("Es necesario especificar alguna valoración.");a.comentarios.focus();return false}a.submit()}function ismaxlength(b){var a=b.getAttribute?parseInt(b.getAttribute("maxlength")):"";if(b.getAttribute&&b.value.length>a){b.value=b.value.substring(0,a)}}function ControlEnvioContacto(a){if(a.comentarios.value.length>1000){alert("Tus comentarios no deben superar los 1000 caracteres.\nPor favor, intenta abreviarlos.");a.comentarios.focus();return false}else{if($.trim(a.comentarios.value).length==0){alert("Es necesario introducir tus comentarios para contactar con el vendedor.");a.comentarios.focus();return false}else{if($.trim(a.comentarios.value).length<10){alert("Por favor proporciona más detalles en tu consulta para este vendedor.");a.comentarios.focus();return false}else{if(a.email.value.length==0){alert("Es necesario especificar tu e-mail para contactar con el vendedor");a.email.focus();return false}else{if(!validarMail(a.email.value)){alert("El e-mail introducido no es correcto");a.email.focus();return false}else{if(!validarEmailDominio(a.email.value)){alert("El e-mail introducido no es correcto");a.email.focus();return false}else{if(!$("div#clave").is(":hidden")&&$.trim(a.password.value).length==0){alert("Es necesario introducir la contraseña de tu usuario");a.password.focus();return false}else{if(!$("div#clave").is(":hidden")&&!validarUsuario(a.email.value,a.password.value)){alert("La contraseña es incorrecta");a.password.focus();return false}}}}}}}}if(a.validardatos.value=="1"){nombre=$.trim(a.nombre.value);tel=$.trim(a.tel.value);var b=new RegExp("\\D");var c=new RegExp("^0*$");if(nombre.length==0){alert("Es necesario indicar un Nombre");a.nombre.focus();return false}else{if(!b.exec(nombre)){alert("Nombre incorrecto");a.nombre.focus();return false}else{if(tel.length<5){alert("Es necesario indicar un teléfono de contacto");a.tel.focus();return false}else{if(!/^(\+)?[0-9]{5,15}$/.test(tel)){alert("El teléfono especificado no es correcto");a.tel.focus();return(false)}else{if(/^(\+)?[0]+$/.test(tel)){alert("El teléfono especificado no es correcto");a.tel.focus();return false}else{if(a.cmbProvincia.value==0){alert("Es necesario indicar una Provincia");a.cmbProvincia.focus();return false}else{if(a.cmbPais.value==0){alert("Es necesario indicar un País");a.cmbProvincia.focus();return false}}}}}}}}if(a.tipocontacto.value=="O"){msg=validarContacto(a.tipocontacto.value,a.email.value,a.CodigoEmpresa.value,a.codigo.value,a.Tipo.value)}else{if(a.tipocontacto.value=="E"){msg=validarContacto(a.tipocontacto.value,a.email.value,a.codigo.value)}}if(msg!=""){alert(msg);return false}if(a.validardatos.value==0){if(a.tipocontacto.value=="O"){a.action="/contactoFinOferta"}else{if(a.tipocontacto.value=="E"){a.action="/contactoFinEmpresa"}}}}function validarContacto(d,a,e,c,b){$.ajax({url:"/ajax/checkContacto.cfm",data:"t="+d+"&e="+a+"&c="+e+"&cp="+c+"&tp="+b,dataType:"text",cache:false,async:false,success:function(f){correcto=f.substring(0,f.search(/;/))}});return unescape(escape(correcto).replace(/(%0A)+/g,""))}function ControlComentario(a){if(a.length>1000){alert("Tus comentarios no deben superar los 1000 caracteres.\nPor favor, intenta abreviarlos.")}}function borrarDatos(){var a=document.forms.AltaFormAction.elements;for(i=0;i<a.length;i++){if(a[i].type){var b=a[i].type.toLowerCase();if(b=="text"||b=="password"||b=="textarea"){a[i].value=""}}}}function borrarCookie(){$.ajax({type:"GET",url:"/ajax/borrarCookie.cfm",cache:false,success:function(a,b){window.location.hash="precontactar";$("input[name='nombre'], input[name='tel']").val("");window.location.reload()},error:function(b,a){}})}function mostrarPaises(){$("#pais_inicial").hide();$("#paises").show()}function actualizarPaises(a){$.ajax({type:"GET",url:"/ajax/actualizarPaises.cfm",cache:false,dataType:"html",success:function(b){$("select[name='cmbPais']").html(b.substring(0,b.search(/;/))).val(a);actualizarProvincias()}})}function actualizarProvincias(){$.ajax({type:"GET",url:"/ajax/actualizarProvincias.cfm",cache:false,dataType:"html",data:"pais_codigo="+$("select[name='cmbPais']").val(),success:function(a,b){$("#cmbProvincia").html(a.substring(0,a.search(/;/)))},error:function(b,a){}})}function verificarMail(){$("input[name='email']").val(($("input[name='email']").val()).toLowerCase());var a=($("input[name='email']").val()).toLowerCase();if((a.length!=0)&&(validarMail(a))){$.ajax({type:"GET",url:"/ajax/verificarMail.cfm",cache:false,dataType:"html",data:"Email="+$("input[name='email']").val(),success:function(b){actualizarMail(b.substring(0,b.search(/;/)))},error:function(c,b){}})}}function actualizarMail(a){var b=$.trim(a);if(b=="1"){$("input[name='validardatos']").val("0");$("#datos_ocultables").hide();$("#clave").show();$("textarea[name='comentarios']").focus()}else{$("input[name='validardatos']").val("1");$("#clave").hide();$("#datos_ocultables").show();$("input[name='nombre']").focus()}}$("#checkbox").toggle(function(){this.src="http://web0.ssstatic.com/checkbox_off.gif";$("#form_contacto input[type='checkbox']").attr("checked","")},function(){this.src="http://web0.ssstatic.com/checkbox_on.gif";$("#form_contacto input[type='checkbox']").attr("checked","checked")});$("#ayuda").hover(function(a){$("#tooltip").css({left:a.pageX+15,top:a.pageY+15}).show()},function(a){$("#tooltip").hide()});$("textarea[name='comentarios']").val("");function resize(){var d=this;var a=document.getElementById("busqRelacionadas").offsetHeight;var c=(a>20)?20:40;var b=0;var e=(document.all)?1:7;if(typeof re!="undefined"){clearInterval(re)}re=setInterval(function(){b=(c>=a)?Math.min(a+3,c):Math.max(a-3,c);document.getElementById("busqRelacionadas").style.height=b+"px";a=b;if(b==c){clearInterval(re);(a>20)?document.getElementById("arrowVerMas").src="http://web0.ssstatic.com/upArrow.gif":document.getElementById("arrowVerMas").src="http://web0.ssstatic.com/downArrow.gif"}},e)}function ValidaPrecio(b,a){if(b.pmin.value.length==0){iMinPrecio=0}else{iMinPrecio=b.pmin.value}if(b.pmax.value.length==0){iMaxPrecio=0}else{iMaxPrecio=b.pmax.value}b.btnFiltrar.disabled=true;b.btnFiltrar.value="Filtrando...";location.href=a.replace("filtroMinPrecio",iMinPrecio).replace("filtroMaxPrecio",iMaxPrecio);return false};