(function(a){a.ifixpng=function(b){a.ifixpng.pixel=b};a.ifixpng.getPixel=function(){return a.ifixpng.pixel||"../img/pixel.gif"};var b={ltie7:a.browser.msie&&7>a.browser.version,filter:function(a){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+a+"')"}};a.fn.ifixpng=b.ltie7?function(){return this.each(function(){var d=a(this),c=a("base").attr("href");c&&(c=c.replace(/\/[^\/]+$/,"/"));if(d.is("img")||d.is("input"))d.attr("src")&&d.attr("src").match(/.*\.png([?].*)?$/i)&&
(c=c&&d.attr("src").search(/^(\/|http:)/i)?c+d.attr("src"):d.attr("src"),d.css({filter:b.filter(c),width:d.width(),height:d.height()}).attr({src:a.ifixpng.getPixel()}).positionFix());else{var e=d.css("backgroundImage");if(e.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i))e=RegExp.$1,e=c&&"/"!=e.substring(0,1)?c+e:e,d.css({backgroundImage:"none",filter:b.filter(e)}).children().children().positionFix()}})}:function(){return this};a.fn.iunfixpng=b.ltie7?function(){return this.each(function(){var b=a(this),
c=b.css("filter");if(c.match(/src=["']?(.*\.png([?].*)?)["']?/i))c=RegExp.$1,b.is("img")||b.is("input")?b.attr({src:c}).css({filter:""}):b.css({filter:"",background:"url("+c+")"})})}:function(){return this};a.fn.positionFix=function(){return this.each(function(){var b=a(this),c=b.css("position");"absolute"!=c&&"relative"!=c&&b.css({position:"relative"})})}})(jQuery);var JSON;JSON||(JSON={});
(function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=i[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function d(a,c){var e,n,m,i,o=f,l,h=c[a];h&&"object"===typeof h&&"function"===typeof h.toJSON&&(h=h.toJSON(a));"function"===typeof j&&(h=j.call(c,a,h));switch(typeof h){case "string":return b(h);case "number":return isFinite(h)?""+h:"null";case "boolean":case "null":return""+
h;case "object":if(!h)return"null";f+=g;l=[];if("[object Array]"===Object.prototype.toString.apply(h)){i=h.length;for(e=0;e<i;e+=1)l[e]=d(e,h)||"null";m=0===l.length?"[]":f?"[\n"+f+l.join(",\n"+f)+"\n"+o+"]":"["+l.join(",")+"]";f=o;return m}if(j&&"object"===typeof j){i=j.length;for(e=0;e<i;e+=1)"string"===typeof j[e]&&(n=j[e],(m=d(n,h))&&l.push(b(n)+(f?": ":":")+m))}else for(n in h)Object.prototype.hasOwnProperty.call(h,n)&&(m=d(n,h))&&l.push(b(n)+(f?": ":":")+m);m=0===l.length?"{}":f?"{\n"+f+l.join(",\n"+
f)+"\n"+o+"}":"{"+l.join(",")+"}";f=o;return m}}if("function"!==typeof Date.prototype.toJSON)Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,i={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j;if("function"!==typeof JSON.stringify)JSON.stringify=function(a,b,c){var e;g=f="";if("number"===typeof c)for(e=0;e<c;e+=1)g+=" ";else"string"===typeof c&&(g=c);if((j=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return d("",
{"":a})};if("function"!==typeof JSON.parse)JSON.parse=function(a,b){function e(a,c){var d,f,g=a[c];if(g&&"object"===typeof g)for(d in g)Object.prototype.hasOwnProperty.call(g,d)&&(f=e(g,d),void 0!==f?g[d]=f:delete g[d]);return b.call(a,c,g)}var d,a=""+a;c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d=eval("("+a+")"),"function"===typeof b?e({"":d},""):d;throw new SyntaxError("JSON.parse");}})();var elmHeight="11.5";
jQuery.fn.extend({dgStyle:function(){$.each($(this),function(){var a=$(this).children().get(0);elmType=$(a).attr("type");$(this).data("type",elmType);$(this).data("checked",$(a).attr("checked"));$(this).dgClear()});$(this).mousedown(function(){$(this).dgEffect()});$(this).mouseup(function(){$(this).dgHandle()})},dgClear:function(){!0==$(this).data("checked")?$(this).css("backgroundPosition","center -"+2*elmHeight+"px"):$(this).css("backgroundPosition","center 5px")},dgEffect:function(){},dgHandle:function(){var a=
$(this).children().get(0);!0==$(this).data("checked")?$(a).dgUncheck(this):$(a).dgCheck(this);"radio"==$(this).data("type")&&$.each($("input[name='"+$(a).attr("name")+"']"),function(){a!=this&&$(this).dgUncheck(-1)})},dgCheck:function(a){$(this).attr("checked",!0);$(a).data("checked",!0).css({backgroundPosition:"center -"+2*elmHeight+"px"})},dgUncheck:function(){$(this).attr("checked",!1);$(this).parent().data("checked",!1).css({backgroundPosition:"center 5px"})}});
jQuery(function(a){a.datepicker.regional.es={closeText:"Cerrar",prevText:"&#x3c;Ant",nextText:"Sig&#x3e;",currentText:"Hoy",monthNames:"Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre".split(","),monthNamesShort:"Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic".split(","),dayNames:"Domingo,Lunes,Martes,Mi&eacute;rcoles,Jueves,Viernes,S&aacute;bado".split(","),dayNamesShort:"Dom,Lun,Mar,Mi&eacute;,Juv,Vie,S&aacute;b".split(","),dayNamesMin:"Do,Lu,Ma,Mi,Ju,Vi,S&aacute;".split(","),
weekHeader:"Sm",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};a.datepicker.setDefaults(a.datepicker.regional.es)});function Hash(){this._keys=[];this._values=[]}Hash.prototype.get=function(a){return this._values[this._keys.indexOf(a)]};Hash.prototype.set=function(a,b){-1==this._keys.indexOf(a)?(this._keys.push(a),this._values.push(b)):this._values[this._keys.indexOf(a)]=b};Hash.prototype.unset=function(a){this._values.removeAt(this._keys.indexOf(a));this._keys.remove(a)};
Hash.prototype.keys=function(){return this._keys};Hash.prototype.values=function(){return this._values};Hash.prototype.clear=function(){this._keys=[];this._values=[]};function Paginador(a,b){this._infoObjeto=a;this._paginaCambiado=b}Paginador.prototype.esPrimeraPagina=function(){return 0>=this._infoObjeto.PaginaActual};Paginador.prototype.esUltimaPagina=function(){return this._infoObjeto.PaginaActual>=this._infoObjeto.Total-1};
Paginador.prototype.siguiente=function(){this._infoObjeto.PaginaActual++;this._paginaCambiado(direcciones.izquierda)};Paginador.prototype.anterior=function(){this._infoObjeto.PaginaActual--;this._paginaCambiado(direcciones.derecha)};Array.prototype.compact=function(){return jQuery.grep(this,function(a){if(null!=a&&void 0!=a)return a})};Array.prototype.removeAt=function(a){0<=a&&a<this.length&&this.splice(a,1)};Array.prototype.remove=function(a){this.removeAt(this.indexOf(a))};
Array.prototype.sortNumericoAsc=function(){this.sort(function(a,b){return a-b})};Array.prototype.sortNumericoDesc=function(){this.sort(function(a,b){return b-a})};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,b){var d=this.length,c=Number(b)||0,c=0>c?Math.ceil(c):Math.floor(c);for(0>c&&(c+=d);c<d;c++)if(c in this&&this[c]===a)return c;return-1};Array.prototype.each=function(a){if(a)for(var b=0;b<this.length;b++)a(this[b])};
Function.prototype.bind=function(a){var b=this,d=Array.prototype.slice.call(arguments,1);return function(){b.apply(a,d)}};Function.prototype.defer=function(){this.delay(0)};Function.prototype.delay=function(a){var b=this;args=Array.prototype.slice.call(arguments,1);return setTimeout(function(){return b.apply(b,args)},a)};Date.prototype.getDateString=function(){var a=$.getDoubleVal(this.getMonth()+1),b=$.getDoubleVal(this.getDate()),d=this.getFullYear();return b+"-"+a+"-"+d};
String.prototype.getNetDate=function(){return new Date(parseInt(this.replace("/Date(","").replace(")/",""),10))};String.prototype.format=function(){for(var a=this,b=arguments.length;b--;)a=a.replace(RegExp("\\{"+b+"\\}","gm"),arguments[b]);return a};String.prototype.toImporte=function(){return parseFloat(this.replace(",","."))};String.prototype.toDisplay=function(){return this.toImporte.toString()};Number.prototype.toDisplay=function(){return this.toFixed(1).toImporte().toFixed(2).replace(".",",")};
Number.prototype.toImporte=function(){return this.valueOf()};jQuery.stringify=JSON.stringify;
jQuery.getJson=function(a,b,d,c,e){this.id=e;return $.ajax({type:"POST",url:a,data:$.stringify(b),contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){try{var b=eval("("+a.d+")")}catch(i){onGlobalError&&onGlobalError(c,[i.toString],"Error en parseo",tipoError.error)}d(b,e)},error:function(b){0!=b.status&&onGlobalError&&onGlobalError(c,[b],getLiteral(3),getLiteral(4).format(a),tipoError.errorGrave)}})};jQuery.getAll=function(a){for(el in a)a[el]=null==a[el]?$("#"+el):$(a[el])};
jQuery.getDoubleVal=function(a){return 1==a.toString().length?"0"+a.toString():a};
(function(a){function b(b){var d=[].slice.call(arguments,1),f=0,b=a.event.fix(b||window.event);b.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);d.unshift(b,f);return a.event.handle.apply(this,d)}var d=["DOMMouseScroll","mousewheel"];a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=d.length;a;)this.addEventListener(d[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=d.length;a;)this.removeEventListener(d[--a],
b,!1);else this.onmousewheel=null}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);jQuery.fn.getInt=function(a){return null==a||""==a?parseInt(this.text()):parseInt(this.attr(a))};jQuery.fn.noLink=function(){this.click(function(a){a.preventDefault()})};jQuery.fn.noPropagation=function(){this.click(function(a){a.stopPropagation()})};
jQuery.fn.isFirstChild=function(){var a=this[0];return $(this.parent()[0]).children()[0]==a};jQuery.fn.sel=function(){this.addClass("seleccionado")};jQuery.fn.desel=function(){this.removeClass("seleccionado")};jQuery.fn.isSel=function(){return this.hasClass("seleccionado")};jQuery.fn.toggleSel=function(){this.toggleClass("seleccionado")};jQuery.fn.top=function(){var a=this.css("top");"auto"==a&&(a=0);"string"==typeof a&&(a=a.replace("px",""));return parseInt(a)};
jQuery.fn.left=function(){var a=this.css("left");"auto"==a&&(a=0);"string"==typeof a&&(a=a.replace("px",""));return parseInt(a)};jQuery.fn.maxVal=function(a){null!=a&&this.attr("maxVal",a);return null!=this.attr("maxVal")?this.attr("maxVal"):Number.MAX_VALUE};jQuery.fn.minVal=function(a){null!=a&&this.attr("minVal",a);return null!=this.attr("minVal")?this.attr("minVal"):1};jQuery.fn.increment=function(a,b){var d=this.maxVal(),c=parseInt(this.text());c<d&&(this.text(c+1),configData[b]++,onValChanged())};
jQuery.fn.decrement=function(a,b){var d=this.minVal(),c=parseInt(this.text());c>d&&(this.text(c-1),configData[b]--,onValChanged())};jQuery.fn.isDirty=function(){return this.text()!=this.origVal};jQuery.fn.SetCleanValue=function(a){this.origVal=a};jQuery.fn.initText=function(a){this.SetCleanValue(a);this.text(a)};$.fn.lazybind=function(a,b,d,c){var e=null;$(this).bind(a,function(){e=setTimeout(b,d)});void 0!=c&&$(this).bind(c,function(){null!=e&&clearTimeout(e)})};
function sync(a){this._fncs=new Hash;this._onFinished=a.onFinished;var b=this,d={};d.add=function(a){for(fnc in a)"onFinished"!=fnc&&(b._fncs.set(fnc,a[fnc]),d[fnc]=function(a){return function(){b._fncs.get(a).apply(this,arguments);b._total--;0==b._total&&b._onFinished()}}(fnc));b._total=b._fncs.keys().length};d.add(a);return d}$(document).ready(function(){$("*[trackeventName]").click(onTrackingLinkClicked)});
function onTrackingLinkClicked(){var a=$(this);_gaq.push([a.attr("trackeventName"),a.attr("trackeventType"),a.attr("trackeventAction"),a.attr("trackeventDescription")])}var popUpBg;$(document).ready(function(){popUpBg=$("#backgroundPopup")});
$.registerPopUp=function(a){function b(){if(g){f();a.popup.fadeIn("normal");if(!a.noBackground){var b=a.opacity;!a.opacity&&0!=a.opacity&&(b="0.7");popUpBg.css({opacity:b});popUpBg.show();a.backgroundColor?popUpBg.css("background-color",a.backgroundColor):popUpBg.css("background-color","#000")}d.defer()}}function d(){if(a.onOpenPopup)a.onOpenPopup();$(window).bind("resize",f);a.closeElement&&a.closeElement.click(c);a.openElement&&a.openElement.unbind("click",b)}function c(){g&&(a.popup.fadeOut("normal",
function(){if(a.onClosePopup)a.onClosePopup()}),a.noBackground||popUpBg.hide(),e.defer())}function e(){a.openElement&&a.openElement.click(b);a.closeElement&&a.closeElement.unbind("click",c);$(window).unbind("resize",f)}function f(){if(a.autoCenter){var b=document.documentElement.clientWidth,c=document.documentElement.clientHeight,d=a.popup.height(),e=a.popup.width();a.popup.css({position:"fixed",top:c/2-d/2,left:b/2-e/2});popUpBg.css({height:c})}}a.openElement&&(a.openElement.click(b),a.openElement.noLink());
a.closeElement&&a.closeElement.noLink();var g=!0;return{open:b,close:c,disable:function(){g=!1},enable:function(){g=!0}}};var originalVal=jQuery.fn.val;
jQuery.fn.watermark=function(){this.each(function(){var a=$(this);""!=originalVal.call(a)?a.data("hasChanged",!0):(a.data("hasChanged",!1),originalVal.call(a,a.attr("watermark")));a.focus(function(){if(!a.data("hasChanged"))return originalVal.call(a,"")});a.blur(function(){""==originalVal.call(a)?(a.data("hasChanged",!1),originalVal.call(a,a.attr("watermark"))):a.data("hasChanged",!0)});a.change(function(){""==originalVal.call(a)?(a.data("hasChanged",!1),originalVal.call(a,a.attr("watermark"))):a.data("hasChanged",
!0)})})};jQuery.fn.val=function(a){var b=$(this);return null==a&&this.attr("watermark")?b.data("hasChanged")?originalVal.apply(this,arguments):"":originalVal.apply(this,arguments)};$(document).ready(function(){$("input[watermark]").watermark()});
$.createPaginador=function(a){function b(){d();if(a.onHabilitado)a.onHabilitado();g.esPrimeraPagina()||(habilitaFlecha(direcciones.izquierda,a.filtroPrevImg),a.filtroPrev.click(j));g.esUltimaPagina()||(habilitaFlecha(direcciones.derecha,a.filtroNextImg),a.filtroNext.click(i));a.totalPaginas&&a.totalPaginas.text(data.Total);a.paginaActual&&(0<data.Total?a.paginaActual.text(data.PaginaActual+1):a.paginaActual.text(0))}function d(){if(a.onDeshabilitado)a.onDeshabilitado();deshabilitaFlecha(direcciones.izquierda,
a.filtroPrevImg);deshabilitaFlecha(direcciones.derecha,a.filtroNextImg);a.filtroPrev.unbind("click",j);a.filtroNext.unbind("click",i)}function c(b,c){if(null!=k.get(c)){k.unset(c);f=b.PaginaActual;a.data.Total=b.TotalPaginas;a.contenedor.append(a.paginaTemplate);a.contenedor.width(a.contenedor.width()+a.width);var d=$(a.contenedor.find("ul").last());a.itemTemplate.tmpl(b.List).appendTo(d);if(a.onMostrado)a.onMostrado()}}function e(b,c){if(f!=a.data.Total||c)a.data.Pagina=f+1,$.browser.webkit&&console.log("Pagina: "+
a.data.Pagina),id=(new Date).getTime(),k.set(id,$.getJson(a.servicio,a.data,b,null,id))}var f=0;a.data.PaginaActual=0;var g=new Paginador(a.data,function(f){d();f==direcciones.izquierda&&a.data.Pagina<a.data.Total-1&&e(c);a.contenedor.animate({left:(f==direcciones.derecha?"+=":"-=")+a.width+"px"},200,b)}),i=g.siguiente.bind(g),j=g.anterior.bind(g),k=new Hash;a.filtroPrev.noLink();a.filtroNext.noLink();b();return{recargar:function(g){k.clear();f=-1;a.data.Pagina=0;a.data.PaginaActual=0;d();var j,i=
new sync({onWebresult:function(a,b){j=function(){c.call(this,a,b)}},onFadeFinished:function(){a.contenedor.html("");a.contenedor.html("<img src='img/espera.gif' />");a.contenedor.show();a.contenedor.css("left",0);a.contenedor.css("width",a.width+"px");a.contenedor.css("min-height","815px")},onFinished:function(){a.contenedor.html("");a.contenedor.css("min-height","815px");a.contenedor.hide();j();a.contenedor.fadeIn();b();e(c);g&&g()}});e(i.onWebresult,!0);a.contenedor.fadeOut(i.onFadeFinished)},preLoad:function(){e(c)}}};
var MOUSEWHEELSPEED=10,SCROLLTRACKHEIGHT=151,OVERFLOWMARGIN=20,LISTADOHEIGHT=205;
$.initScroll=function(a){function b(){var a=d();0<a.overflow&&f.css("top",-a.overflow*a.handlePct+"px")}function d(){return{listheight:f.height(),overflow:f.height()-LISTADOHEIGHT+OVERFLOWMARGIN,handleTop:c.top(),handlePct:c.top()/SCROLLTRACKHEIGHT,listTop:f.top()}}var c=a.handle,e=a.track,f=a.container;c.draggable({containment:e,scroll:!1,axis:"y",drag:b});e.click(function(){var a=event.pageY-e.offset().top;a>SCROLLTRACKHEIGHT?a=SCROLLTRACKHEIGHT:20>a&&(a=0);c.css("top",a+"px");b()});f.mousewheel(function(a,
b){var e=d(),k=e.listTop+b*MOUSEWHEELSPEED;0<e.overflow&&k>-e.overflow&&0>=k?(f.css("top",k+"px"),c.css("top",-(k/e.overflow)*SCROLLTRACKHEIGHT+"px")):0>=e.overflow?(f.css("top","0px"),c.css("top","0px")):k<-e.overflow?(f.css("top",-e.overflow+"px"),c.css("top",SCROLLTRACKHEIGHT+"px")):(f.css("top","0px"),c.css("top","0px"));a.preventDefault()});return{sizechange:function(){var a=d();0<a.overflow?(f.css("top",-a.overflow*a.handlePct+"px"),c.show(),e.show()):(f.css("top","0px"),c.css("top","0px"),
c.hide(),e.hide())}}};
var AJAX="/AjaxServices.asmx/",MAXVAL=999999999,DEFAULTANIMATIONSPEED=100,msgPopup,regScroll,comScroll,ciuScroll,globales={radios:".radio",checkboxes:".checkbox",contenido:".contenido",body:"body",areas:"area",carrito:".carrito",articulosCesta:".articulosCesta",imgCarritoFlecha:"img.imgCarritoFlecha",frmBuscar:"#frmBuscar",hidPrecioMin:"#hidPrecioMin",hidPrecioMax:"#hidPrecioMax",hidLocalidades:"#hidLocalidades",hidTematicas:"#hidTematicas",hidPanel:"#hidPanel",buscar:"#buscar",listado:".listadoComunidad ul li",
listadoCiudades:".listadoCiudades ul li",comunidades:".listadoComunidad",scrollhandleComunidad:"#scrollhandleComunidad",scrollComunidad:"#scrollComunidad",listadoContenedor:".listadoElementosMapa",precios:".itemCajaPrecios",divZona:"div.mapaZona",menuPrecios:"#menuPrecios",menuActividad:"#menuActividad",menuZona:"#menuZona",comprarCajaLink:"a[cajaID]",carritoItemTemplate:"#carritoItemTemplate",carritoItems:"#carritoItems",totalArticulos:"#totalArticulos",totalPrecioArticulos:"#totalPrecioArticulos",
totalPrecioCarrito:"#totalPrecioCarrito",carritoPago:".btnPagarCarrito",carritoHeader:".carritoHeader",puMessage:"#puMessage",puCloseMessage:"#puCloseMessage",txtMessage:"#txtMessage",imgTipoError:"#imgTipoError",txtTituloMessage:"#txtTituloMessage",lnkEspana:"#lnkEspana",lnkEuropa:"#lnkEuropa",mapaEspana:".mapaEspana",mapaEuropa:".mapaEuropa",scrollRegion:"#scrollRegion",scrollhandleRegion:"#scrollhandleRegion",listadoRegionesContenedor:".listadoElementosEuropa",scrollCiudad:"#scrollCiudad",scrollhandleCiudad:"#scrollhandleCiudad",
listadoCiudadesContenedor:".listadoCiudadesEuropa",regionPaises:".despRegiones li li",hidMapa:"#hidMapa",delCarritoItem:".delCarritoItem"},tipoError={aviso:"aviso",error:"error",errorGrave:"errorGrave"},direcciones={izquierda:"izq",derecha:"der"};
function loaded(){globales.radios.dgStyle();globales.checkboxes.dgStyle();globales.areas.click(onZonaClicked);globales.areas.noLink();globales.regionPaises.click(onZonaClicked);globales.buscar.click(buscar);globales.buscar.noLink();globales.listado.click(onLocalidadClicked);globales.listadoCiudades.click(onLocalidadClicked);globales.menuActividad.click(onMenuActividadClicked);globales.menuPrecios.click(onMenuPrecioClicked);globales.menuZona.click(onMenuZonaClicked);comScroll=$.initScroll({handle:globales.scrollhandleComunidad,
track:globales.scrollComunidad,container:globales.listadoContenedor});regScroll=$.initScroll({handle:globales.scrollhandleRegion,track:globales.scrollRegion,container:globales.listadoRegionesContenedor});ciuScroll=$.initScroll({handle:globales.scrollhandleCiudad,track:globales.scrollCiudad,container:globales.listadoCiudadesContenedor});globales.imgCarritoFlecha.click(onCarritoFlechaClicked);globales.carritoPago.click(onCarritoClicked);globales.carritoHeader.click(onCarritoClicked);globales.lnkEspana.noLink();
globales.lnkEspana.click(onLnkEspanaClicked);globales.lnkEuropa.noLink();globales.lnkEuropa.click(onLnkEuropaClicked);globales.delCarritoItem.noPropagation();globales.delCarritoItem.click(onEliminarCarritoItemClicked);msgPopup=$.registerPopUp({popup:globales.puMessage,closeElement:globales.puCloseMessage,autoCenter:!0,noBackground:!0,onClosePopup:onMessagePopupClose});$(document).click(onDocumentClicked);onResize.delay(100);$(window).bind("resize",onResize);fixPng();fixIEArea();restorarBuscador();
comScroll.sizechange();ciuScroll.sizechange();"eur"==globales.hidMapa.val()&&(onLnkEuropaClicked(),globales.mapaEspana.hide(),globales.mapaEuropa.show())}function onResize(){globales.body.css({backgroundPosition:globales.contenido.offset().left})}
function fixPng(){for(var a in document.images)if(document.images[a].src){var b=document.images[a].src;if(!$(document.images[a]).attr("noFilter")&&(".png"===b.substr(b.length-4)||".PNG"===b.substr(b.length-4)))document.images[a].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='crop',src='"+b+"')"}}function fixIEArea(){$.browser.msie&&globales.areas.focus(function(){this.blur&&this.blur()})}
function onDocumentClicked(){globales.articulosCesta.hide(400)}function habilitaFlecha(a,b){b.attr("src","img/flecha-rosa-"+a+".png")}function deshabilitaFlecha(a,b){b.attr("src","img/flecha-rosa-off-"+a+".png")}function buscar(){if(0==get_Tematicas().length&&0==get_Localidades().length&&0>=get_PrecioMinimo()&&get_PrecioMaximo()>=MAXVAL){var a=getLiteral(15);showPopup(getLiteral(12),a,tipoError.aviso)}else globales.frmBuscar.submit()}
function get_PrecioMinimo(){return parseInt(globales.hidPrecioMin.val())}function set_PrecioMinimo(a){globales.hidPrecioMin.val(a)}function get_PrecioMaximo(){return parseInt(globales.hidPrecioMax.val())}function set_PrecioMaximo(a){globales.hidPrecioMax.val(a)}function get_Localidades(){var a=globales.hidLocalidades.val(),a=""==a?[]:a.split(";");a.remove("");return a}function set_Localidades(a){globales.hidLocalidades.val(a.join(";"))}
function add_Localidad(a){if(""!=a){var b=get_Localidades();b.push($.trim(a));set_Localidades(b)}}function remove_Localidad(a){var b=get_Localidades();b.remove($.trim(a));set_Localidades(b)}function get_Tematicas(){var a=globales.hidTematicas.val();return""==a?[]:a.split(";")}function set_Tematicas(a){globales.hidTematicas.val(a.join(";"));"function"==typeof onTematicasChanged&&onTematicasChanged(a)}
function add_Tematica(a){var b=get_Tematicas();-1==b.indexOf(a.toString())&&(b.push(a),set_Tematicas(b))}function remove_Tematica(a){var b=get_Tematicas();b.remove(a);set_Tematicas(b)}
function onLnkEuropaClicked(){$(globales.lnkEspana.children()[0]).removeClass("blanco");$(globales.lnkEspana.children()[0]).addClass("gris");$(globales.lnkEuropa.children()[0]).removeClass("gris");$(globales.lnkEuropa.children()[0]).addClass("blanco");globales.mapaEspana.fadeOut(DEFAULTANIMATIONSPEED,function(){globales.mapaEuropa.show()});globales.hidMapa.val("eur")}
function onLnkEspanaClicked(){$(globales.lnkEspana.children()[0]).removeClass("gris");$(globales.lnkEspana.children()[0]).addClass("blanco");$(globales.lnkEuropa.children()[0]).removeClass("blanco");$(globales.lnkEuropa.children()[0]).addClass("gris");globales.mapaEuropa.fadeOut(DEFAULTANIMATIONSPEED,function(){globales.mapaEspana.show()});globales.hidMapa.val("es")}
function onZonaClicked(a){var b=$(this),d=b.attr("rel"),c=b.attr("prefix"),e=$("li[rel="+c+"_"+d+"]"),d=$("#"+c+"_"+d);!0===a?(mostrarOcultarLocalidades(e,!1,!0),d.css("display","none"),b.desel()):("c"==c?(mostrarOcultarLocalidades(e,"block"!=d.css("display")),d.fadeToggle(DEFAULTANIMATIONSPEED,"linear",comScroll.sizechange)):"pais"==c&&(b.toggleSel(),mostrarOcultarLocalidades(e,b.isSel(),!0),ciuScroll.sizechange()),"function"==typeof onLocalidadesChanged&&onLocalidadesChanged())}
function mostrarOcultarLocalidades(a,b,d){if(b){a.fadeIn(DEFAULTANIMATIONSPEED,"linear");b=$(a.children()[1]).children();seleccionarLocalidad(b[0],!0);for(a=1;a<b.length;a++)seleccionarLocalidad(b[a],!1)}else{d?a.css("display","none"):a.fadeOut(DEFAULTANIMATIONSPEED,"linear");b=$(a.children()[1]).children();for(a=0;a<b.length;a++)deseleccionarLocalidad(b[a])}}
function onLocalidadClicked(a,b){var d=$(this),c=!d.isSel(),e=d.hasClass("todas");if(e&&c){d.sel();c=d.siblings();for(e=0;e<c.length;e++)seleccionarLocalidad(c[e],!1)}else if(e&&!c){d.desel();c=d.siblings();for(e=0;e<c.length;e++)deseleccionarLocalidad(c[e])}else if(!e&&c){var f=$($(d.parent()[0]).children()[0]);if(f.isSel()){c=f.siblings();for(e=0;e<c.length;e++)deseleccionarLocalidad(c[e]);f.desel()}seleccionarLocalidad(d,!0)}else!e&&!c&&deseleccionarLocalidad(d);"function"==typeof onLocalidadesChanged&&
!b&&onLocalidadesChanged()}function seleccionarLocalidad(a,b){a=$(a);b?a.sel():a.desel();var d=get_Localidades(),c=a.text();-1==d.indexOf(c)&&!a.hasClass("todas")&&add_Localidad(c)}function deseleccionarLocalidad(a){a=$(a);a.desel();remove_Localidad(a.text())}function onCarritoFlechaClicked(a){globales.articulosCesta.toggle(400);a.stopPropagation()}
function actualizarCarrito(a){globales.carritoItems.html("");globales.carritoItemTemplate.tmpl(a.Productos).appendTo(globales.carritoItems);globales.totalArticulos.text(a.TotalItems);globales.totalPrecioArticulos.text(a.TotalPrecioProductos);globales.totalPrecioCarrito.text(a.TotalPrecioProductos);0==a.TotalItems?globales.imgCarritoFlecha.hide():globales.imgCarritoFlecha.show();globales.delCarritoItem.unbind("click",onEliminarCarritoItemClicked);globales.delCarritoItem=$(".delCarritoItem");globales.delCarritoItem.noPropagation();
globales.delCarritoItem.click(onEliminarCarritoItemClicked);"function"==typeof actualizarCarritoPagina&&actualizarCarritoPagina(a)}function onEliminarCarritoItemClicked(){var a=$(this);$($($(a.parent()).parent()).parent()).remove();a=obtenerEliminarProductoData($(this).attr("identificador"));$.getJson(ELIMINARCARRITOITEM,a,actualizarCarrito);"function"==typeof EliminarLinea&&EliminarLinea($(this).attr("identificador"))}
function onGlobalError(a,b,d,c,e){a&&a(b);if($.browser.webkit){console.groupCollapsed("ERROR occured: "+d);for(a=0;a<b.length;a++)console.info(b[a]);console.trace();console.groupEnd()}c&&showPopup(d,c,e)}
function showPopup(a,b,d){if(b instanceof Array){for(var c="",e=0;e<b.length;e++)c+=b[e]+"<br />";b=c}d==tipoError.aviso?globales.imgTipoError.attr("src","/img/ico-pop-aviso.png"):d==tipoError.error?globales.imgTipoError.attr("src","/img/ico-pop-error.png"):d==tipoError.errorGrave?globales.imgTipoError.attr("src","/img/ico-pop-errorgrave.png"):globales.imgTipoError.attr("src","/");globales.txtMessage.html(b);globales.txtTituloMessage.text(a);msgPopup.open()}
function onMessagePopupClose(){globales.txtMessage.text("")};

