var Shadowbox=function(){var ua=navigator.userAgent.toLowerCase(),S={version:"3.0b",adapter:null,current:-1,gallery:[],cache:[],content:null,dimensions:null,plugins:null,path:"",options:{adapter:null,animate:true,animateFade:true,autoplayMovies:true,autoDimensions:false,continuous:false,counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,ease:function(x){return 1+Math.pow(x-1,3)},enableKeys:true,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"],iframe:["asp","aspx","cgi","cfm","htm","html","jsp","pl","php","php3","php4","php5","phtml","rb","rhtml","shtml","txt","vbs"]},fadeDuration:0.35,flashParams:{bgcolor:"#000000",allowFullScreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",initialHeight:160,initialWidth:320,language:"en",modal:false,onChange:null,onClose:null,onFinish:null,onOpen:null,overlayColor:"#000",overlayOpacity:0.8,players:["img"],resizeDuration:0.35,showOverlay:true,showMovieControls:true,skipSetup:false,slideshowDelay:0,useSizzle:true,viewportPadding:20},client:{isIE:ua.indexOf("msie")>-1,isIE6:ua.indexOf("msie 6")>-1,isIE7:ua.indexOf("msie 7")>-1,isGecko:ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1,isWebkit:ua.indexOf("applewebkit/")>-1,isWindows:ua.indexOf("windows")>-1||ua.indexOf("win32")>-1,isMac:ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1,isLinux:ua.indexOf("linux")>-1},regex:{domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/},libraries:{Prototype:"prototype",jQuery:"jquery",MooTools:"mootools",YAHOO:"yui",dojo:"dojo",Ext:"ext"},applyOptions:function(opts){if(opts){default_options=apply({},S.options);apply(S.options,opts)}},buildCacheObj:function(link,opts){var href=link.href,obj={el:link,title:link.getAttribute("title"),options:apply({},opts||{}),content:href};each(["player","title","height","width","gallery"],function(o){if(typeof obj.options[o]!="undefined"){obj[o]=obj.options[o];delete obj.options[o]}});if(!obj.player){obj.player=getPlayer(href)}var rel=link.getAttribute("rel");if(rel){var m=rel.match(S.regex.gallery);if(m){obj.gallery=escape(m[2])}each(rel.split(";"),function(p){m=p.match(S.regex.param);if(m){if(m[1]=="options"){eval("apply(obj.options,"+m[2]+")")}else{obj[m[1]]=m[2]}}})}return obj},change:function(n){if(!S.gallery){return}if(!S.gallery[n]){if(!S.options.continuous){return}else{n=n<0?S.gallery.length-1:0}}S.current=n;if(typeof slide_timer=="number"){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}if(S.options.onChange){S.options.onChange()}loadContent()},clearCache:function(){each(S.cache,function(obj){if(obj.el){S.lib.removeEvent(obj.el,"click",handleClick)}});S.cache=[]},close:function(){if(!active){return}active=false;listenKeys(false);if(S.content){S.content.remove();S.content=null}if(typeof slide_timer=="number"){clearTimeout(slide_timer)}slide_timer=null;slide_delay=0;if(S.options.onClose){S.options.onClose()}S.skin.onClose();S.revertOptions();each(v_cache,function(c){c[0].style.visibility=c[1]})},contentId:function(){return content_id},getCounter:function(){var len=S.gallery.length;if(S.options.counterType=="skip"){var c=[],i=0,end=len,limit=parseInt(S.options.counterLimit)||0;if(limit<len&&limit>2){var h=Math.floor(limit/2);i=S.current-h;if(i<0){i+=len}end=S.current+(limit-h);if(end>len){end-=len}}while(i!=end){if(i==len){i=0}c.push(i++)}}else{var c=(S.current+1)+" "+S.lang.of+" "+len}return c},getCurrent:function(){return S.current>-1?S.gallery[S.current]:null},hasNext:function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)},init:function(opts){if(initialized){return}initialized=true;opts=opts||{};init_options=opts;if(opts){apply(S.options,opts)}for(var e in S.options.ext){S.regex[e]=new RegExp(".("+S.options.ext[e].join("|")+")s*$","i")}if(!S.path){var path_re=/(.+)shadowbox\.js/i,path;each(document.getElementsByTagName("script"),function(s){if((path=path_re.exec(s.src))!=null){S.path=path[1];return false}})}if(S.options.adapter){S.adapter=S.options.adapter}else{for(var lib in S.libraries){if(typeof window[lib]!="undefined"){S.adapter=S.libraries[lib];break}}if(!S.adapter){S.adapter="base"}}if(S.options.useSizzle&&!window.Sizzle){U.include(S.path+"libraries/sizzle/sizzle.js")}if(!S.lang){U.include(S.path+"languages/shadowbox-"+S.options.language+".js")}each(S.options.players,function(p){if((p=="swf"||p=="flv")&&!window.swfobject){U.include(S.path+"libraries/swfobject/swfobject.js")}if(!S[p]){U.include(S.path+"players/shadowbox-"+p+".js")}});if(!S.lib){U.include(S.path+"adapters/shadowbox-"+S.adapter+".js")}},isActive:function(){return active},isPaused:function(){return slide_timer=="paused"},load:function(){if(S.skin.options){apply(S.options,S.skin.options);apply(S.options,init_options)}var markup=S.skin.markup.replace(/\{(\w+)\}/g,function(m,p){return S.lang[p]});S.lib.append(document.body,markup);if(S.skin.init){S.skin.init()}var id;S.lib.addEvent(window,"resize",function(){if(id){clearTimeout(id);id=null}if(active){id=setTimeout(function(){if(S.skin.onWindowResize){S.skin.onWindowResize()}var c=S.content;if(c&&c.onWindowResize){c.onWindowResize()}},50)}});if(!S.options.skipSetup){S.setup()}},next:function(){S.change(S.current+1)},open:function(obj){if(U.isLink(obj)){obj=S.buildCacheObj(obj)}if(obj.constructor==Array){S.gallery=obj;S.current=0}else{if(!obj.gallery){S.gallery=[obj];S.current=0}else{S.current=null;S.gallery=[];each(S.cache,function(c){if(c.gallery&&c.gallery==obj.gallery){if(S.current==null&&c.content==obj.content&&c.title==obj.title){S.current=S.gallery.length}S.gallery.push(c)}});if(S.current==null){S.gallery.unshift(obj);S.current=0}}}obj=S.getCurrent();if(obj.options){S.revertOptions();S.applyOptions(obj.options)}var g,r,m,s,a,oe=S.options.errors,msg,el;for(var i=0;i<S.gallery.length;++i){g=S.gallery[i]=apply({},S.gallery[i]);r=false;if(g.player=="unsupported"){r=true}else{if(m=S.regex.unsupported.exec(g.player)){if(S.options.handleUnsupported=="link"){g.player="html";switch(m[1]){case"qtwmp":s="either";a=[oe.qt.url,oe.qt.name,oe.wmp.url,oe.wmp.name];break;case"qtf4m":s="shared";a=[oe.qt.url,oe.qt.name,oe.f4m.url,oe.f4m.name];break;default:s="single";if(m[1]=="swf"||m[1]=="flv"){m[1]="fla"}a=[oe[m[1]].url,oe[m[1]].name]}msg=S.lang.errors[s].replace(/\{(\d+)\}/g,function(m,n){return a[n]});g.content='<div class="sb-message">'+msg+"</div>"}else{r=true}}else{if(g.player=="inline"){m=S.regex.inline.exec(g.content);if(m){var el=U.get(m[1]);if(el){g.content=el.innerHTML}else{throw"Cannot find element with id "+m[1]}}else{throw"Cannot find element id for inline content"}}else{if(g.player=="swf"||g.player=="flv"){var version=(g.options&&g.options.flashVersion)||S.options.flashVersion;if(!swfobject.hasFlashPlayerVersion(version)){g.width=310;g.height=177}}}}}if(r){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}if(S.gallery.length){if(!active){if(typeof S.options.onOpen=="function"&&S.options.onOpen(obj)===false){return}v_cache=[];each(["select","object","embed","canvas"],function(tag){each(document.getElementsByTagName(tag),function(el){v_cache.push([el,el.style.visibility||"visible"]);el.style.visibility="hidden"})});var h=S.options.autoDimensions&&"height" in obj?obj.height:S.options.initialHeight;var w=S.options.autoDimensions&&"width" in obj?obj.width:S.options.initialWidth;S.skin.onOpen(h,w,loadContent)}else{loadContent()}active=true}},pause:function(){if(typeof slide_timer!="number"){return}var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer="paused";if(S.skin.onPause){S.skin.onPause()}}},play:function(){if(!S.hasNext()){return}if(!slide_delay){slide_delay=S.options.slideshowDelay*1000}if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;S.next()},slide_delay);if(S.skin.onPlay){S.skin.onPlay()}}},previous:function(){S.change(S.current-1)},revertOptions:function(){apply(S.options,default_options)},setDimensions:function(height,width,max_h,max_w,tb,lr,resizable){var h=height=parseInt(height),w=width=parseInt(width),pad=parseInt(S.options.viewportPadding)||0;var extra_h=2*pad+tb;if(h+extra_h>=max_h){h=max_h-extra_h}var extra_w=2*pad+lr;if(w+extra_w>=max_w){w=max_w-extra_w}var resize_h=height,resize_w=width,change_h=(height-h)/height,change_w=(width-w)/width,oversized=(change_h>0||change_w>0);if(resizable&&oversized&&S.options.handleOversize=="resize"){if(change_h>change_w){w=Math.round((width/height)*h)}else{if(change_w>change_h){h=Math.round((height/width)*w)}}resize_w=w;resize_h=h}S.dimensions={height:h+tb,width:w+lr,inner_h:h,inner_w:w,top:(max_h-(h+extra_h))/2+pad,left:(max_w-(w+extra_w))/2+pad,oversized:oversized,resize_h:resize_h,resize_w:resize_w};return S.dimensions},setup:function(links,opts){if(!links){var links=[],rel;each(document.getElementsByTagName("a"),function(a){rel=a.getAttribute("rel");if(rel&&S.regex.rel.test(rel)){links.push(a)}})}else{var len=links.length;if(len){if(window.Sizzle){if(typeof links=="string"){links=Sizzle(links)}else{if(len==2&&links.push&&typeof links[0]=="string"&&links[1].nodeType){links=Sizzle(links[0],links[1])}}}}else{links=[links]}}each(links,function(link){if(typeof link.shadowboxCacheKey=="undefined"){link.shadowboxCacheKey=S.cache.length;S.lib.addEvent(link,"click",handleClick)}S.cache[link.shadowboxCacheKey]=S.buildCacheObj(link,opts)})}},U=S.util={animate:function(el,p,to,d,cb){var from=parseFloat(S.lib.getStyle(el,p));if(isNaN(from)){from=0}var delta=to-from;if(delta==0){if(cb){cb()}return}var op=p=="opacity";function fn(ease){var to=from+ease*delta;if(op){U.setOpacity(el,to)}else{el.style[p]=to+"px"}}if(!d||(!op&&!S.options.animate)||(op&&!S.options.animateFade)){fn(1);if(cb){cb()}return}d*=1000;var begin=new Date().getTime(),end=begin+d,time,timer=setInterval(function(){time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(cb){cb()}}else{fn(S.options.ease((time-begin)/d))}},10)},apply:function(o,e){for(var p in e){o[p]=e[p]}return o},clearOpacity:function(el){var s=el.style;if(window.ActiveXObject){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity=""}},each:function(obj,fn,scope){for(var i=0,len=obj.length;i<len;++i){if(fn.call(scope||obj[i],obj[i],i,obj)===false){return}}},get:function(id){return document.getElementById(id)},include:function(){var includes={};return function(file){if(includes[file]){return}includes[file]=true;document.write('<script type="text/javascript" src="'+file+'"><\/script>')}}(),isLink:function(obj){if(!obj||!obj.tagName){return false}var up=obj.tagName.toUpperCase();return up=="A"||up=="AREA"},removeChildren:function(el){while(el.firstChild){el.removeChild(el.firstChild)}},setOpacity:function(el,o){var s=el.style;if(window.ActiveXObject){s.zoom=1;s.filter=(s.filter||"").replace(/\s*alpha\([^\)]*\)/gi,"")+(o==1?"":" alpha(opacity="+(o*100)+")")}else{s.opacity=o}}},apply=U.apply,each=U.each,init_options,initialized=false,default_options={},content_id="sb-content",active=false,slide_timer,slide_start,slide_delay=0,v_cache=[];if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(p){names.push(p.name)});names=names.join();var detectPlugin=function(n){return names.indexOf(n)>-1};var f4m=detectPlugin("Flip4Mac");S.plugins={fla:detectPlugin("Shockwave Flash"),qt:detectPlugin("QuickTime"),wmp:!f4m&&detectPlugin("Windows Media"),f4m:f4m}}else{function detectPlugin(n){try{var axo=new ActiveXObject(n)}catch(e){}return !!axo}S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}function getPlayer(url){var re=S.regex,p=S.plugins,m=url.match(re.domain),d=m&&document.domain==m[1];if(url.indexOf("#")>-1&&d){return"inline"}var q=url.indexOf("?");if(q>-1){url=url.substring(0,q)}if(re.img.test(url)){return"img"}if(re.swf.test(url)){return p.fla?"swf":"unsupported-swf"}if(re.flv.test(url)){return p.fla?"flv":"unsupported-flv"}if(re.qt.test(url)){return p.qt?"qt":"unsupported-qt"}if(re.wmp.test(url)){if(p.wmp){return"wmp"}if(p.f4m){return"qt"}if(S.client.isMac){return p.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}if(re.qtwmp.test(url)){if(p.qt){return"qt"}if(p.wmp){return"wmp"}return S.client.isMac?"unsupported-qt":"unsupported-qtwmp"}if(!d||re.iframe.test(url)){return"iframe"}return"unsupported"}function handleClick(e){var link;if(U.isLink(this)){link=this}else{link=S.lib.getTarget(e);while(!U.isLink(link)&&link.parentNode){link=link.parentNode}}if(link){var key=link.shadowboxCacheKey;if(typeof key!="undefined"&&typeof S.cache[key]!="undefined"){link=S.cache[key]}S.open(link);if(S.gallery.length){S.lib.preventDefault(e)}}}function listenKeys(on){if(!S.options.enableKeys){return}S.lib[(on?"add":"remove")+"Event"](document,"keydown",handleKey)}function handleKey(e){var code=S.lib.keyCode(e);S.lib.preventDefault(e);switch(code){case 81:case 88:case 27:S.close();break;case 37:S.previous();break;case 39:S.next();break;case 32:S[(typeof slide_timer=="number"?"pause":"play")]()}}function loadContent(){var obj=S.getCurrent();if(!obj){return}var p=obj.player=="inline"?"html":obj.player;if(typeof S[p]!="function"){throw"Unknown player: "+p}var change=false;if(S.content){S.content.remove();change=true;S.revertOptions();if(obj.options){S.applyOptions(obj.options)}}U.removeChildren(S.skin.bodyEl());S.content=new S[p](obj);listenKeys(false);S.skin.onLoad(S.content,change,function(){if(!S.content){return}if(typeof S.content.ready!="undefined"){var id=setInterval(function(){if(S.content){if(S.content.ready){clearInterval(id);id=null;S.skin.onReady(contentReady)}}else{clearInterval(id);id=null}},100)}else{S.skin.onReady(contentReady)}});if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}}function contentReady(){if(!S.content){return}S.content.append(S.skin.bodyEl(),content_id,S.dimensions);S.skin.onFinish(finishContent)}function finishContent(){if(!S.content){return}if(S.content.onLoad){S.content.onLoad()}if(S.options.onFinish){S.options.onFinish()}if(!S.isPaused()){S.play()}listenKeys(true)}return S}();Shadowbox.skin=function(){var e=Shadowbox,d=e.util,o=false,k=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"];function l(){d.get("sb-container").style.top=document.documentElement.scrollTop+"px"}function g(p){var q=d.get("sb-overlay"),r=d.get("sb-container"),t=d.get("sb-wrapper");if(p){if(e.client.isIE6){l();e.lib.addEvent(window,"scroll",l)}if(e.options.showOverlay){o=true;q.style.backgroundColor=e.options.overlayColor;d.setOpacity(q,0);if(!e.options.modal){e.lib.addEvent(q,"click",e.close)}t.style.display="none"}r.style.visibility="visible";if(o){var s=parseFloat(e.options.overlayOpacity);d.animate(q,"opacity",s,e.options.fadeDuration,p)}else{p()}}else{if(e.client.isIE6){e.lib.removeEvent(window,"scroll",l)}e.lib.removeEvent(q,"click",e.close);if(o){t.style.display="none";d.animate(q,"opacity",0,e.options.fadeDuration,function(){r.style.display="";t.style.display="";d.clearOpacity(q)})}else{r.style.visibility="hidden"}}}function b(r,p){var q=d.get("sb-nav-"+r);if(q){q.style.display=p?"":"none"}}function i(r,q){var t=d.get("sb-loading"),v=e.getCurrent().player,u=(v=="img"||v=="html");if(r){function s(){d.clearOpacity(t);if(q){q()}}d.setOpacity(t,0);t.style.display="";if(u){d.animate(t,"opacity",1,e.options.fadeDuration,s)}else{s()}}else{function s(){t.style.display="none";d.clearOpacity(t);if(q){q()}}if(u){d.animate(t,"opacity",0,e.options.fadeDuration,s)}else{s()}}}function a(s){var u=e.getCurrent();d.get("sb-title-inner").innerHTML=u.title||"";var x,r,t,y,q;if(e.options.displayNav){x=true;var w=e.gallery.length;if(w>1){if(e.options.continuous){r=q=true}else{r=(w-1)>e.current;q=e.current>0}}if(e.options.slideshowDelay>0&&e.hasNext()){y=!e.isPaused();t=!y}}else{x=r=t=y=q=false}b("close",x);b("next",r);b("play",t);b("pause",y);b("previous",q);var x="";if(e.options.displayCounter&&e.gallery.length>1){var v=e.getCounter();if(typeof v=="string"){x=v}else{d.each(v,function(p){x+='<a onclick="Shadowbox.change('+p+');"';if(p==e.current){x+=' class="sb-counter-current"'}x+=">"+(p+1)+"</a>"})}}d.get("sb-counter").innerHTML=x;s()}function h(r,q){var w=d.get("sb-wrapper"),z=d.get("sb-title"),s=d.get("sb-info"),p=d.get("sb-title-inner"),x=d.get("sb-info-inner"),y=parseInt(e.lib.getStyle(p,"height"))||0,v=parseInt(e.lib.getStyle(x,"height"))||0;function u(){p.style.visibility=x.style.visibility="hidden";a(q)}if(r){d.animate(z,"height",0,0.35);d.animate(s,"height",0,0.35);d.animate(w,"paddingTop",y,0.35);d.animate(w,"paddingBottom",v,0.35,u)}else{z.style.height=s.style.height="0px";w.style.paddingTop=y+"px";w.style.paddingBottom=v+"px";u()}}function j(r){var q=d.get("sb-wrapper"),u=d.get("sb-title"),s=d.get("sb-info"),x=d.get("sb-title-inner"),w=d.get("sb-info-inner"),v=parseInt(e.lib.getStyle(x,"height"))||0,p=parseInt(e.lib.getStyle(w,"height"))||0;x.style.visibility=w.style.visibility="";if(x.innerHTML!=""){d.animate(u,"height",v,0.35);d.animate(q,"paddingTop",0,0.35)}d.animate(s,"height",p,0.35);d.animate(q,"paddingBottom",0,0.35,r)}function c(q,x,w,p){var y=d.get("sb-body"),v=d.get("sb-wrapper"),u=parseInt(q),r=parseInt(x);if(w){d.animate(y,"height",u,e.options.resizeDuration);d.animate(v,"top",r,e.options.resizeDuration,p)}else{y.style.height=u+"px";v.style.top=r+"px";if(p){p()}}}function f(u,x,v,p){var t=d.get("sb-wrapper"),r=parseInt(u),q=parseInt(x);if(v){d.animate(t,"width",r,e.options.resizeDuration);d.animate(t,"left",q,e.options.resizeDuration,p)}else{t.style.width=r+"px";t.style.left=q+"px";if(p){p()}}}function n(p){var r=e.content;if(!r){return}var q=m(r.height,r.width,r.resizable);switch(e.options.animSequence){case"hw":c(q.inner_h,q.top,true,function(){f(q.width,q.left,true,p)});break;case"wh":f(q.width,q.left,true,function(){c(q.inner_h,q.top,true,p)});break;default:f(q.width,q.left,true);c(q.inner_h,q.top,true,p)}}function m(p,s,r){var q=d.get("sb-body-inner");sw=d.get("sb-wrapper"),so=d.get("sb-overlay"),tb=sw.offsetHeight-q.offsetHeight,lr=sw.offsetWidth-q.offsetWidth,max_h=so.offsetHeight,max_w=so.offsetWidth;return e.setDimensions(p,s,max_h,max_w,tb,lr,r)}return{markup:'<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><a onclick="Shadowbox.close()">{cancel}</a></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div><div style="clear:both"></div></div></div></div></div>',options:{animSequence:"sync"},init:function(){if(e.client.isIE6){d.get("sb-body").style.zoom=1;var r,p,q=/url\("(.*\.png)"\)/;d.each(k,function(s){r=d.get(s);if(r){p=e.lib.getStyle(r,"backgroundImage").match(q);if(p){r.style.backgroundImage="none";r.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+p[1]+",sizingMethod=scale);"}}})}},bodyEl:function(){return d.get("sb-body-inner")},onOpen:function(r,q,p){d.get("sb-container").style.display="block";var s=m(r,q);c(s.inner_h,s.top,false);f(s.width,s.left,false);g(p)},onLoad:function(q,r,p){i(true);h(r,function(){if(!q){return}if(!r){d.get("sb-wrapper").style.display=""}p()})},onReady:function(p){n(function(){j(p)})},onFinish:function(p){i(false,p)},onClose:function(){g(false)},onPlay:function(){b("play",false);b("pause",true)},onPause:function(){b("pause",false);b("play",true)},onWindowResize:function(){var r=e.content;if(!r){return}var q=m(r.height,r.width,r.resizable);f(q.width,q.left,false);c(q.inner_h,q.top,false);var p=d.get(e.contentId());if(p){if(r.resizable&&e.options.handleOversize=="resize"){p.height=q.resize_h;p.width=q.resize_w}}}}}();
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.selectNode(t);s.collapse(true);e.selectNode(r);e.collapse(true);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.Sizzle=b})();
if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"es",of:"de",loading:"cargando",cancel:"Cancelar",next:"Siguiente",previous:"Anterior",play:"Reproducir",pause:"Pausa",close:"Cerrar",errors:{single:'Debes instalar el plugin <a href="{0}">{1}</a> en el navegador para ver este contenido.',shared:'Debes instalar el <a href="{0}">{1}</a> y el <a href="{2}">{3}</a> en el navegador para ver este contenido.',either:'Debes instalar o bien el <a href="{0}">{1}</a> o el <a href="{2}">{3}</a> en el navegador para ver este contenido.'}};
(function(h){var e=h.util,i,k,j="sb-drag-layer",d;function b(){i={x:0,y:0,start_x:null,start_y:null}}function c(m,o,l){if(m){b();var n=["position:absolute","height:"+o+"px","width:"+l+"px","cursor:"+(h.client.isGecko?"-moz-grab":"move"),"background-color:"+(h.client.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");h.lib.append(h.skin.bodyEl(),'<div id="'+j+'" style="'+n+'"></div>');h.lib.addEvent(e.get(j),"mousedown",g)}else{var p=e.get(j);if(p){h.lib.removeEvent(p,"mousedown",g);h.lib.remove(p)}k=null}}function g(m){h.lib.preventDefault(m);var l=h.lib.getPageXY(m);i.start_x=l[0];i.start_y=l[1];k=e.get(h.contentId());h.lib.addEvent(document,"mousemove",f);h.lib.addEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grabbing"}}function a(){h.lib.removeEvent(document,"mousemove",f);h.lib.removeEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grab"}}function f(o){var q=h.content,p=h.dimensions,n=h.lib.getPageXY(o);var m=n[0]-i.start_x;i.start_x+=m;i.x=Math.max(Math.min(0,i.x+m),p.inner_w-q.width);k.style.left=i.x+"px";var l=n[1]-i.start_y;i.start_y+=l;i.y=Math.max(Math.min(0,i.y+l),p.inner_h-q.height);k.style.top=i.y+"px"}h.img=function(m){this.obj=m;this.resizable=true;this.ready=false;var l=this;d=new Image();d.onload=function(){l.height=m.height?parseInt(m.height,10):d.height;l.width=m.width?parseInt(m.width,10):d.width;l.ready=true;d.onload="";d=null};d.src=m.content};h.img.prototype={append:function(l,o,n){this.id=o;var m=document.createElement("img");m.id=o;m.src=this.obj.content;m.style.position="absolute";m.setAttribute("height",n.resize_h);m.setAttribute("width",n.resize_w);l.appendChild(m)},remove:function(){var l=e.get(this.id);if(l){h.lib.remove(l)}c(false);if(d){d.onload="";d=null}},onLoad:function(){var l=h.dimensions;if(l.oversized&&h.options.handleOversize=="drag"){c(true,l.resize_h,l.resize_w)}},onWindowResize:function(){if(k){var p=h.content,o=h.dimensions,n=parseInt(h.lib.getStyle(k,"top")),m=parseInt(h.lib.getStyle(k,"left"));if(n+p.height<o.inner_h){k.style.top=o.inner_h-p.height+"px"}if(m+p.width<o.inner_w){k.style.left=o.inner_w-p.width+"px"}}}}})(Shadowbox);
(function(a){a.html=function(b){this.obj=b;this.height=b.height?parseInt(b.height,10):300;this.width=b.width?parseInt(b.width,10):500};a.html.prototype={append:function(b,e,c){this.id=e;var d=document.createElement("div");d.id=e;d.className="html";d.innerHTML=this.obj.content;b.appendChild(d)},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b)}}}})(Shadowbox);
(function(a){a.iframe=function(c){this.obj=c;var b=document.getElementById("sb-overlay");this.height=c.height?parseInt(c.height,10):b.offsetHeight;this.width=c.width?parseInt(c.width,10):b.offsetWidth};a.iframe.prototype={append:function(b,e,d){this.id=e;var c='<iframe id="'+e+'" name="'+e+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto"';if(a.client.isIE){c+=' allowtransparency="true"';if(a.client.isIE6){c+=" src=\"javascript:false;document.write('');\""}}c+="></iframe>";b.innerHTML=c},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b);if(a.client.isGecko){delete window.frames[this.id]}}},onLoad:function(){var b=a.client.isIE?document.getElementById(this.id).contentWindow:window.frames[this.id];b.location.href=this.obj.content}}})(Shadowbox);
if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(a){return{getStyle:function(c,b){return a(c).css(b)},remove:function(b){a(b).remove()},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(d,b,c){a(d).bind(b,c)},removeEvent:function(d,b,c){a(d).unbind(b,c)},append:function(c,b){a(c).append(b)}}}(jQuery);jQuery(Shadowbox.load);(function(a){a.fn.shadowbox=function(b){return this.each(function(){var d=a(this);var e=a.extend({},b||{},a.metadata?d.metadata():a.meta?d.data():{});var c=this.className||"";e.width=parseInt((c.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((c.match(/h:(\d+)/)||[])[1])||e.height;Shadowbox.setup(d,e)})}})(jQuery);

function accentsTidy(a){var b=a.toLowerCase();b=b.replace(new RegExp("\\s","g"),"");b=b.replace(new RegExp("[àáâãäå]","g"),"a");b=b.replace(new RegExp("æ","g"),"ae");b=b.replace(new RegExp("ç","g"),"c");b=b.replace(new RegExp("[èéêë]","g"),"e");b=b.replace(new RegExp("[ìíîï]","g"),"i");b=b.replace(new RegExp("ñ","g"),"n");b=b.replace(new RegExp("[òóôõö]","g"),"o");b=b.replace(new RegExp("œ","g"),"oe");b=b.replace(new RegExp("[ùúûü]","g"),"u");b=b.replace(new RegExp("[ýÿ]","g"),"y");b=b.replace(new RegExp("\\W","g"),"");return b}function stripParenthesis(a){var b=a.indexOf("(");if(b>0){return a.substr(0,b-1)}else{return a}}function changeOficina(a,b){if(b==1){$("#oficina1").val(a);$("#oficina2").val("");loadSelectDropOff("ofi2_oficina");if($("#f-coche-recogida").val()!="dd-mm-aaaa"&&$("#f-coche-recogida").val()!=""){$("#f-coche-recogida").blur()}}else if(b==2){$("#oficina2").val(a);if($("#f-coche-entrega").val()!="dd-mm-aaaa"&&$("#f-coche-entrega").val()!=""){$("#f-coche-entrega").blur()}}}function loadHours(a,b,c,d){$.ajax({url:"organizar/ajax_horaslocation?id="+a+"&date="+b+"&op="+c+"&selected="+d,async:true,success:function(a){if(a!=""){var b="coche_hora_"+c;$("#"+b).html(a);$("#"+b).removeAttr("disabled");$("#coche_min_"+c).removeAttr("disabled")}}})}function loadSelectDropOff(a){$("#"+a).hide();$("#load_entrega").show();var b=$("#oficina2").val();var c=$("#oficina1").val();$.ajax({url:"organizar/ajax_entregalocation?id="+c,async:true,success:function(d){if(d!=""){var e=jsonParse(d);$("#"+a).html("");for(var f=0;f<e.length;f++){var g=e[f];var h=g["a"].split("@");if(b!=""&&h[1]==b||b==""&&h[1]==c){var i=" selected='selected' ";$("#oficina2").val(h[1])}else{var i=""}$("#"+a).append($("<option"+i+"></option>").val(h[1]).html(g["p"]))}}$("#load_entrega").hide();$("#"+a).show();$("#"+a).removeAttr("disabled")}})}function loadAutocompleteDropOff(){$("#ofi2_oficina").hide();$("#load_entrega").show();if($("#oficina2").val()==""){$("#ofi2_oficina").val($("#ofi1_oficina").val());$("#oficina2").val($("#oficina1").val())}$.ajax({url:"organizar/ajax_entregalocation?id="+$("#oficina1").val().split("@")[1],async:true,success:function(a){if(a!=""){var b=jsonParse(a);$("#ofi2_oficina").flushCache();$("#ofi2_oficina").autocomplete(b,{width:300,max:0,formatItem:function(a){return a.p}}).result(function(a,b){if(!b){$("#oficina2").val("")}else{$("#oficina2").val(b.a)}})}$("#load_entrega").hide();$("#ofi2_oficina").show();$("#ofi2_oficina").removeAttr("disabled")}})}function clearNeeds(){$("#info-comun > .parts > ul.checklist > li").each(function(){if($("input",this).attr("checked")){$("input",this).removeAttr("checked");$("input",this).click();$("input",this).removeAttr("checked")}})}function dondeAviso(){var a=$("#tipo_busqueda_guiada").attr("checked");var b=$("#g-destino").val();if(a&&b==""){$("#donde-aviso").show();clearNeeds();return false}else{$("#donde-aviso").hide();return true}}function needCoches(a){if(a.attr("checked")){if(!dondeAviso()){return false}else if($("#tipo_busqueda_guiada").attr("checked")&&$("#ofi1_oficina").html().length<=0){alert("Lo sentimos, pero no disponemos de coches de alquiler para el destino seleccionado.");a.removeAttr("checked");return false}a.parent().addClass("selected");$("#coches").show();$("#buscarprecios").show()}else{a.parent().removeClass("selected");$("#coches").slideUp();controlBuscarPrecios()}}function needHoteles(a){if(a.attr("checked")){if(!dondeAviso()){return false}a.parent().addClass("selected");$("#hoteles").show();$("#buscarprecios").show()}else{a.parent().removeClass("selected");$("#hoteles").slideUp();$("#f-tipohotel").val("");controlBuscarPrecios()}}function needVuelos(a){if(a.attr("checked")){if(!dondeAviso()){return false}a.parent().addClass("selected");$("#vuelos").show();$(".viajeros").removeClass("phase");$("#buscarprecios").show()}else{a.parent().removeClass("selected");$("#vuelos").slideUp();$(".viajeros").addClass("phase");controlBuscarPrecios()}}function controlBuscarPrecios(){var a=false;$(".checklist > li > input").each(function(){a=a||$(this).attr("checked")});if(!a){$("#buscarprecios").hide()}}function redirectLibre(){$("#tipo_busqueda_libre").click();$("#choice_v").click();needVuelos($("#choice_v"));$("#destinos-organizar").click();return false}function change2Libre(){$("#donde-aviso").hide();$("#donde-aviso > span").html("Debes decirnos a dónde quieres ir.");$(".origenydestino").hide();$("#lista_hoteles .raquo").show();$(".evform").show();$(".buvform").hide();$("#vuelos-libre > br.clear").show();$("#infovuelos").show();$(".helpguiada").hide();$("label[for=f-saliendo2] > span").text("Ciudad de salida");var a='<input id="f-saliendo2" name="org_departure" />';$("#f-saliendo2").replaceWith(a);$("#origenes-organizar").show();$("label[for=f-destino] > span").text("Ciudad de llegada");var a='<input id="f-destino" name="org_destination" />';$("#f-destino").replaceWith(a);$("#destinos-organizar").show();$("#f-destino").blur(function(){if($("#f-destinoAir").val()!=""){var a=$("#f-destinoAir").val().split("@")[0].split("_");$.ajax({url:"organizar/ajax_cityhotel?city="+a[1]+"&country="+a[2],success:function(b){if(b!=""){$("#ciudad_alojamiento1").val(a[1]+" ("+a[2]+")");$("#city_hotel1").val(b)}}})}});for(var b=1;b<5;b++){var a='<input id="ciudad_alojamiento'+b+'" name="ciudad_alojamiento'+b+'" />';$("#ciudad_alojamiento"+b).replaceWith(a)}$("#ciudad_alojamiento1").autocomplete(object_autocomplete_organizar_hoteles,{formatItem:function(a){if(!a){return false}else{return a.p}}}).result(function(a,b){if(!b){$("#city_hotel1").val("")}else{$("#city_hotel1").val(b.a)}});$("#ciudad_alojamiento2").autocomplete(object_autocomplete_organizar_hoteles,{formatItem:function(a){if(!a){return false}else{return a.p}}}).result(function(a,b){if(!b){$("#city_hotel2").val("")}else{$("#city_hotel2").val(b.a)}});$("#ciudad_alojamiento3").autocomplete(object_autocomplete_organizar_hoteles,{formatItem:function(a){if(!a){return false}else{return a.p}}}).result(function(a,b){if(!b){$("#city_hotel3").val("")}else{$("#city_hotel3").val(b.a)}});$("#ciudad_alojamiento4").autocomplete(object_autocomplete_organizar_hoteles,{formatItem:function(a){if(!a){return false}else{return a.p}}}).result(function(a,b){if(!b){$("#city_hotel4").val("")}else{$("#city_hotel4").val(b.a)}});var a='<input id="ofi1_oficina" name="ofi1_oficina" />';$("#ofi1_oficina").replaceWith(a);$("#ofi1_oficina").autocomplete(object_autocomplete_organizar_coches,{formatItem:function(a){return a.p}}).result(function(a,b){if(!b){$("#oficina1").val("")}else{$("#oficina1").val(b.a)}});var c='<input id="ofi2_oficina" name="ofi2_oficina" />';$("#ofi2_oficina").replaceWith(c);$("#ofi1_oficina").blur(function(){$("#ofi2_oficina").val($("#ofi1_oficina").val());$("#oficina2").val($("#oficina1").val());loadAutocompleteDropOff();if($("#f-coche-recogida").val()!="dd-mm-aaaa"&&$("#f-coche-recogida").val()!=""){$("#f-coche-recogida").blur()}});if($("#steps-libre").length>0){$("#steps-libre").show();$("#steps-guiada").hide()}}function selectAirport(a,b){var c=b.replace("@","_");$("#"+a).val(c)}function change2Guiada(){$(".origenydestino").show();$("#lista_hoteles .raquo").hide();$(".evform").hide();$(".buvform").show();$("#vuelos-libre > br.clear").hide();$(".helpguiada").show();clearNeeds();if($("#g-country").val()==""||$("#origen_libre").html()!=""&&$("#g-region").val()==""){$("#infovuelos").hide()}$("#g-destino").val("");$("label[for=f-saliendo2] > span").text("Aeropuerto de salida");var a='<select id="f-saliendo2" name="org_departure" '+"onchange=\"selectAirport('f-saliendoAir', this.value);\">"+'<option value="">(seleccionar)</option></select>';$("#f-saliendo2").replaceWith(a);$("#origenes-organizar").hide();if($("#g-region")&&$("#g-region").val()!=null&&$("#g-region").val()!=""){setAirportsIn("f-saliendo2",$("#g-region").val());$("#g-salida").val($("#g-region").val())}else{var b=$("#g-country").val();var c=b.indexOf("@");var d=b.substr(c+1);setAirportsIn("f-saliendo2",d);$("#g-salida").val(d)}$("label[for=f-destino] > span").text("Aeropuerto de llegada");var a='<select id="f-destino" name="org_destination" '+"onchange=\"selectAirport('f-destinoAir', this.value);$('#f-destino').blur();\">"+'<option value="">(seleccionar)</option></select>';$("#f-destino").replaceWith(a);$("#destinos-organizar").hide();$("#f-destino").blur(function(){if($("#f-destinoAir").val()!=""){var a=$("#f-destino > option[value="+$("#f-destino").val()+"]").text();var b=$("#g-destinoAir").val().split("@")[1];if(b=="country"){var c=a.indexOf("(");a=a.substring(0,c-1)}$("#ciudad_alojamiento1 > option").each(function(){if($(this).text()==a){$(this).attr("selected","selected");$(this).change();return 0}});a=a.substr(0,a.indexOf("(")-1);$("#ofi1_oficina > option").each(function(){var b=$(this).html();var c=b.indexOf("(");var d=b.indexOf("-",c);var e=b.substr(d+2);var f=e.substr(0,e.length-1);if(a==f){$(this).attr("selected","selected");$("#ofi2_oficina").val("");$("#oficina2").val("");$(this).change();return false}})}});for(var e=1;e<5;e++){var a='<select id="ciudad_alojamiento'+e+'" name="ciudad_alojamiento'+e+'" '+"onchange=\"$('#city_hotel"+e+"').val(this.value)\">"+'<option value="">(seleccionar)</option></select>';$("#ciudad_alojamiento"+e).replaceWith(a)}var a='<select id="ofi1_oficina" name="ofi1_oficina" '+'onchange="changeOficina(this.value, 1)" class="selectoficina">'+'<option value="">(seleccionar)</option></select>';$("#ofi1_oficina").replaceWith(a);var a='<select id="ofi2_oficina" name="ofi2_oficina" '+'onchange="changeOficina(this.value, 2)" disabled="disabled" class="selectoficina">'+'<option value="">(seleccionar)</option></select>';$("#ofi2_oficina").replaceWith(a);var f=false;if(f){$(".selectoficina").mouseenter(function(){$(this).data("origWidth",$(this).css("width")).css("width","auto")});$(".selectoficina").blur(function(){$(this).css("width","160px")})}if($("#steps-libre").length>0){$("#steps-libre").hide();$("#steps-guiada").show()}}function setCarsIn(a,b){var c=a.split("@");var d=c[0];var e=$('#f-destino > option[value="'+$("#f-destino").val()+'"]').text();if(c[1]=="country"){var f="organizar/ajax_fillLocationsByCountry?id="+d+"&cityAir="+e}else if(c[1]=="combination"){var f="organizar/ajax_fillLocationsByCombination?id="+d+"&cityAir="+e}else{var g="";for(var h=2;h<c.length;h++){var i=c[h].split("_");var j=parseInt(i[2]);if(i[5]!="NULL"&&(j==1||j==3||j==4||j==7)){var k=i[5].split("|p:");g+=k[0]+","}}g=g.substr(0,g.length-1);var f="organizar/ajax_fillLocations?ids="+g+"&cityAir="+e+"&destinationId="+d}if(g!=""){$.ajax({url:f,async:false,success:function(a){if(a!=""){$("#"+b).html(a);$("#"+b).change()}else{$("#"+b).html("");if(b=="ofi1_oficina"){$("#ofi2_oficina").html("");var c=$("#choice_c");if(c.parent().hasClass("selected")){c.removeAttr("checked");c.parent().removeClass("selected");$("#coches").slideUp();controlBuscarPrecios();alert("Lo sentimos, pero no disponemos de coches de alquiler para el destino seleccionado.")}}}}})}}function fillHotels(a,b){for(var c=1;c<5;c++){$("#ciudad_alojamiento"+c).html('<option value="">(seleccionar)</option>');var d="";for(var e=2;e<a.length;e++){var f=a[e].split("_");var g=parseInt(f[2]);if(f[4]!="NULL"&&(g==1||g==6||g==2||g==4)){var h=f[4];var i=h.split("|p:");h=i[0];var j=h.charAt(0);if(j=="b"){h=h.substr(2)}var k=f[0]+"_"+f[1]+"_"+f[0]+"_"+h;if(c==1&&i[1]=="1"){d='selected="selected"';$("#city_hotel"+c).val(k)}else{d=""}var l=f[1];if(b&&f[0]!="NULL"){l+=" ("+f[0]+")"}$("#ciudad_alojamiento"+c).append($("<option "+d+"></option>").val(k).html(l))}}}}function setHotelsIn(a){var b=a.split("@");var c=$('#f-destino > option[value="'+$("#f-destino").val()+'"]').text();if(b[1]=="country"&&typeof fillHotelsOrg!="function"){$.ajax({url:"organizar/ajax_fillhotelscountry?destination_id="+b[0]+"&cityAir="+c,async:false,success:function(a){b=a;var c=false}})}else if(b[1]=="country"&&typeof fillHotelsOrg=="function"){$.ajax({url:"organizar/ajax_hotelscountry?destination_id="+b[0],async:false,success:function(a){b=a.split("@");var c=false}})}else if(b[1]=="combination"&&typeof fillHotelsOrg!="function"){$.ajax({url:"organizar/ajax_fillhotelscombination?destination_id="+b[0]+"&cityAir="+c,async:false,success:function(a){if(a){b=a;var c=false}}})}else if(b[1]=="combination"&&typeof fillHotelsOrg=="function"){$.ajax({url:"organizar/ajax_hotelscombination?destination_id="+b[0],async:false,success:function(a){if(a){b=a.split("@");var c=false}}})}else{var d=true}if(typeof fillHotelsOrg=="function"){for(var e=1;e<5;e++){var f=fillHotelsOrg(b,e,d);if(f){var g=$("#f-citydestino > option:selected").html();var h=$("#f-citydestino > option:selected").val();if(e==1){$("#ciudad_alojamiento"+e).val(g);$("#city_hotel"+e).val("NULL_"+g+"_NULL_"+h)}}}}else{if(d){fillHotels(b,d)}else{for(var i=1;i<5;i++){$("#ciudad_alojamiento"+i).html(b);if(i>1){$("#ciudad_alojamiento"+i+" > option:selected").removeAttr("selected");$("#ciudad_alojamiento"+i).val("");$("#city_hotel"+i).val("")}}$("#ciudad_alojamiento1").change()}}}function setAirportsIn(a,b){var c=b.split("@");$("#"+a).html("");for(var d=2;d<c.length;d++){var e=c[d].split("_");var f=parseInt(e[2]);if(e[3]!="NULL"&&(f==1||f==3||f==2||f==5)){var g=e[3].split("|");var h=e[3].indexOf("|p:");var i=e[3].substr(0,h);var b=e[0]+"_"+e[1]+"_"+e[0]+"@"+i;var j="";if(g[3].substr(2)=="1"){var j="selected";var k=b.replace("@","_");if(a=="f-saliendo2"){$("#f-saliendoAir").val(k)}else{$("#f-destinoAir").val(k)}}$("#"+a).append($("<option "+j+"></option>").val(b).html(e[1]+" ("+e[0]+")"))}}}function validateNameAndCodes(a,b){if(a==""){return false}var c=b.split("_")[1];var d=a.indexOf("(");if(d>0){var e=a.substr(0,d-1)}else{var e=a}if(accentsTidy(e.toLowerCase())==accentsTidy(c.toLowerCase())){return true}else{return false}}function validateDates(a,b){var c=$("#"+a).val().split("-");var d=$("#"+b).val().split("-");var e=new Date(parseInt(c[2],10),parseInt(c[1],10)-1,parseInt(c[0],10));var f=new Date(parseInt(d[2],10),parseInt(d[1],10)-1,parseInt(d[0],10));var g=f.getTime()-e.getTime();if(g<0){return false}else{return true}}function validateOrganiza(){if($("#tipo_busqueda_guiada").attr("checked")&&$("#g-destino").val()!=""&&$("#g-destinoAir").val()==""){alert("No conocemos ese destino, prueba a organizar tu viaje con la búsqueda libre.");redirectLibre();return false}if($("#choice_v").attr("checked")){if($("#f-saliendoAir").val()==""&&$("#lieuMEVDepartAller").val()==""||$("#f-destinoAir").val()==""&&$("#lieuMEVArriveeAller").val()==""){alert("Para buscar vuelos debes introducir un origen y destino: escribe las primeras letras y luego elíjelo de la lista desplegada.");return false}else if($("#f-saliendoAir").val()==""&&$("#lieuMEVDepartAller").val()!=""){alert("Debes seleccionar una de las ciudades/aeropuertos que aparecen sugeridas. Si la ciudad que buscas no te es sugerida en el listado, eso significa que no tenemos vuelos desde esa localidad");return false}else if($("#f-destinoAir").val()==""&&$("#lieuMEVArriveeAller").val()!=""){alert("Debes seleccionar una de las ciudades/aeropuertos que aparecen sugeridas. Si la ciudad que buscas no te es sugerida en el listado, eso significa que no tenemos vuelos a esa localidad");return false}if($("#f-salida-org").val()==""||$("#f-salida-org").val()=="dd-mm-aaaa"){alert("Para buscar vuelos debes introducir el día de salida.");return false}if($("#f-idayvue").attr("checked")&&($("#f-salida-org").val()==""||$("#f-salida-org").val()=="dd-mm-aaaa")){alert("Si vas a querer billete de vuelta debes introducir la fecha de regreso.");return false}if(!validateDates("f-salida-org","f-duracion-org")){alert("La fecha de regreso debe ser posterior a la fecha de salida.");return false}}if($("#choice_h").attr("checked")){if($("#ciudad_alojamiento1").val()==""){alert("Para buscar hotel escribe las primeras detras de la ciudad dónde te quieras alojar y luego elígela del listado.");return false}if($("#ciudad_alojamiento1").val()!=""&&($("#f-entrada-hotel1").val()==""||$("#f-entrada-hotel1").val()=="dd-mm-aaaa"||$("#f-salida-hotel1").val()==""||$("#f-salida-hotel1").val()=="dd-mm-aaaa")){alert("Indica las fechas de entrada y salida para el alojamiento.");return false}for(var a=1;a<5;a++){if($("#tipo_busqueda_libre").attr("checked")&&!validateNameAndCodes($("#ciudad_alojamiento"+a).val(),$("#city_hotel"+a).val())){$("#city_hotel"+a).val("")}if($("#ciudad_alojamiento"+a).val()!=""){if(!validateDates("f-entrada-hotel"+a,"f-salida-hotel"+a)){alert("La fecha de salida del hotel debe ser posterior a la fecha de entrada.");return false}}}}if($("#choice_c").attr("checked")){if($("#oficina1").val()==""&&$("#ofi1_oficina").val()==""){alert("Para buscar coches escribe las primeras detras de la ciudad y luego elígela del listado.");return false}else if($("#oficina1").val()==""&&$("#ofi1_oficina").val()!=""){alert("Debes seleccionar una de las oficinas de alquiler que aparecen sugeridas. Si la ciudad que buscas no te es sugerida en el listado, eso significa que no tenemos coches de alquiler en esa localidad");return false}if($("#oficina1").val()!=""&&($("#f-coche-recogida").val()==""||$("#f-coche-recogida").val()=="dd-mm-aaaa")){alert("Tienes que indicar las fechas para el alquiler del vehículo.");return false}if(!validateDates("f-coche-recogida","f-coche-entrega")){alert("La fecha de entrega del coche debe ser posterior a la fecha de recogida.");return false}if($("#edad").val()==""||isNaN($("#edad").val())){alert("Para buscar coches de alquiler debes introducir la edad del conductor");return false}else if($("#edad").val()<18){alert("Para buscar coche hay que ser mayor de edad.");return false}}if(!$("#choice_v").attr("checked")){$("#f-saliendo2").val("");$("#f-saliendoAir").val("");$("#f-destino").val("");$("#f-destinoAir").val("")}if(!$("#choice_h").attr("checked")){for(var a=1;a<5;a++){$("#city_hotel"+a).val("");$("#ciudad_alojamineto"+a).val("");$("#f-entrada-hotel"+a).val("");$("#f-salida-hotel"+a).val("")}}if(!$("#choice_c").attr("checked")){for(var b=1;b<3;b++){$("#oficina"+b).val("");$("#ofi"+b+"_oficina").val("")}$("#f-coche-recogida").val("");$("#f-coche-entrega").val("")}return true}function eliminarHotel(a){$("#ciudad_alojamiento"+a).val("");$("#hotel"+a).hide();$("#hotel"+a).addClass("invisible");$("#hotel"+a).removeClass("visible_block");$("#anyadir_hotel").fadeIn();if($("#sec-organiza #organiza-form #hoteles .long").length>0){var b=$(".long").css("height");var c=parseInt(b.substring(0,b.indexOf("px")));$(".long").css("height",c-30)}}function populateCalendars(a,b){if(b==1){$("#f-entrada-hotel1").val(a);$("#f-coche-recogida").val(a);$("#f-coche-recogida").blur()}else{$("#f-salida-hotel1").val(a);$("#f-coche-entrega").val(a);$("#f-coche-entrega").blur()}}function toggleMasinfo(){if($(".masinfo")){$(".masinfo").css("display","none");$("p.coincide a").click(function(a){$(".masinfo").hide();$(this).parent().next().show();a.preventDefault()});$("p.cerrar a").click(function(a){$(".masinfo").hide();a.preventDefault()})}}function toggleMastexto(){if($("#page .mastexto")){$("#page span.mastexto").after(" <a href='#' class='leermas'>[leer +]</a>").hide();$("#page span.mastexto").parent().next("p.recursos").hide();$("#page a.leermas").click(function(a){if($(this).text()=="[leer +]"){$(this).text("[leer -]").prev("span.mastexto").show().parent().next("p.recursos").show()}else{$(this).text("[leer +]").prev("span.mastexto").hide().parent().next("p.recursos").hide()}$(".coincidencia").css("display","none").css("display","block");a.preventDefault()})}}function initSliders(){if($(".slider")){$(".slider").slider({animate:true,orientation:"horizontal",range:"min",stop:function(a,b){var c=$(a.target).parent("li");if(c.hasClass("toggler")){var d=c.children("ul");$(d[0]).removeClass("hidden");$("label > span",c).addClass("open")}if($(c).find('input[type="hidden"]')){$(c).find('input[type="hidden"]').attr("value",b.value);var e="#f"+$(a.target).attr("id").substring(1,$(a.target).attr("id").length);$(e).change()}},max:100,value:0});$("form li.toggler ul").addClass("hidden");$("form li.toggler ul li").addClass("off");$("form li.toggler ul li div.slider").hide();$("form li.toggler ul li input.checkbox").attr("checked","")}}var fieldObj=function(a,b,c,d,e){this.name=a;this.value=b;this.message=c;this.action=d;this.option=e};var validateForm=function(a){this.formName=a;this.fields=null;this.addField=function(a){if(this.fields==null){this.fields=new Array(1);this.fields[0]=a}else{this.fields[this.fields.length]=a}};this.controlForm=function(){var a=this;$("#"+this.formName).submit(function(){var b=a.fields.length;for(var c=0;c<b;c++){if(a.fields[c].option==null||$("#"+a.fields[c].option).attr("checked")){if($("#"+a.fields[c].name).val()==a.fields[c].value){if(a.fields[c].action){a.fields[c].action()}else{alert(a.fields[c].message)}return false}}}return true})}};var fieldObj=function(a,b,c,d,e){this.name=a;this.value=b;this.message=c;this.action=d;this.option=e};var validateForm=function(a){this.formName=a;this.fields=null;this.addField=function(a){if(this.fields==null){this.fields=new Array(1);this.fields[0]=a}else{this.fields[this.fields.length]=a}};this.controlForm=function(){var a=this;$("#"+this.formName).submit(function(){var b=a.fields.length;for(var c=0;c<b;c++){if(a.fields[c].option==null||$("#"+a.fields[c].option).attr("checked")){if($("#"+a.fields[c].name).val()==a.fields[c].value){if(a.fields[c].action){a.fields[c].action()}else{alert(a.fields[c].message)}return false}}}return true})}};$(document).ready(function(){if($("#search-form")){$("#s-activ").change(function(a){$("#search-form").submit()}).hide();$("#s-destinos").click(function(a){if($(a.target).attr("checked")){$("#s-activ").hide();$("#s-s").show();$("#s-submit").show()}});$("#s-actividades").click(function(a){if($(a.target).attr("checked")){$("#s-activ").show();$("#s-s").hide();$("#s-submit").hide()}})}toggleMastexto();initSliders();if($(".calendario")){var a=false;$(".calendario").each(function(b){if($(this).hasClass("salida")){if(a){var c=$(this).val();$(this).datepicker();$(this).datepicker("option","minDate",new Date);$(this).val(c);if($(this).val()==""||$(this).val().indexOf("/")>0){$(this).val("dd-mm-aaaa")}}else{$(".calendario.salida").datepicker({beforeShow:function(a){return{minDate:new Date($("#stime").val())}}})}if($(this).attr("id")=="f-salida-org"){$(this).change(function(){var a=new Date($(this).datepicker("getDate").getTime());var b=new Date($(this).datepicker("getDate").getTime()+864e5);$(".calendario.regreso").datepicker("option","minDate",a);$(".calendario.salida_hotel").datepicker("option","minDate",b);$(".calendario.coche_entrega").datepicker("option","minDate",a);populateCalendars($(this).val(),1)})}else if($(this).attr("id")=="f-salida2"){$(this).change(function(){var a=new Date($(this).datepicker("getDate").getTime());$("#f-regreso").datepicker("option","minDate",a);$("#f-duracion2").datepicker("option","minDate",a)})}}else if($(this).hasClass("regreso")){$(".calendario").datepicker({minDate:new Date($("#stime").val())});if(a){var c=$(this).val();$(this).datepicker("option","minDate",new Date);$(this).val(c)}if($(this).attr("id")=="f-duracion-org"){$(this).change(function(){populateCalendars($(this).val(),2)})}}else if($(this).hasClass("entrada_hotel")){if(a){var c=$(this).val();$(this).datepicker("option","minDate",new Date);$(this).val(c);if($(this).val()==""||$(this).val().indexOf("/")>0){$(this).val("dd-mm-aaaa")}}else{$(".calendario.salida_hotel").datepicker({beforeShow:function(a){return{minDate:new Date($("#stime").val())}}})}var d=$(this).attr("name").split("_")[3];$(this).change(function(){var a=new Date($(this).datepicker("getDate").getTime()+864e5);$(".calendario.salida_hotel[name=txt_fecha_salida_"+d+"]").datepicker("option","minDate",a);var b=a.getMonth()+1;var c=a.getDate()+"-"+b+"-"+a.getFullYear();$(".calendario.salida_hotel[name=txt_fecha_salida_"+d+"]").val(c)})}else if($(this).hasClass("salida_hotel")){$(".calendario").datepicker({minDate:new Date($("#stime").val())});if(a){var c=$(this).val();$(this).datepicker("option","minDate",new Date);$(this).val(c);if($(this).val()==""||$(this).val().indexOf("/")>0){$(this).val("dd-mm-aaaa")}}}else if($(this).hasClass("coche_recogida")){if(a){var c=$(this).val();$(this).datepicker("option","minDate",new Date);$(this).val(c);if($(this).val()==""||$(this).val().indexOf("/")>0){$(this).val("dd-mm-aaaa")}}else{$(".calendario.coche_recogida").datepicker({beforeShow:function(a){return{minDate:new Date($("#stime").val())}}})}$(this).change(function(){var a=new Date($(this).datepicker("getDate").getTime());$(".calendario.coche_entrega").datepicker("option","minDate",a);var b=a.getMonth()+1;var c=a.getDate()+"-"+b+"-"+a.getFullYear();$(".calendario.coche_entrega").val(c)})}else if($(this).hasClass("coche_entrega")){$(".calendario").datepicker({minDate:new Date($("#stime").val())});if(a){var c=$(this).val();$(this).datepicker("option","minDate",new Date);$(this).val(c);if($(this).val()==""||$(this).val().indexOf("/")>0){$(this).val("dd-mm-aaaa")}}}$.datepicker.setDefaults($.datepicker.regional["es"])})}if($("#map-toggle")){$("#map-toggle").click(function(a){if($("#carrusel").is(":visible")){if($.browser.msie){$("#carrusel").css("display","none");$(".coincidencia").css("position","static").css("position","relative")}else{$("#carrusel").slideUp(400)}}if($("#gmap").is(":visible")){$("#map-toggle").html("Mostrar <span>mapa</span>");if($.browser.msie){$("#gmap").css("display","none");$(".coincidencia").css("position","static").css("position","relative")}else{$("#gmap").slideUp(400)}}else if($("#gmap").is(":hidden")){$("#map-toggle").html("Ocultar <span>mapa</span>");if($.browser.msie){$("#gmap").css("display","block");$(".coincidencia").css("position","static").css("position","relative")}else{$("#gmap").slideDown(400)}}a.preventDefault()})}if($("#prefs-toggle")){$("#prefs-toggle").click(function(a){if($("#cambiarprefs").is(":visible")){$("#cambiarprefs").slideUp(400,function(){$("#misprefs").slideDown(400);$("#prefs-toggle").html("Cambiar mis <span>preferencias</span>")})}else if($("#cambiarprefs").is(":hidden")){$("#misprefs").slideUp(400,function(){$("#cambiarprefs").slideDown(400);$("#prefs-toggle").html("Volver a mis <span>preferencias</span>")})}a.preventDefault()})}toggleMasinfo()});var Browser={Version:function(){var a=999;if(navigator.appVersion.indexOf("MSIE")!=-1){a=parseFloat(navigator.appVersion.split("MSIE")[1])}return a}}
