// SWFAddress 2.4, copyright 2006-2009 Rostislav Hristov and contributors, Deep linking for Flash and Ajax http://www.asual.com/swfaddress/
// This software is released under the MIT License http://www.opensource.org/licenses/mit-license.php
if(typeof asual=="undefined"){var asual={}}if(typeof asual.util=="undefined"){asual.util={}}asual.util.Browser=new function(){var b=navigator.userAgent.toLowerCase(),a=/webkit/.test(b),e=/opera/.test(b),c=/msie/.test(b)&&!/opera/.test(b),d=/mozilla/.test(b)&&!/(compatible|webkit)/.test(b),f=parseFloat(c?b.substr(b.indexOf("msie")+4):(b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]);this.toString=function(){return"[class Browser]"};this.getVersion=function(){return f};this.isMSIE=function(){return c};this.isSafari=function(){return a};this.isOpera=function(){return e};this.isMozilla=function(){return d}};asual.util.Events=new function(){var c="DOMContentLoaded",j="onstop",k=window,h=document,b=[],a=asual.util,e=a.Browser,d=e.isMSIE(),g=e.isSafari();this.toString=function(){return"[class Events]"};this.addListener=function(n,l,m){b.push({o:n,t:l,l:m});if(!(l==c&&(d||g))){if(n.addEventListener){n.addEventListener(l,m,false)}else{if(n.attachEvent){n.attachEvent("on"+l,m)}}}};this.removeListener=function(p,m,n){for(var l=0,o;o=b[l];l++){if(o.o==p&&o.t==m&&o.l==n){b.splice(l,1);break}}if(!(m==c&&(d||g))){if(p.removeEventListener){p.removeEventListener(m,n,false)}else{if(p.detachEvent){p.detachEvent("on"+m,n)}}}};var i=function(){for(var m=0,l;l=b[m];m++){if(l.t!=c){a.Events.removeListener(l.o,l.t,l.l)}}};var f=function(){if(h.readyState=="interactive"){function l(){h.detachEvent(j,l);i()}h.attachEvent(j,l);k.setTimeout(function(){h.detachEvent(j,l)},0)}};if(d||g){(function(){try{if((d&&h.body)||!/loaded|complete/.test(h.readyState)){h.documentElement.doScroll("left")}}catch(m){return setTimeout(arguments.callee,0)}for(var l=0,m;m=b[l];l++){if(m.t==c){m.l.call(null)}}})()}if(d){k.attachEvent("onbeforeunload",f)}this.addListener(k,"unload",i)};asual.util.Functions=new function(){this.toString=function(){return"[class Functions]"};this.bind=function(f,b,e){for(var c=2,d,a=[];d=arguments[c];c++){a.push(d)}return function(){return f.apply(b,a)}}};var SWFAddressEvent=function(d){this.toString=function(){return"[object SWFAddressEvent]"};this.type=d;this.target=[SWFAddress][0];this.value=SWFAddress.getValue();this.path=SWFAddress.getPath();this.pathNames=SWFAddress.getPathNames();this.parameters={};var c=SWFAddress.getParameterNames();for(var b=0,a=c.length;b<a;b++){this.parameters[c[b]]=SWFAddress.getParameter(c[b])}this.parameterNames=c};SWFAddressEvent.INIT="init";SWFAddressEvent.CHANGE="change";SWFAddressEvent.INTERNAL_CHANGE="internalChange";SWFAddressEvent.EXTERNAL_CHANGE="externalChange";var SWFAddress=new function(){var _getHash=function(){var index=_l.href.indexOf("#");return index!=-1?_ec(_dc(_l.href.substr(index+1))):""};var _getWindow=function(){try{top.document;return top}catch(e){return window}};var _strictCheck=function(value,force){if(_opts.strict){value=force?(value.substr(0,1)!="/"?"/"+value:value):(value==""?"/":value)}return value};var _ieLocal=function(value,direction){return(_msie&&_l.protocol=="file:")?(direction?_value.replace(/\?/,"%3F"):_value.replace(/%253F/,"?")):value};var _searchScript=function(el){if(el.childNodes){for(var i=0,l=el.childNodes.length,s;i<l;i++){if(el.childNodes[i].src){_url=String(el.childNodes[i].src)}if(s=_searchScript(el.childNodes[i])){return s}}}};var _titleCheck=function(){if(_d.title!=_title&&_d.title.indexOf("#")!=-1){_d.title=_title}};var _listen=function(){if(!_silent){var hash=_getHash();var diff=!(_value==hash);if(_safari&&_version<523){if(_length!=_h.length){_length=_h.length;if(typeof _stack[_length-1]!=UNDEFINED){_value=_stack[_length-1]}_update.call(this,false)}}else{if(_msie&&diff){if(_version<7){_l.reload()}else{this.setValue(hash)}}else{if(diff){_value=hash;_update.call(this,false)}}}if(_msie){_titleCheck.call(this)}}};var _bodyClick=function(e){if(_popup.length>0){var popup=window.open(_popup[0],_popup[1],eval(_popup[2]));if(typeof _popup[3]!=UNDEFINED){eval(_popup[3])}}_popup=[]};var _swfChange=function(){for(var i=0,id,obj,value=SWFAddress.getValue(),setter="setSWFAddressValue";id=_ids[i];i++){obj=document.getElementById(id);if(obj){if(obj.parentNode&&typeof obj.parentNode.so!=UNDEFINED){obj.parentNode.so.call(setter,value)}else{if(!(obj&&typeof obj[setter]!=UNDEFINED)){var objects=obj.getElementsByTagName("object");var embeds=obj.getElementsByTagName("embed");obj=((objects[0]&&typeof objects[0][setter]!=UNDEFINED)?objects[0]:((embeds[0]&&typeof embeds[0][setter]!=UNDEFINED)?embeds[0]:null))}if(obj){obj[setter](value)}}}else{if(obj=document[id]){if(typeof obj[setter]!=UNDEFINED){obj[setter](value)}}}}};var _jsDispatch=function(type){this.dispatchEvent(new SWFAddressEvent(type));type=type.substr(0,1).toUpperCase()+type.substr(1);if(typeof this["on"+type]==FUNCTION){this["on"+type]()}};var _jsInit=function(){if(_util.Browser.isSafari()){_d.body.addEventListener("click",_bodyClick)}_jsDispatch.call(this,"init")};var _jsChange=function(){_swfChange();_jsDispatch.call(this,"change")};var _update=function(internal){_jsChange.call(this);if(internal){_jsDispatch.call(this,"internalChange")}else{_jsDispatch.call(this,"externalChange")}_st(_functions.bind(_track,this),10)};var _track=function(){var value=(_l.pathname+(/\/$/.test(_l.pathname)?"":"/")+this.getValue()).replace(/\/\//,"/").replace(/^\/$/,"");var fn=_t[_opts.tracker];if(typeof fn==FUNCTION){fn(value)}else{if(typeof _t.pageTracker!=UNDEFINED&&typeof _t.pageTracker._trackPageview==FUNCTION){_t.pageTracker._trackPageview(value)}else{if(typeof _t.urchinTracker==FUNCTION){_t.urchinTracker(value)}}}};var _htmlWrite=function(){var doc=_frame.contentWindow.document;doc.open();doc.write("<html><head><title>"+_d.title+"</title><script>var "+ID+' = "'+_getHash()+'";<\/script></head></html>');doc.close()};var _htmlLoad=function(){var win=_frame.contentWindow;var src=win.location.href;_value=(typeof win[ID]!=UNDEFINED?win[ID]:"");if(_value!=_getHash()){_update.call(SWFAddress,false);_l.hash=_ieLocal(_value,TRUE)}};var _load=function(){if(!_loaded){_loaded=TRUE;if(_msie&&_version<8){var frameset=_d.getElementsByTagName("frameset")[0];_frame=_d.createElement((frameset?"":"i")+"frame");if(frameset){frameset.insertAdjacentElement("beforeEnd",_frame);frameset[frameset.cols?"cols":"rows"]+=",0";_frame.src="javascript:false";_frame.noResize=true;_frame.frameBorder=_frame.frameSpacing=0}else{_frame.src="javascript:false";_frame.style.display="none";_d.body.insertAdjacentElement("afterBegin",_frame)}_st(function(){_events.addListener(_frame,"load",_htmlLoad);if(typeof _frame.contentWindow[ID]==UNDEFINED){_htmlWrite()}},50)}else{if(_safari){if(_version<418){_d.body.innerHTML+='<form id="'+ID+'" style="position:absolute;top:-9999px;" method="get"></form>';_form=_d.getElementById(ID)}if(typeof _l[ID]==UNDEFINED){_l[ID]={}}if(typeof _l[ID][_l.pathname]!=UNDEFINED){_stack=_l[ID][_l.pathname].split(",")}}}_st(_functions.bind(function(){_jsInit.call(this);_jsChange.call(this);_track.call(this)},this),1);if(_msie&&_version>=8){_d.body.onhashchange=_functions.bind(_listen,this);_si(_functions.bind(_titleCheck,this),50)}else{_si(_functions.bind(_listen,this),50)}}};var ID="swfaddress",FUNCTION="function",UNDEFINED="undefined",TRUE=true,FALSE=false,_util=asual.util,_browser=_util.Browser,_events=_util.Events,_functions=_util.Functions,_version=_browser.getVersion(),_msie=_browser.isMSIE(),_mozilla=_browser.isMozilla(),_opera=_browser.isOpera(),_safari=_browser.isSafari(),_supported=FALSE,_t=_getWindow(),_d=_t.document,_h=_t.history,_l=_t.location,_si=setInterval,_st=setTimeout,_dc=decodeURI,_ec=encodeURI,_frame,_form,_url,_title=_d.title,_length=_h.length,_silent=FALSE,_loaded=FALSE,_justset=TRUE,_juststart=TRUE,_ref=this,_stack=[],_ids=[],_popup=[],_listeners={},_value=_getHash(),_opts={history:TRUE,strict:TRUE};if(_msie&&_d.documentMode&&_d.documentMode!=_version){_version=_d.documentMode!=8?7:8}_supported=(_mozilla&&_version>=1)||(_msie&&_version>=6)||(_opera&&_version>=9.5)||(_safari&&_version>=312);if(_supported){if(_opera){history.navigationMode="compatible"}for(var i=1;i<_length;i++){_stack.push("")}_stack.push(_getHash());if(_msie&&_l.hash!=_getHash()){_l.hash="#"+_ieLocal(_getHash(),TRUE)}_searchScript(document);var _qi=_url?_url.indexOf("?"):-1;if(_qi!=-1){var param,params=_url.substr(_qi+1).split("&");for(var i=0,p;p=params[i];i++){param=p.split("=");if(/^(history|strict)$/.test(param[0])){_opts[param[0]]=(isNaN(param[1])?/^(true|yes)$/i.test(param[1]):(parseInt(param[1])!=0))}if(/^tracker$/.test(param[0])){_opts[param[0]]=param[1]}}}if(_msie){_titleCheck.call(this)}if(window==_t){_events.addListener(document,"DOMContentLoaded",_functions.bind(_load,this))}_events.addListener(_t,"load",_functions.bind(_load,this))}else{if((!_supported&&_l.href.indexOf("#")!=-1)||(_safari&&_version<418&&_l.href.indexOf("#")!=-1&&_l.search!="")){_d.open();_d.write('<html><head><meta http-equiv="refresh" content="0;url='+_l.href.substr(0,_l.href.indexOf("#"))+'" /></head></html>');_d.close()}else{_track()}}this.toString=function(){return"[class SWFAddress]"};this.back=function(){_h.back()};this.forward=function(){_h.forward()};this.up=function(){var path=this.getPath();this.setValue(path.substr(0,path.lastIndexOf("/",path.length-2)+(path.substr(path.length-1)=="/"?1:0)))};this.go=function(delta){_h.go(delta)};this.href=function(url,target){target=typeof target!=UNDEFINED?target:"_self";if(target=="_self"){self.location.href=url}else{if(target=="_top"){_l.href=url}else{if(target=="_blank"){window.open(url)}else{_t.frames[target].location.href=url}}}};this.popup=function(url,name,options,handler){try{var popup=window.open(url,name,eval(options));if(typeof handler!=UNDEFINED){eval(handler)}}catch(ex){}_popup=arguments};this.getIds=function(){return _ids};this.getId=function(index){return _ids[0]};this.setId=function(id){_ids[0]=id};this.addId=function(id){this.removeId(id);_ids.push(id)};this.removeId=function(id){for(var i=0;i<_ids.length;i++){if(id==_ids[i]){_ids.splice(i,1);break}}};this.addEventListener=function(type,listener){if(typeof _listeners[type]==UNDEFINED){_listeners[type]=[]}_listeners[type].push(listener)};this.removeEventListener=function(type,listener){if(typeof _listeners[type]!=UNDEFINED){for(var i=0,l;l=_listeners[type][i];i++){if(l==listener){break}}_listeners[type].splice(i,1)}};this.dispatchEvent=function(event){if(this.hasEventListener(event.type)){event.target=this;for(var i=0,l;l=_listeners[event.type][i];i++){l(event)}return TRUE}return FALSE};this.hasEventListener=function(type){return(typeof _listeners[type]!=UNDEFINED&&_listeners[type].length>0)};this.getBaseURL=function(){var url=_l.href;if(url.indexOf("#")!=-1){url=url.substr(0,url.indexOf("#"))}if(url.substr(url.length-1)=="/"){url=url.substr(0,url.length-1)}return url};this.getStrict=function(){return _opts.strict};this.setStrict=function(strict){_opts.strict=strict};this.getHistory=function(){return _opts.history};this.setHistory=function(history){_opts.history=history};this.getTracker=function(){return _opts.tracker};this.setTracker=function(tracker){_opts.tracker=tracker};this.getTitle=function(){return _d.title};this.setTitle=function(title){if(!_supported){return null}if(typeof title==UNDEFINED){return}if(title=="null"){title=""}title=_dc(title);_st(function(){_title=_d.title=title;if(_juststart&&_frame&&_frame.contentWindow&&_frame.contentWindow.document){_frame.contentWindow.document.title=title;_juststart=FALSE}if(!_justset&&_mozilla){_l.replace(_l.href.indexOf("#")!=-1?_l.href:_l.href+"#")}_justset=FALSE},10)};this.getStatus=function(){return _t.status};this.setStatus=function(status){if(!_supported){return null}if(typeof status==UNDEFINED){return}if(status=="null"){status=""}status=_dc(status);if(!_safari){status=_strictCheck((status!="null")?status:"",TRUE);if(status=="/"){status=""}if(!(/http(s)?:\/\//.test(status))){var index=_l.href.indexOf("#");status=(index==-1?_l.href:_l.href.substr(0,index))+"#"+status}_t.status=status}};this.resetStatus=function(){_t.status=""};this.getValue=function(){if(!_supported){return null}return _dc(_strictCheck(_ieLocal(_value,FALSE),FALSE))};this.setValue=function(value){if(!_supported){return null}if(typeof value==UNDEFINED){return}if(value=="null"){value=""}value=_ec(_dc(_strictCheck(value,TRUE)));if(value=="/"){value=""}if(_value==value){return}_justset=TRUE;_value=value;_silent=TRUE;_update.call(SWFAddress,true);_stack[_h.length]=_value;if(_safari){if(_opts.history){_l[ID][_l.pathname]=_stack.toString();_length=_h.length+1;if(_version<418){if(_l.search==""){_form.action="#"+_value;_form.submit()}}else{if(_version<523||_value==""){var evt=_d.createEvent("MouseEvents");evt.initEvent("click",TRUE,TRUE);var anchor=_d.createElement("a");anchor.href="#"+_value;anchor.dispatchEvent(evt)}else{_l.hash="#"+_value}}}else{_l.replace("#"+_value)}}else{if(_value!=_getHash()){if(_opts.history){_l.hash="#"+_dc(_ieLocal(_value,TRUE))}else{_l.replace("#"+_dc(_value))}}}if((_msie&&_version<8)&&_opts.history){_st(_htmlWrite,50)}if(_safari){_st(function(){_silent=FALSE},1)}else{_silent=FALSE}};this.getPath=function(){var value=this.getValue();if(value.indexOf("?")!=-1){return value.split("?")[0]}else{if(value.indexOf("#")!=-1){return value.split("#")[0]}else{return value}}};this.getPathNames=function(){var path=this.getPath(),names=path.split("/");if(path.substr(0,1)=="/"||path.length==0){names.splice(0,1)}if(path.substr(path.length-1,1)=="/"){names.splice(names.length-1,1)}return names};this.getQueryString=function(){var value=this.getValue(),index=value.indexOf("?");if(index!=-1&&index<value.length){return value.substr(index+1)}};this.getParameter=function(param){var value=this.getValue();var index=value.indexOf("?");if(index!=-1){value=value.substr(index+1);var p,params=value.split("&"),i=params.length,r=[];while(i--){p=params[i].split("=");if(p[0]==param){r.push(p[1])}}if(r.length!=0){return r.length!=1?r:r[0]}}};this.getParameterNames=function(){var value=this.getValue();var index=value.indexOf("?");var names=[];if(index!=-1){value=value.substr(index+1);if(value!=""&&value.indexOf("=")!=-1){var params=value.split("&"),i=0;while(i<params.length){names.push(params[i].split("=")[0]);i++}}}return names};this.onInit=null;this.onChange=null;this.onInternalChange=null;this.onExternalChange=null;(function(){var _args;if(typeof FlashObject!=UNDEFINED){SWFObject=FlashObject}if(typeof SWFObject!=UNDEFINED&&SWFObject.prototype&&SWFObject.prototype.write){var _s1=SWFObject.prototype.write;SWFObject.prototype.write=function(){_args=arguments;if(this.getAttribute("version").major<8){this.addVariable("$swfaddress",SWFAddress.getValue());((typeof _args[0]=="string")?document.getElementById(_args[0]):_args[0]).so=this}var success;if(success=_s1.apply(this,_args)){_ref.addId(this.getAttribute("id"))}return success}}if(typeof swfobject!=UNDEFINED){var _s2r=swfobject.registerObject;swfobject.registerObject=function(){_args=arguments;_s2r.apply(this,_args);_ref.addId(_args[0])};var _s2c=swfobject.createSWF;swfobject.createSWF=function(){_args=arguments;var swf=_s2c.apply(this,_args);if(swf){_ref.addId(_args[0].id)}return swf};var _s2e=swfobject.embedSWF;swfobject.embedSWF=function(){_args=arguments;if(typeof _args[8]==UNDEFINED){_args[8]={}}if(typeof _args[8].id==UNDEFINED){_args[8].id=_args[1]}_s2e.apply(this,_args);_ref.addId(_args[8].id)}}if(typeof UFO!=UNDEFINED){var _u=UFO.create;UFO.create=function(){_args=arguments;_u.apply(this,_args);_ref.addId(_args[0].id)}}if(typeof AC_FL_RunContent!=UNDEFINED){var _a=AC_FL_RunContent;AC_FL_RunContent=function(){_args=arguments;_a.apply(this,_args);for(var i=0,l=_args.length;i<l;i++){if(_args[i]=="id"){_ref.addId(_args[i+1])}}}}})()};
// end of SWFAddress

function vbdiv(d){var i=document.createElement('div');if(d){i.className=d;}
return i;}
function vblink(a,b,c,d){var i=document.createElement('a');if(a){i.href=a;}
i.className=b;i.title=c;if(d){i.onclick=d;}
return i;}
var vbvb,vbvp,vbqa,vbmax,vbrf,vbdf,vbpb,vbpi,vbpl,vbvs,vbra,vblp=0;function vbstop(){vbpb.className='vbx vbi';vbpi.innerHTML='';vbpl=0;vbdf(0);return false;}
function vbplay(i){var a,b;vbstop();if(i===-1){i=vblp;}else{vblp=i;}
if(vbvb&&vbra[i]){i=vbra[i];if(i.playUrl){vbpb.className='vbx';vbpl=GvideoSearch.createPlayer(i,'vbp');vbpi.appendChild(vbpl);b=vblink(i.url,'vbt',i.title,0);a=document.createTextNode(i.title);b.appendChild(a);a=vbdiv('vbt');a.appendChild(b);vbpi.appendChild(a);vbdf(1);}}}
function vbresults(){var i,j,a,b,c,d,e;if(vbvb){if(vbvs.results&&vbvs.results.length>0){vbra=vbvs.results.length>vbmax?vbvs.results.splice(0,vbmax):vbvs.results;b=vbdiv('vbd');c=vbra.length;for(j=0;j<c;j++){vbra[j].title=vbra[j].titleNoFormatting.replace(/\.avi$/,'');a=GSearch.scaleImage(vbra[j].tbWidth,vbra[j].tbHeight,{width:120,height:90});i=document.createElement('img');i.src=vbra[j].tbUrl;i.alt=vbra[j].title;i.className='pii';if((81-a.height)>0){i.setAttribute('vspace',Math.round((81-a.height)/2));}
e=vblink(0,'pia',vbra[j].title,new Function('vbplay('+j+'); return false;'));d=vbdiv('pi');d.appendChild(i);d.appendChild(e);d.appendChild(vbdiv('pib'));e=vbdiv('pv');e.appendChild(d);b.appendChild(e);}
i=vbdiv('vbb');GSearch.getBranding(i);b.appendChild(i);vbvb.innerHTML='';vbvb.appendChild(b);vbrf();}else if(vbqa.length>0){vbvs.execute(vbqa.shift());}else{vbvb.innerHTML='<div class="vbn">Sorry, video is unavailable.</div>';vbrf();}}}
function vbstart(a,b,c,d,e,f){vbvb=a;vbvp=b;vbqa=c;vbmax=d;vbrf=e;vbdf=f;vbvp.innerHTML='';vbpb=vbdiv('vbx');vbpi=vbdiv(0);vbpb.appendChild(vbpi);vbpb.appendChild(vblink(0,'close','Close',vbstop));vbvp.appendChild(vbpb);vbpb.className='vbx vbi';vbpl=0;vbvs=new GvideoSearch();vbvs.setResultSetSize(d>4?GSearch.LARGE_RESULTSET:GSearch.SMALL_RESULTSET);vbvs.setSearchCompleteCallback(this,vbresults);vbvs.execute(vbqa.shift());}

function gE(i) { return document.getElementById(i); }
function bS(i) { return i.replace(/\s/g,'&nbsp;'); }

function ajax(i,j) { var a; try { if (typeof ActiveXObject !== 'undefined') { a = new ActiveXObject('Microsoft.XMLHTTP'); } else if (window.XMLHttpRequest) { a = new XMLHttpRequest(); } } catch(e) {} if (a) { a.onreadystatechange = function() { if (a.readyState === 4) { try { if (a.status === 200) { j(a.getResponseHeader('Content-Type').indexOf('xml') !== -1 ? a.responseXML : a.responseText); } } catch(e) {} a.onreadystatechange = function() {}; } }; a.open('GET',i,true); a.send(null); } }

var oK = 0, gO = 0, fF = 0, lO = 0, sL = 1, sH = 'Guide', pagemap, xI, zI, vV = inarray('Video',pagesX);
var map, zS, sB, wB, nB, eB, sBx, wBx, nBx, eBx, iD, aS, nN, dM, oH, oW, oO, cZ, kZ, xZ, dZ, tG = 0, lE, bP = 0, shrink = 0;
var mO = 0, lB = -1, mT = 'Hybrid', sM = -1, tM = 0, aD = 0, aE = 0, lS = 0, dT = 0, mL = 0, fL, rR = 0;
var sO = 0, wO = 0, nO = 1, eO = 1, zO = 0, fU = mX ? uX : 'Main_Page', wM = 0, wW = 0, tH = 16, fI, jI, cI, aI, pI;
var yD = 0, wN = 1, wE = 0, n4 = 0, n5 = 0, pbt = 27, pbt2 = 44, pbt3 = 44, dO = 1, vR = 1, yY = 0, pR = 9, delay = 0, vH = 0, vW = 0, fM, spY = 0;
var pageTracker, bK = 'Guide', gK = [false,false], historyskip = 0, readmore = 0;
var wizcampaign = wizX, wizid = -1, wizauto = 0, wizthis = 0, wizcurrent = 0, wizfound = 0, wiztimeout, wizblur = 0, wiztype = '', wizup = 0;
var wizishotel = 0, wizisdeal = 0, wiztofrom, wizpointer = -1;

var wizlocations = {}, wizmatches = {}, wizcities = {}, eA = {}, fA = {}, xA = {}, nA = {'Hotels':1,'Flights':1};

var historyqueue = [], wizresults = [], drop = [], pA = [], sA = [], mA = [], wA = [], qA = [], yA = [0,0], lA = [0,0,6], rA = [0,0], bA = ['page','satellite'], jA = [['Africa','Africa','Africa',1,24,3],['Asia','Asia','Asia',35,99,3],['Australia','Australia','Australia',-25,134,4],['China','China','China',38,104,4],['Europe','Europe','Europe',51.58,21.7,4],['India','India','India',21.5,78.9,4],['Japan','Japan','Japan',38.5,139.3,5],['S. America','South_America','South America',-24,-60.3,3],['U.K.','United_Kingdom','United Kingdom',54.5,-2.37,5],['U.S.A.','United_States_of_America','United States',39.199253,-96.597027,4],['World','Main_Page',0,35,10,0]];

function track(a,b,c,d) { _gaq.push(['_trackEvent',a,b,c,d]); }

function plusone(i) {
	var j = gX ? gE(i ? 'pageplus' : 'mapplus') : 0;
	if (!j) { return; }
	j.innerHTML = '<iframe src="/dynamic/plusone.php?href=' + domainX + (i && urlX ? '/' + urlX : '') + '&amp;size=' + (i ? 'standard' : 'medium') + '&amp;lang=en_' + (britishX ? 'GB' : 'US') + '" scrolling="no" frameborder="0" allowtransparency="true" class="plusframe"></iframe>';
}

function findmap() { pagemap = sH === 'Guide' ? gE('pagemap') : 0; }

function activemap() { return bA[0] === 'atlas' || pagemap; }

function Zs() { }

function Gm(lL,i,j) { this.latLng = lL; this.icon = i; this.zIndex = j; }

function gZ() { var i = map.getZoom(); return isNaN(i) ? (spY ? 12 : zX) : i; }

function nS(i) { var j = i.indexOf(': '); return j !== -1 ? i.substr(j+2) : i; }

function reloadpage(i) { if (!i || i === 'Guide') { window.location.href = window.location.href.replace(/#.*$/,''); } else { loadpage(i); } }

function historyexecute() { if (lO !== 2) { return; } while (historyqueue.length) { SWFAddress.setValue(historyqueue.shift()); } }

function historyupdate(i) {
	if (i === sH) { return false; }
	if (!historyskip) { historyqueue.push(i === 'Guide' ? '' : i); historyexecute(); }
	bK = sH; sH = i; findmap();
	return true;
}

function month(i,j) { var tA = ['January','February','March','April','May','June','July','August','September','October','November','December']; return j ? tA[i] : tA[i].substr(0,3); }

function weekday(i,j) { var tA = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; return j ? tA[i] : tA[i].substr(0,2); }

function ordinal(i) { var tA = ['th','st','nd','rd','th','th','th','th','th','th']; return i + tA[i > 10 && i < 14 ? 0 : i % 10]; }

function menu(i,lV) {
	var a, b = '', c = drop[i].length;
	for (a = 2; a < c; a++) { b += '<a href="/' + drop[i][a][0] + '" title="' + drop[i][a][1] + '" class="dropa">' + drop[i][a][2] + '</a>'; }
	return '<div class="dropyes" onmouseover="clearTimeout(drop[' + i + '][0]);" onmouseout="var i = this; drop[' + i + '][0] = setTimeout(function() { i.className = \'dropno\'; },750);">' + drop[i][1] + '&nbsp;<a title="" class="dropb" onclick="if (this.parentNode.className === \'dropno\') { this.parentNode.parentNode.innerHTML = menu(' + i + ',this.parentNode.parentNode.offsetLeft); } else { this.parentNode.className=\'dropno\'; } return false;"><b class="dropi"></b></a><div class="dropx" style="left:' + (lV > 544 && siteX !== 'Mapcarta' ? 546-lV : 2) + 'px;"><div class="dropz">' + b + '</div></div></div>';
}

function gH() { if (self.innerHeight) { return self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { return document.documentElement.clientHeight; } else if (document.body) { return document.body.clientHeight; } else { return 0; } }

function gW() { if (self.innerWidth) { return self.innerWidth; } else if (document.documentElement && document.documentElement.clientWidth) { return document.documentElement.clientWidth; } else if (document.body) { return document.body.clientWidth; } else { return 0; } }

function xL(uV,lV,tV) { return '<a ' + (vX && uV === '/' + urlX && !sX ? 'onclick="return show(\'Guide\');"' : 'href="' + uV + '"') + ' title="' + (tV || lV) + '">' + lV + '</a>'; }

function rE(i) { return i.substr(0,i.lastIndexOf('-')); }

function pG(i) { return i >= iX.length+iX2.length ? iX3[i-iX.length-iX2.length].slice(0) : (i >= iX.length ? iX2[i-iX.length].slice(0) : iX[i].slice(0)); }

function uG() {
	var i = tG, j = [], a = 0, b = 'none', c, hV, wV;
	if (typeof(i) !== 'object') { b = i; i = pG(i); i[0] += '.jpg'; }
	hV = Math.max(1,Math.round(gH()-2*tH));
	wV = Math.max(1,gW()-108);
	a = i[3]/i[4];
	if (a > hV/wV) { wV = Math.round(hV/a); } else { hV = Math.round(wV*a); }
	if (hV > 2*i[3]) { hV = 2*i[3]; wV = 2*i[4]; }
	c = iX.length+iX2.length+iX3.length;
	a = b === 'none' || c < 2 ? 0 : Math.max(0,Math.round((hV-39)/2));
	if (a) {
		j[0] = b ? b-1 : c-1;
		j[1] = b+1 < c ? b+1 : 0;
		j[2] = pG(j[0]);
		j[3] = pG(j[1]);
	}
	eA.gg.innerHTML = '<table class="tf"><tr><td class="tc"><div class="gd" style="height:' + hV + 'px;"><img src="http://imedia.io/' + (i[0].substr(i[0].length-3) === 'jpg' ? 'photos' : 'illustrations') + '/' + i[0].replace(/%/g,'-') + '" alt="' + i[1] + '" height="' + hV + '" width="' + wV + '" class="gq" />' + (a ? '<a title="Previous" class="gl" style="top:' + a + 'px;" onclick="return gG(' + j[0] + ');"><b style="background-image:url(http://imedia.io/photos/' + j[2][0].replace(/%/g,'-') + '.jpg);" class="gp"></b></a><a title="Next" class="gr" style="top:' + a + 'px;" onclick="return gG(' + j[1] + ');"><b style="background-image:url(http://imedia.io/photos/' + j[3][0].replace(/%/g,'-') + '.jpg);" class="gp"></b></a>' : '') + '</div>' + xL('/' + rE(i[0]),i[1],i[1]) + '&nbsp;<span class="silver">•</span> <a href="http://wikitravel.org/en/Image:' + i[2] + '" title="Image Credits" target="_blank" rel="nofollow">Image Credits</a></td></tr></table><a title="Close" onclick="return gG(\'none\');" class="close"></a>';
	gK = a ? [j[0],j[1]] : [false,false];
}

function iI(i) { return i % 10; }

function cL() {
	if (lB !== -1) { if (mA[lB][5] && lB !== sM) { mA[lB][5].setIcon(iI(mA[lB][6]),0); } }
	lB = -1; lE.innerHTML = '';
}

function oM() { if (gO) { cL(); } sL = 1; }

function mH() { return eA.map.offsetHeight || gH(); }

function mW() { return eA.map.offsetWidth || gW(); }

function iM() { return bA[0] === 'atlas' ? (mH() > screen.availHeight-400 && mW() > screen.availWidth-120) : 1; }

function aZ(i,j) { return '<a title="Zoom ' + i + '" onclick="return zoomTo(' + j + ');">' + (i === 'Out' && j !== 18 ? '' : 'Zoom&nbsp;') + i + '</a>'; }

function enC(i) { return i*2+12345678; }

function aU(i) {
	var j, a, b, c, d, cV, uV, zV, bV, tA = [], mZ;
	if (i) {
		cV = i[0]; uV = i[1]; zV = i[4];
		if (cV.length > 20) {
			tA = cV.replace(/[\s]+/g,' ').replace(/-/g,'- ').replace(/\//g,'/ ').split(' '); bV = tA[0]; j = tA[0].length; a = tA.length;
			for (i = 1; i < a; i++) {
				j += tA[i].length+1;
				if (j > 20) {
					bV += '<br />'; j = tA[i].length;
				} else {
					tA[i-1] = tA[i-1].charAt(tA[i-1].length-1);
					if (tA[i-1] === '-' || tA[i-1] === '/') { j--; } else { bV += '&nbsp;'; }
				}
				bV += tA[i];
			}
		} else {
			bV = cV;
		}
		mZ = gZ(); zV = zV > mZ+1 ? zV : 0; c = mZ === 19; d = mZ === 2;
		j = map.getCenter(); b = Math.round(tH*0.75);
		i = map.fromLatLngToContainerPixel(j); eA.aa.style.top = (i.y-b+2) + 'px'; eA.aa.style.left = (i.x+15) + 'px';
		i = map.fromLatLngToDivPixel(j); eA.ab.style.top = (i.y-b) + 'px'; eA.ab.style.left = (i.x+13) + 'px';
		eA.aa.innerHTML = '<span class="as">' + xL((isNaN(uV) || siteX === 'Mapcarta' ? '' : 'http://mapcarta.com') + '/' + (isNaN(uV) ? (urlX !== uX && uV === uX ? urlX : uV) : enC(uV)),bV,cV) + '</span><div class="little">' + (c ? '' : aZ(zV ? 'To' : 'In',zV || mZ+1)) + (c || d ? '' : '&nbsp;<span class="silver">•</span>&nbsp;') + (d ? '' : aZ('Out',mZ-1)) + '</div>';
		a = '<span class="as">' + bV + '</span><div class="little">' + (c ? '' : 'Zoom&nbsp;' + (zV ? 'To' : 'In')) + (c || d ? '' : '&nbsp;<span class="fwn">•</span>&nbsp;') + (d ? '' : (mZ === 19 ? 'Zoom&nbsp;' : '') + 'Out') + '</div>';
		for (i = 1; i < 9; i++) { eA['a' + i].innerHTML = a; }
	}
	i = i ? 'block' : 'none'; eA.aa.style.display = i; eA.ab.style.display = i;
}

function uY(i) {
	var wV;
	if (i) {
		eA.y2.style.marginLeft = 0;
		if (i !== 1) { eA.y3.innerHTML = i; }
		wV = mW()-(shrink ? 24 : 446);
		eA.y1.style.width = wV + 'px';
		eA.y2.style.marginLeft = Math.max(0,Math.floor((wV-eA.y2.scrollWidth)/2)) + 'px';
		if (shrink % 1 === 0) { eA.y1.style.visibility = 'visible'; }
	} else {
		eA.y1.style.visibility = 'hidden';
		aU(0);
	}
}

function aF() {
	var i;
	if (!gO) { return; }
	i = bA[0] === 'atlas' && !shrink ? mH()-eA.mm.scrollHeight > 192 : false;
	if (i && !aD) { aD = new GAdsManager(map, 'pub-3417291128493297', { style : G_ADSMANAGER_STYLE_ADUNIT, maxAdsOnMap : 1, channel : (siteX === 'Mapcarta' ? '7190692479' : (siteX === 'iGuide' ? '8632091588' : '8101222529')),  minZoomLevel : 1, position : new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(49, 43)) }); }
	if (aD && aE !== i) {
		aE = i;
		if (i) {
			aD.enable();
			aI = setInterval(function() { i = gE('adblock_onmap'); if (i) { clearInterval(aI); i.onmouseover = oM; } },500);
		} else {
			aD.disable();
			clearInterval(aI);
		}
	}
}

function cB() { document.body.className = bA[0] + ' ' + bA[1] + ' ' + (siteX === 'Mapcarta' ? 'mapcarta' : (siteX === 'iGuide' ? 'iguide' : 'you')) + (gX ? '' : ' noplus'); aF(); }

function bD() {
	var i = 1, j, a, b = 0, c = 1, d = 1;
	j = gE('s0');
	if (j) {
		a = mH()-eA.mx.offsetTop-j.offsetTop-j.scrollHeight-62;
		while (d) {
			j = gE('s' + i);
			if (j) {
				b += j.scrollHeight;
				if (b < a) { c = i+1; }
				i++;
			} else {
				break;
			}
		}
		d = ''; for (j = c; j < i; j++) { d += ' j' + j; }
	}
	if (d !== dO) { dO = d; eA.mx.className = d; }
	aF();
}

function iC(tV,nV) {
	var mC = map.getCenter(), mZ = gZ();
	return Math.abs(mC.lat()-tV) < 2*Math.pow(0.5,mZ) && Math.abs(mC.lng()-nV) < 2*Math.pow(0.5,mZ);
}

function mS(i) { mO = 1; if (i) { uY(0); } cL(); }

function zoomTo(zV) {
	var mZ, wC;
	if (!gO) { return false; }
	mZ = gZ();
	if (isNaN(zV)) { zV = mZ + (zV === '+' ? 1 : -1); }
	zV = Math.max(2,Math.min(19,zV));
	if (zV !== mZ) {
		wC = sM === -1 ? 0 : iC(mA[sM][2],mA[sM][3]);
		mS(0);
		map.setCenter(wC ? new GLatLng(mA[sM][2],mA[sM][3]) : map.getCenter(), zV);
		bD();
	}
	sL = 1;
	return false;
}

function oR() {
	var i, a, b, c;
	if (activemap()) {
		a = mH(); b = mW(); c = a*b;
		i = bA[0] === 'page' || a < 500 || b < 950 || c < 550000 ? (b < 700 || c < 525000 ? 2 : 1)+(a < 450 || c < 250000 ? 0.5 : 0) : 0;
		if (i !== shrink) { shrink = i; eA.mapbox.className = shrink ? 'shrink' : ''; }
		bD();
	}
	if (siteX !== 'Mapcarta' && bA[0] !== 'atlas') {
		if (bA[0] === 'page') {
			i = eA.x2.offsetHeight-20; // subtract bottom margin
			if (eA.pbt && eA.pbt.scrollHeight) { pbt = eA.pbt.scrollHeight; }
			if (eA.pbt2 && eA.pbt2.scrollHeight) { pbt2 = eA.pbt2.scrollHeight; }
			if (eA.pbt3 && eA.pbt3.scrollHeight) { pbt3 = eA.pbt3.scrollHeight; }
			a = 0;
			b = [eA.x3.offsetTop+eA.n1.scrollHeight,eA.n2.style.display === 'none' ? 0 : 27+eA.n2.scrollHeight,eA.n3.style.display === 'none' ? 0 : 27+eA.n3.scrollHeight,eA.x3.className === 'u4' ? n4 : (eA.n4.style.display === 'none' ? 0 : 27+eA.n4.scrollHeight),eA.x3.className === 'u4' || eA.x3.className === 'u5' ? n5 : 27+eA.n5.scrollHeight,27+pbt+197+10+197,0];
			n4 = b[3]; n5 = b[4];
			while (i >= 0 && a <= 6) { i -= b[a++]; }
			a = Math.max(4,Math.min(7,a));
			eA.x3.className = 'u' + a;
			if (a === 7) {
				i += 197+10+197;
				a = Math.max(0,Math.min(iX.length,Math.floor((i+10)/207)));
				b = 0;
				if (a) {
					b = Math.max(0,Math.min(iX2.length,Math.floor((i-a*207-pbt2+10)/207)));
					c = Math.max(0,Math.min(iX3.length,Math.floor((i-a*207-pbt2-b*207-pbt3+10)/207)));
					b = pbt+a*207+(b ? pbt2+b*207 : 0)+(c ? pbt3+c*207 : 0)-10;
				}
				if (b !== bP) {
					if (b) { eA.n6.style.height = b + 'px'; }
					if (!b || !bP) { eA.n6.style.visibility = b ? 'visible' : 'hidden'; }
					bP = b;
				}
			}
		} else if (bA[0] === 'gallery') {
			uG();
		} else if (bA[0] === 'video') {
			a = Math.max(135,gH()-2*tH);
			b = Math.max(180,Math.min(1900,gW()-30));
			i = a >= 225 && b >= 300;
			if (i) { a -= 20; }
			if (b/a > 4/3) { b = 4/3*a; } else { a = 3/4*b; }
			if (i) { a += 20; }
			vbpl.style.height = Math.round(a) + 'px';
			vbpl.style.width = Math.round(b) + 'px';
		}
		a = Math.max(gH(),bA[0] === 'page' || bA[0] === 'booking' ? eA[bA[0] === 'page' ? 'pagebox' : 'bw'].offsetHeight : 0);
		b = eA.magic.offsetWidth;
		if (a !== vH || b !== vW) {
			vH = a; vW = b;
			a = Math.floor(Math.min(vH,vW*hW));
			eA.magic.style.height = a + 'px';
			if (a === vH) { eA.blend.style.display = 'none'; } else { eA.blend.style.top = (a-200) + 'px'; eA.blend.style.display = 'block'; }
		}
	}
}

function changeview(i) {
	var j = i === 'video' || i === 'gallery';
	if (i !== 'page' && i === bA[0]) { return; }
	if (j) { rA = [Math.max(window.pageXOffset || 0,document.documentElement.scrollLeft || 0,document.body.scrollLeft || 0),Math.max(window.pageYOffset || 0,document.documentElement.scrollTop || 0,document.body.scrollTop || 0)]; }
	bA[0] = i; cB();
	window.scrollTo(j ? 0 : rA[0],j ? 0 : rA[1]); cB(); oR();
	if (!j) { rA = [0,0]; }
	if (i === 'booking') { return; }
	track('Pages',i === 'page' || i === 'atlas' ? sH : i.charAt(0).toUpperCase() + i.substr(1),bK,0);
}

function uE(i) { return i.replace(/ /g,'+').replace(/,/g,'%2C'); }

function wizcheck(i) { return wiztype.indexOf(i) !== -1; }

function wizshow(i,j) { return wizcodes[i] ? wizcodes[i].substr(0,wizcodes[i].indexOf(',')) + (j ? '' : ' (' + i + ')') : ''; }

function wizsethotel(i) {
	i = i.replace(/\,.+$/g,'').replace('-',' ').replace(/[^A-Z ,]/ig,'').replace(/^\s+|\s+$/g,'').replace(/[\s]{2,}/g,' ').replace(/^(.)|[\s](.)/g, function ($1) { return $1.toUpperCase(); } );
	if (i.length > 1 && rX.to !== i) { rX.to = i; wizauto = 1; }
}

function wizrange(a,b,c,d) {
	a = ordinal(a); b = month(b-1,1); c = ordinal(c); d = month(d-1,1);
	if (b === d) {
		return usdateX ? b + '&nbsp;' + a + '&nbsp;to&nbsp;' + c : a + '&nbsp;to&nbsp;' + c + '&nbsp;' + b;
	} else {
		return usdateX ? b + '&nbsp;' + a + ' to ' + d + '&nbsp;' + c : a + '&nbsp;' +  b + ' to ' + c + '&nbsp;' + d;
	}
}

function wiztip(i) {
	var j = gE('wiz3g'), a = Math.random() > 0.5 ? 'supplier' : 'provider';
	if (j) {
		if (!i) {
			a = 'Compare ' + (wizresults.length > 3 ? '3 or more suppliers' : 'each supplier') + ' to find a better&nbsp;deal.';
		} else if (i === wizresults.length) {
			eA.bw.className = 'redone';
			a = 'Search separetely for hotels, flights and&nbsp;cars.';
		} else {
			a = i % 2 ? 'Each ' + a + ' should offer different ' + (rX.type === 'hotel' ? (Math.random() > 0.5 ? 'hotels and&nbsp;rates.' : 'rates and&nbsp;hotels.') : 'rates.') : (rX.type === 'flight' ? 'Airline consolidators' : (Math.random() > 0.5 ? 'Many ' : 'Some ') + a + 's') + ' offer exclusive ' + (Math.random() > 0.5 ? 'rates' : 'deals') + ' not available from other&nbsp;sources.';
		}
		j.innerHTML = '<div class="mj"><div class="wiz3m">' + a + '</div></div>';
	}
	if (!i && wizresults.length) { j = gE('wiz3g'); if (j) { j.style.display = 'block'; } }
}

function wizitem(i) {
	var j = i.charAt(0).toUpperCase() + i.substr(1) + 's';
	return '<td class="wiz1i">' + (i === rX.type ? '<span class="wiz' + i + '">' + j + '</span>' : '<a class="wiz' + i + '" title="' + j + '" onclick="wizsearch(\'' + i + '\',0); return false;">' + j + '</a>') + '</td>';
}

function wizdate(i) {
	var a = rX[i + 'day'], b = rX[i + 'month'], d;
	d = new Date(rX[i + 'year'],b-1,a);
	a = ordinal(a); b = month(b-1,0);
	return weekday(d.getDay(),1) + '&nbsp;' + (usdateX ? b + '&nbsp;' + a : a + '&nbsp;' + b);
}

function wizvalue() {
	if (wizcheck('fm_rooms')) {
		return rX.type !== 'flight' || rX.bundle ? rX.rooms : 0;
	} else if (wizcheck('fm_adults')) {
		return rX.adults;
	} else if (wizishotel) {
		return -1;
	} else {
		return '0';
	}
}

function wizpop(a) {
	var i, j;
	if (!wizthis) { return; }
	if (!a) {
		if (!wizthis.nodeName) { return; }
		if (wizthis.nodeName.toLowerCase() === 'a') {
			wizthis.innerHTML = wizdate(wizcheck('wizin') ? 'in' : 'out');
		} else if (wizisdeal) {
			if (wizfound && wizlocations[wizfound] && wizlocations[wizfound][wizpointer]) {
				i = wizlocations[wizfound][wizpointer];
				jX = [[i[0],i[1] === 'World' ? '' : i[1].replace(/,.+$/,'')],[1,'']];
				if (i[2] && i[1].indexOf(', ') !== -1) { jX.splice(1,0,[i[2],i[1].replace(/^.+, /,'')]); }
				deals(0);
			}
		} else if (wizishotel) {
			if (wizpointer === -1) { wizsethotel(wizthis.value); }
			wizthis.value = rX.to;
		} else {
			i = wizvalue();
			wizthis.value = i === '0' ? wizshow(rX[wiztofrom],0) : i;
		}
	}
	if (!wizthis.parentNode) { return; }
	if (!wizthis.parentNode.className) { return; }
	if (a) {
		j = wizthis.parentNode.childNodes;
		for (i = 0; i < j.length; i++) {
			if (j[i].className) {
				if (j[i].className.toLowerCase().indexOf('wizpop') !== -1) {
					wizpointer = wizvalue();
					j[i].className = 'wizpop' + (wizpointer === -1 ? '' : ' wizd' + wizpointer);
					j[i].innerHTML = a;
					break;
				}
			}
		}
	}
	wizthis.parentNode.className = (a ? 'wizactive' : 'wizbase') + (wizup ? ' wizup' : '');
	if (!a) { wizthis = 0; wizcurrent = 0; wizfound = 0; }
}

function wizsetdate(i,a,b,c) {
	var j, d = 7;
	rX[i + 'day'] = a;
	rX[i + 'month'] = b;
	rX[i + 'year'] = c;
	wizauto = 1;
	if (!wizthis) { return; }
	j = wizthis;
	while (d--) {
		j = j.parentNode;
		if (j && j['fm_hotel_check' + i + '_date']) {
			j['fm_hotel_check' + i + '_date'].value = rX[i + 'month'] + '/' + rX[i + 'day'] + '/' + rX[i + 'year']; break;
		}
	}
	wizpop(0);
	return false;
}

function wizschedule(b) {
	var i, j, a, c, d, e, f, g = 1, xV = '';
	if (!wizthis) { return; }
	i = wizcheck('wizin') ? 'in' : 'out';
	if (!b) {
		if (i === 'in') {
			b = rX.inmonth;
		} else {
			d = new Date(rX.inyear,rX.inmonth-1,rX.inday+2);
			b = d.getMonth()+1;
			d = d.getFullYear();
			if (d === rX.outyear ? b > rX.outmonth : d > rX.outyear) {
				if (b === rX.month) { b = rX.inmonth; }
			} else {
				b = rX.outmonth;
			}
		}
	}
	a = b === rX.month ? rX.day : 0;
	c = b < rX.month ? rX.year+1 : rX.year;
	d = new Date(c,b-1,1); d = d.getDay();
	e = b === 2 ? (c % 4 ? 28 : 29) : (b === 4 || b === 6 || b === 9 || b === 11 ? 30 : 31);
	for (f = 0; f < 7; f++) { xV += '<td><div class="' + (f ? (f === 6 ? 'wizc6' : 'wizc5') : 'wizc4') + '">' + weekday(britishX ? (f+1) % 7 : f,0) + '</div></td>'; }
	xV = '<tr>' + xV + '</tr><tr>';
	f = 0;
	j = (britishX ? 2 : 1)-d;
	if (j >= 2) { j -= 7; }
	while (g) {
		xV += '<td>' + (j > 0 && j <= e ? (j < a ? '<div class="wizc7">' + j + '</div>' : '<a title="" onclick="return wizsetdate(\'' + i + '\',' + j + ',' + b + ',' + c + ');" class="wizc8">' + j + '</a>') : '<div class="wizc7">&nbsp;</div>') + '</td>';
		f++; j++;
		if (f % 7 === 0) { if (f >= 42) { break; } xV += '</tr><tr>'; }
	}
	wizpop('<table class="wizc0"><tr><td>' + (b === rX.month ? '<div class="wizc3">&lt;</div>' : '<a title="" onclick="wizschedule(' + (b > 1 ? b-1 : 12) + '); return false;" class="wizc2">&lt;</a>') + '</td><td colspan="5" class="wizc1">' + month(b-1,1) + ' ' + c + '</td><td>' + (b === (rX.month === 1 ? 12 : rX.month-1) ? '<div class="wizc3">&gt;</div>' : '<a title="" onclick="wizschedule(' + (b < 12 ? b+1 : 1) + '); return false;" class="wizc2">&gt;</a>') + '</td></tr>' + xV + '</tr></table>');
}

function wizcalendar(a,b) { return '<div onmouseover="wizclear();" onmouseout="wizset();" class="wizbase' + (b ? '' : ' wizup') + '"><a href="" title="" tabindex="0" onclick="wizevent(this,1); return false;" onblur="if (wizblur) { wizpop(0); } else if (wizthis) { wizthis.focus(); }" class="wizwhen ' + a + '">' + wizdate(a.substr(3)) + '</a><div class="wizpop"></div></div>'; }

function wizwidget(i) { return '<div class="wizfa" onselectstart="return false;"><div class="b1"><table class="wizfx"><tr><td class="wizfy"><div class="wizfv">Hotels</div><a title="Flights" onclick="rX.type = \'flight\'; track(\'Booking\',\'Flight\',sH,0); return fast(\'Booking\',0);" class="wizfv">Flights</a><a title="Cars" onclick="rX.type = \'car\'; track(\'Booking\',\'Car\',sH,0); return fast(\'Booking\',0);" class="wizfv">Cars</a></td><td class="wizfz">' + siteX + (siteX === 'You.travel' ? '' : ' Travel') + ' Search</td></tr></table></div><div class="mk"><div class="wizfm">Compare ' + providersX + ' and&nbsp;more.</div><form class="wizf0" onsubmit="return wizsubmit(this,sH,\'hotel\');"><table class="wizft"><tr><td class="bv wizf2">Find&nbsp;hotels&nbsp;in</td><td class="bv wizf3"><div class="wizbase' + (i ? '' : ' wizup') + '"><input name="fm_City" maxlength="50" value="' + (rX.to || '') + '" onfocus="wizevent(this,0);" onkeydown="return wizevent(this,event);" onblur="wizpop(0);" class="wizmedium wizishotel" autocomplete="off" /><div class="wizpop"></div></div></td><td class="bv">' + wizcalendar('wizin',i) + '</td><td class="bv wizf5">to</td><td class="bv">' + wizcalendar('wizout',i) + '</td><td class="bv wizf8"><input type="image" src="http://imedia.io/images/go15.png" name="submit" alt="Go" class="wizfg" /></td></tr></table></form></div></div>'; }

function wizinput(a,b) { return '<div class="wiz1x">' + a + ':</div><div class="wizbase"><input name="' + b + '" maxlength="50" value="' + (rX.type === 'hotel' ? rX.to + '" onfocus="wizevent(this,0); wizauto = 1;" onkeydown="return wizevent(this,event);" onblur="wizpop(0);" class="wizishotel ' : wizshow(b ? rX.tocode : rX.fromcode,0) + '" onfocus="wizevent(this,0);" onkeydown="wizevent(this,event);" onblur="wizpop(0);" class="') + 'wiz1z" autocomplete="off" /><div class="wizpop"></div></div>'; }

function wizsetdigit(i) {
	if (wizcheck('fm_rooms')) {
		if (i && rX.rooms !== i) { rX.rooms = i; wizauto = 1; }
		if (rX.type === 'flight' && rX.bundle !== i) { rX.bundle = i; wizauto = 1; }
	} else if (rX.adults !== i) {
		rX.adults = i; wizauto = 1;
	}
}

function wizdigit() {
	if (!wizthis) { return; }
	if (!wizthis.value) { return; }
	if (wizthis.value.match(wizcheck('fm_rooms') && rX.type === 'flight' ? '^[0-9]$' : '^[1-9]$')) {
		wizsetdigit(wizthis.value);
		wizthis.blur();
	} else {
		wizthis.value = '';
	}
}

function wizsetcity(i) {
	if (rX[wiztofrom] !== i) { rX[wiztofrom] = i; wizauto = 1; }
	if (wiztofrom === 'tocode') { rX.to = wizcodes[i].substr(0,wizcodes[i].indexOf(',')); }
}

function wizoption(i,j) {
	var a, b, c;
	if (wizisdeal) {
		a = '<b>' + bS(wizlocations[i][j][1]) + '</b>';
	} else {
		if (wizishotel) {
			c = wizcities[i][j];
			a = '<b>' + bS(c) + '</b>';
		} else {
			c = wizmatches[i][j];
			a = wizcodes[c];
			b = a.indexOf(',');
			a = '<b>' + bS(a.substr(0,b)) + '</b>' + bS(a.substr(b));
		}
	}
	return '<div class="wizo' + j + ' nowrap" onmouseover="wizpointer = ' + j + '; this.parentNode.className = \'wizpop wizd' + j + '\';' + (wizisdeal ? '' : ' ' + (wizishotel ? 'wizsethotel' : 'wizsetcity') + '(\'' + c + '\');') + '" onclick="wizpop(0);">' + a + '</div>';
}

function wizmenu () {
	var i, j, a = wizcurrent, b = '';
	if (wizisdeal ? !wizlocations[a] : (wizishotel ? !wizcities[a] : !wizmatches[a])) { return; }
	wizfound = a;
	j = wizisdeal ? wizlocations[a].length : (wizishotel ? wizcities[a].length : wizmatches[a].length);
	if (wizup) {
		while (j--) { b += wizoption(a,j); }
	} else {
		for (i = 0; i < j; i++) { b += wizoption(a,i); }
	}
	if (b) {
		if (!wizisdeal && !wizishotel) { wizsetcity(wizmatches[a][0]); }
		wizpop(b);
	}
}

function wizfind() {
	var i = wizthis, a, b, c, xV;
	if (!i) { return; }
	a = i.value.toLowerCase().replace(/[^a-z ]/g,' ').replace(/[ ]{2,}/g,' ').replace(/^\s+|\s+$/g,'');
	if (!a.length || wizcurrent === a) { return; }
	wizcurrent = a;
	if (wizisdeal ? wizlocations[a] : (wizishotel ? wizcities[a] : wizmatches[a])) {
		wizmenu();
	} else {
		ajax(
			(wizisdeal ? '/dynamic/wizdeals.php?s=' : (wizishotel ? '/dynamic/wizhotels.php?s=' : '/dynamic/wizcodes.php?s=')) + a, function(rV) {
				if (rV && (wizisdeal ? !wizlocations[a] : (wizishotel ? !wizcities[a] : !wizmatches[a]))) {
					xV = rV.getElementsByTagName('m');
					if (xV.length) {
						b = xV.length;
						if (wizisdeal) {
							wizlocations[a] = [];
							while (b--) { wizlocations[a][b] = [xV[b].getAttribute('l'),xV[b].getAttribute('c'),xV[b].getAttribute('d')]; }
						} else if (wizishotel) {
							wizcities[a] = [];
							while (b--) { wizcities[a][b] = xV[b].getAttribute('c'); }
						} else {
							wizmatches[a] = [];
							while (b--) {
								c = xV[b].getAttribute('c');
								wizcodes[c] = xV[b].getAttribute('l') + ' (' + c + ') ' + xV[b].getAttribute('a');
								wizmatches[a][b] = c;
							}
						}
					}
				}
				if (wizthis === i && wizcurrent === a) { wizmenu(); }
			}
		);
	}
}

function wizset() { wiztimeout = setTimeout(function() { wizblur = 1; },100); }

function wizclear() { clearTimeout(wiztimeout); wizblur = 0; }

function wizkey(i) {
	var a, b, c, d;
	if (wizcheck('wiznumber')) {
		b = wizvalue()+i;
		if (b < (rX.type === 'flight' && wizcheck('fm_rooms') ? 0 : 1) || b > 9) { return; }
		wizsetdigit(b);
		wizevent(wizthis,2);
	} else {
		a = wizfound;
		if (!wizthis.parentNode) { return; }
		if (wizisdeal) {
			if (!wizlocations[a]) { return; }
			d = wizlocations[a].length;
		} else if (wizishotel) {
			if (!wizcities[a]) { return; }
			d = wizcities[a].length;
		} else {
			if (!wizmatches[a]) { return; }
			d = wizmatches[a].length;
		}
		b = parseFloat(wizpointer);
		if (wizup) { b += i; } else { b -= i; }
		if (b < 0 || b >= d) { return; }
		i = wizthis.parentNode.childNodes;
		for (c = 0; c < i.length; c++) {
			if (i[c].className) {
				if (i[c].className.toLowerCase().indexOf('wizpop') !== -1) {
					wizpointer = b;
					i[c].className = 'wizpop wizd' + b;
					if (wizishotel) {
						wizsethotel(wizcities[a][b]);
					} else if (!wizisdeal) {
						wizsetcity(wizmatches[a][b]);
					}
					return;
				}
			}
		}
	}
}

function wizevent(i,e) {
	var j = '', a;
	if (wizthis !== i) { wizpop(0); }
	if (!i || !i.parentNode) { return false; }
	if (wizthis !== i) {
		wizthis = i;
		wiztype = (wizthis.className ? wizthis.className.toLowerCase() : '') + ' ' + (wizthis.name ? wizthis.name.toLowerCase() : '');
		wizup = wizthis.parentNode.className ? wizthis.parentNode.className.toLowerCase().indexOf('wizup') !== -1 : 0;
		wizishotel = wizcheck('wizishotel');
		wizisdeal = wizcheck('wizisdeal');
		wiztofrom = wizcheck('fm_city') ? 'tocode' : 'fromcode';
		wizpointer = -1;
	}
	if (e === 1) {
		wizblur = 0;
		wizthis.innerHTML = 'Select date';
		wizschedule(0);
	} else if (e === 2) {
		wizthis.value = '';
		a = rX.type === 'flight' && wizcheck('fm_rooms') ? 0 : 1;
		for (i = 9; i >= a; i--) { j += '<div class="wizo' + i + ' nowrap" onmouseover="this.parentNode.className = \'wizpop wizd' + i + '\'; wizsetdigit(' + i + ');" onclick="wizpop(0);"><b>&nbsp;&nbsp; ' + i + ' &nbsp;&nbsp;</b></div>'; }
		wizpop(j);
	} else if (e) {
		a = e.keyCode || 0;
		if (a === 13) {
			wizthis.blur();
			return false;
		} else if (a === 38) {
			wizkey(1);
		} else if (a === 40) {
			wizkey(-1);
		} else if (wizcheck('wiznumber')) {
			setTimeout(wizdigit,10);
		} else {
			setTimeout(wizfind,10);
		}
	} else {
		if (wizishotel && wizthis.value) { wizsethotel(wizthis.value); }
		wizthis.value='';
	}
	return true;
}

function wiznumeric(a,b) { return '<table><tr><td><div class="wizbase wizup"><input name="' + a + '" size="1" maxlength="1" value="' + b + '" onfocus="wizevent(this,2);" onkeydown="wizevent(this,event);" onblur="wizpop(0);" class="wiznumber" autocomplete="off" /><div class="wizpop"></div></div></td></tr></table>'; }

function wizbutton(i) { return '<a title="' + i + '" onclick="return wizsubmit(document.wizform,0,rX.type);" class="wiz1a"><input type="submit" value="' + i + '" class="wiz1s" /></a>'; }

function wizdisplay(i) {
	historyupdate(i ? 'Booking' : bK);
	wizid = -1; wizauto = 0;
	if (i) {
		eA.bw.className = '';
		eA.bw.innerHTML = '<div class="wizry"><img src="http://imedia.io/images/' + (siteX === 'Mapcarta' ? 'mapcartatravelsearch.png' : (siteX === 'iGuide' ? 'iguidetravelsearch2.png' : 'youtravelsearch.png')) + '" alt="' + siteX + (siteX === 'You.travel' ? '' : ' Travel') + ' Search" class="wizri" /><table class="wizrt"><tr><td class="wizr1"><div class="wizrw"><div class="b1">Your Trip Details</div><div class="mk"><table class="wiz1h"><tr>' + wizitem('hotel') + wizitem('flight') + wizitem('car') + '</tr></table><form name="wizform" class="wizrf" onsubmit="return false;"><table class="wiz1t"><tr><td>' + (rX.type === 'hotel' || rX.type === 'car' ? '' : '<table class="wiz1w"><tr><td' + (rX.oneway ? ' onclick="rX.oneway = 0; wizsearch(\'flight\',2);"' : '') + '><input type="radio"' + (rX.oneway ? '' : ' checked="checked"') + ' />&nbsp;' + (britishX ? 'Return' : 'Round&nbsp;trip') + '</td><td class="wiz1p"></td><td' + (rX.oneway ? '' : ' onclick="rX.oneway = 1; wizsearch(\'flight\',2);"') + '><input type="radio"' + (rX.oneway ? ' checked="checked"' : '') + ' />&nbsp;<span class="nowrap">One-way</span></td></tr></table>' + wizinput('From','') + '<div class="k1"></div>') + wizinput(rX.type === 'hotel' || rX.type === 'car' ? 'City' : 'To','fm_City') + '<div class="k2"></div><table><tr><td><div class="wiz1x">' + (rX.type === 'hotel' ? 'Check-in' : (rX.type === 'car' ? 'Pick-up' : 'Depart')) + ':</div>' + wizcalendar('wizin',0) + '</td><td class="wiz1j"></td><td><div class="wiz1x">' + (rX.type === 'hotel' ? 'Check-out' : (rX.type === 'car' ? 'Drop-off' : (rX.oneway ? 'Tickets' : 'Return'))) + ':</div>' + (rX.type === 'flight' && rX.oneway ? wiznumeric('fm_Adults',rX.adults) : wizcalendar('wizout',0)) + '</td></tr></table>' + (rX.type === 'car' || (rX.type === 'flight' && rX.oneway) ? '' : '<table class="wiz1q"><tr><td><div class="wiz1x">' + (rX.type === 'flight' ? 'Tickets' : 'Guests') + ':</div>' + wiznumeric('fm_Adults',rX.adults) + '</td><td class="wiz1p"></td><td><div class="wiz1x">' + (rX.type === 'flight' ? 'Hotel rooms: <span class="wiz1o">(optional)</span>' : 'Rooms:') + '</div>' + wiznumeric('fm_Rooms',rX.type === 'hotel' || rX.bundle ? rX.rooms : 0) + '</td></tr></table>') + '</td></tr></table><div id="wiz1d">' + wizbutton('Find ' + rX.type.charAt(0).toUpperCase() + rX.type.substr(1) + 's') + '</div></form><div class="k3"></div></div></div></td><td class="wizr0"></td><td class="wizr2"><div class="wizrw" onmouseover="if (wizauto) { wizauto = 0; wizsubmit(document.wizform,null,rX.type); }"><div class="b1">Compare Travel Providers</div><div class="mk" id="wiz2x"><div class="wiz2l"></div></div></div></td><td class="wizr0"></td><td class="wizr3"><div class="wiz3i"></div><div id="wiz3g"></div><div id="wiz3x"><div class="mj"><div class="wiz3m"><div class="wizfirst">Search providers recommended for your specific trip.</div><div class="wizsecond">Your itinerary will be passed along, saving you&nbsp;time.</div></div></div></div></td></tr></table><div class="k4"></div><div class="wizrs">Travel made simple.</div><div class="k2"></div></div>';
	} else {
		rX.oneway = 0;
	}
	changeview(i ? 'booking' : 'page');
}

function wizmessage(i) { return wizresults.length === i ? 'All done! Please search again for any remaining parts of&nbsp;your&nbsp;itinereary.' : 'Check the ' + (wizresults.length === 1 ? 'provider below to check' : wizresults.length + ' providers below to compare') + (rX.type === 'flight' && rX.bundle ? '' : ' ' + rX.type) + '&nbsp;prices.'; }

function wizerror(i) {
	track('Errors',i ? 'Incomplete' : (i === 0 ? 'Unavailable' : 'Incompatible'),'',0);
	eA.bw.className = i === 0 ? '' : 'redone';
	return '<div class="k4"></div>Sorry, ' + (i === 0 ? 'the system is temporarily&nbsp;unavailable.' : 'your trip details are&nbsp;incomplete.') + (i ? i + '<div class="k2"></div>' : '<div class="k1"></div>Please ' + (i === 0 ? ' try&nbsp;again.' : 'verify your itinereray and try&nbsp;again.') + '<div class="k4"></div>');
}

function wizclick(i) {
	var j, a, b = 0;
	if (!wizresults[i]) { return; }
	a = wizresults[i]; wizresults[i] = 0;
	j = wizresults.length;
	while (j--) { b += wizresults[j] ? 0 : 1; }
	track('Leads',a,b.toString(),0);
	j = gE('wiz2m'); if (j) { j.innerHTML = wizmessage(b); }
	wiztip(b);
}

function wiznotice(i,j) { return i ? '<div class="red wiz2z">• ' + (j.length > 25 ? j : 'Please enter your ' + j) + '.</div>' : ''; }

function wizstep(a,b) { return '<tr><td class="wiz2o">' + a + '.</td><td class="wiz2h">' + b + '</td></tr>'; }

function wizsearch(i,j) {
	var a, b, c = Math.floor(1000000000*Math.random()), d, e, f, xV, tA = ['supplier-name','image-link','url'], dV = [];
	if (bA[0] !== 'booking' || rX.type !== i || j === 2) { rX.type = i; wizdisplay(1); }
	i = gE('wiz2x');
	if (!i) { return; }
	a = rX.type === 'flight' && !rX.fromcode;
	b = rX.type === 'hotel' ? !rX.to : !rX.tocode;
	d = rX.type === 'flight' && rX.tocode && rX.tocode === rX.fromcode;
	e = rX.type === 'flight' && rX.oneway ? 0 : (rX.outyear === rX.inyear ? (rX.outmonth === rX.inmonth ? (rX.outday <= rX.inday) : (rX.outmonth < rX.inmonth)) : (rX.outyear < rX.inyear));
	f = rX.type === 'hotel' || (rX.type === 'flight' && rX.bundle) ? (rX.rooms > rX.adults) : 0;
	xV = a || b || d || e || f;
	wizauto = 0;
	if (xV && j === null) { return; }
	wizid = c;
	if (j || (j === 0 && xV)) {
		eA.bw.className = 'redone';
		j = j === 0 || j === 1 || j === 2 ? 'Enter' : 'Verify';
		i.innerHTML = '<div class="wiz2q"><table>' + wizstep(1,j + ' your itinerary','Search recommended travel sites.') + wizstep(2,'Compare recommended travel providers') + wizstep(3,'Find your best offer') + '</table></div>';
		return;
	}
	if (xV) {
		i.innerHTML = wizerror(wiznotice(a,'departure&nbsp;city') + wiznotice(b,'travel&nbsp;destination') + wiznotice(d,'Your departure city should differ from your&nbsp;destination') + wiznotice(e,'Your ' + (rX.type === 'flight' ? 'return' : (rX.type === 'car' ? 'drop-off' : 'check-out')) + ' should be later than your&nbsp;<span class="nowrap">' + (rX.type === 'flight' ? 'departue' : (rX.type === 'car' ? 'pick-up' : 'check-in')) + '</span>') + wiznotice(f,'You should have at least as many ' + (rX.type === 'hotel' ? 'guests' : 'tickets') + ' as rooms'));
		return;
	}
	a = gE('wiz1d');
	if (!a) { return; }
	a.innerHTML = wizbutton('Update Results');
	i.innerHTML = '<div class="wiz2l"></div>'; wizresults = []; wiztip(0); oR();
	ajax(
		'/dynamic/bookingwiz4.php?campaign=' + (testX ? '0npbhok' : wizcampaign) + '&type=' + rX.type + (rX.type === 'hotel' ? '&to=' + uE(rX.to) : '&from=' + rX.fromcode + '&to=' + rX.tocode) + '&in=' + rX.inmonth + '/' + rX.inday + '/' + rX.inyear + '&out=' + rX.outmonth + '/' + rX.outday + '/' + rX.outyear + '&adults=' + rX.adults + '&rooms=' + (rX.type === 'hotel' || rX.bundle ? rX.rooms : 0) + '&oneway=' + rX.oneway + '&r=' + c, function(rV) {
			e = gE('wiz2x');
			if (wizid === c && e) {
				if (rV) {
					xV = rV.getElementsByTagName('supplier');
					f = xV.length;
					if (f) {
						for (a = 0; a < f; a++) {
							c = [];
							for (b = 0; b <= 2; b++) {
								i = xV[a].getElementsByTagName(tA[b])[0];
								if (i) { i = i.childNodes[0]; i = i ? i.nodeValue : 0; }
								if (i) { c.push(i); }
							}
							if (c.length === 3) { dV.push(c); }
						}
					}
					f = dV.length;
					if (f) {
						track('Results',rX.type.charAt(0).toUpperCase() + rX.type.substr(1),rX.type === 'hotel' ? rX.to : rX.tocode,f);
						if (rX.type === 'hotel') {
							tA = {'getaroom':'getaroom offers secret lower hotel quotes by&nbsp;phone.','venere':'Venere has specially negotiated rates for European&nbsp;hotels.','booking.com':'Booking.com guarantees the lowest room&nbsp;price.','dealbase':'DealBase has unadvertised hotel room&nbsp;offers.','asiatravel':'Asiatravel has special negotiated rates for Asian&nbsp;hotels.','hotwire':'Check Hotwire\'s &quot;Hot Rates&quot; for special hotel&nbsp;deals.','travelocity':'Travelocity\'s &quot;Top Secret Hotels&quot; offer unpublished&nbsp;rates.'};
						} else if (rX.type === 'car') {
							tA = {'hotwire':'Check Hotwire\'s &quot;Hot Rates&quot; for special car&nbsp;deals.'};
						} else {
							tA = {'bing travel':'Bing\'s &quot;Price Predictor&quot; is proven to save&nbsp;money.','flythere4less':'FlyThere4Less offers unpublished international&nbsp;airfares.','cheapoair':'CheapOair guarantees you the lowest&nbsp;price.','orbitz':'Orbitz charges no flight booking&nbsp;fees.','hotwire':'Check Hotwire\'s &quot;Hot Rates&quot; for special&nbsp;deals.'};
						}
						tA.kayak = 'Kayak was voted the #1 travel site in&nbsp;2011.';
						tA.priceline = 'Try Priceline\'s &quot;name your own price&quot; for better&nbsp;deals.';
						wizresults = [];
						a = ''; d = 1;
						for (b = 0; b < f; b++) {
							c = dV[b][0].toLowerCase() === 'booking.com' ? 'Booking.com' : dV[b][0].replace('.com','');
							wizresults[b] = c || 1;
							if (tA[c.toLowerCase()] && (b < 2 || d)) { a += (b ? '' : '<div class="k2"></div>') + '<div class="wiz2n graphite">' + tA[c.toLowerCase()] + '</div>'; d = 0; } else { d = 1; }
							c = 'Show ' + c + ' Prices';
							d = testX ? 'http://www.this-page-intentionally-left-blank.org' : dV[b][2];
							a += '<div class="wiz2d"><a href="' + d + '" title="' + c + '" target="_blank" onclick="this.className=\'wiz2a checked\'; wizclick(' + b + '); window.open(\'' + d + '\',\'\',\'width=500,height=500,top=0,left=0,scrollbars=yes,resizable=yes\'); return false;" class="wiz2a"></a><img class="wiz2b" src="' + dV[b][1] + '" alt="' + c + '" /><div class="wiz2c"></div><div class="wiz2e"><table class="wiz2f"><tr><td class="bv"><input type="button" value="' + c + '" class="wiz2g" /></td></tr></table></div></div>';
						}
						e.innerHTML = '<div id="wiz2m">' + wizmessage(0) + '</div>' + a + '<div class="wiz2i">Showing ' + (rX.type === 'flight' && rX.bundle ? '' : rX.type + ' ') + 'providers&nbsp;for<div class="wizrb graphite bo">' + (rX.type === 'hotel' ? rX.to : (rX.type === 'flight' ? wizshow(rX.fromcode,1) + ' to ' : '') + wizshow(rX.tocode,1)) + '<br />' + wizrange(rX.inday,rX.inmonth,rX.outday,rX.outmonth) + '</div></div>';
						wiztip(0);
						eA.bw.className = 'redtwo';
					} else {
						e.innerHTML = wizerror('');
					}
				} else {
					e.innerHTML = wizerror(0);
				}
				oR();
			}
		}
	);
}

function wizformdates(a,i) {
	if (!a['fm_hotel_check' + i + '_date']) { return; }
	if (!a['fm_hotel_check' + i + '_date'].value) { return; }
	a = a['fm_hotel_check' + i + '_date'].value.split('/');
	if (a.length !== 3) { return; }
	rX[i + 'day'] = parseFloat(a[1]);
	rX[i + 'month'] = parseFloat(a[0]);
	rX[i + 'year'] = parseFloat(a[2]);
}

function wizsubmit(a,b,c) {
	wizpop(0);
	if (c === 'hotel') { wizsethotel(a.fm_City.value); }
	track(b ? 'Booking' : 'Rebooking',c.charAt(0).toUpperCase() + c.substr(1),oK ? (b || '') : 'Out',0);
	if (b) {
		wizformdates(a,'in');
		wizformdates(a,'out');
		if (siteX === 'iGuide') { wizcampaign = b === 'Header' ? '0nq5t6l' : '0npw7bv'; }
	}
	if (oK) { wizsearch(c,b === null ? null : false); }
	return !oK;
}

function cO(a,b) {
	if (!b) { oO = Math.random(); b = oO; }
	if (b !== oO) { return; }
	eA.pr.style.opacity = a/100;
	if (a < 100) { setTimeout(function() { cO(a+10,b); },70); }
}

function uR(i) {
	var j = fA[i[0]][4][i[1]].slice(0), a = mH(), b = mW(), c = tH*0.88+44, d, hV, wV;
	hV = Math.round(a-c);
	wV = b-(shrink ? 48 : 466);
	if (hV <= 200 || wV <= 250) { return; }
	j[0] += '.jpg';
	d = j[3]/j[4];
	if (d > hV/wV) { wV = Math.round(hV/d); } else { hV = Math.round(wV*d); }
	if (hV > 2*j[3]) { hV = 2*j[3]; wV = 2*j[4]; }
	eA.pr.style.width = wV + 'px';
	eA.pr.style.top = Math.round((a-hV-c)/2+11) + 'px';
	eA.pr.style.left = Math.round((b-wV)/2-11) + 'px';
	eA.pr.innerHTML = '<div class="prx"><div class="prl"><img src="http://imedia.io/photos/' + j[0].replace(/%/g,'-') + '" alt="' + j[1] + '" height="' + hV + '" width="' + wV + '" class="prp" /></div><div>&nbsp;</div><div class="prt" style="top:' + (hV+15) + 'px; width:' + wV + 'px;">' + j[1] + '</div>';
	eA.pr.style.display = 'block';
}

function preview(i) {
	var a;
	if (i[1] === pR) { return; }
	pR = i[1]; a = eA.pr;
	if (i[1] === -1) {
		eA.pr.style.display = 'none';
	} else {
		if (a.filters) { eA.pr.style.filter = 'blendTrans(duration=0.7)'; a.filters.blendTrans.Apply(); }
		uR(i);
		if (a.filters) { a.filters.blendTrans.Play(); } else { cO(10,0); }
	}
}

function bZ() { return mH() > 800 ? 3 : 2; }

function vM(a,b) { return '<div ' + (b ? 'onmouseover="cM(' + a + ');" ' : '') + 'onmouseout="cI = setTimeout(function() { cM(0); },250);"><div class="mclick" onclick="cM(' + (b ? 0 : a) + ');"></div><b class="pl1"></b><b class="pl2"></b><div class="md"><table class="mq"><tr><td class="bv">' + (a === 1 ? mT : 'Go To') + '&nbsp;</td><td class="bv"><div class="micon"></div></td></tr></table></div>' + (b ? b + '<b class="gap"></b>' : '') + '<b class="pl3"></b><b class="pl4"></b></div>'; }

function cM(i) {
	var a = '', b = '', c = i + mT, d, j, tA = ['Street','Terrain','Satellite','Hybrid'], mZ;
	clearTimeout(cI);
	if (wM === c) { return; }
	wM = c;
	if (i === 1) {
		for (j = 0; j < 4; j++) { if (tA[j] !== mT) { a += '<div><a class="mn" onclick="return mapType(\'' + tA[j] + '\');">' + tA[j] + '</a></div>'; } }
	} else if (i === 2) {
		mZ = gZ(); d = jA.length;
		for (j = 0; j < d; j++) { if (!iC(jA[j][3],jA[j][4]) || (mZ !== (jA[j][5] || bZ()))) { b += '<div><a class="mn" onclick="return view(' + j + ');">' + jA[j][0] + '</a></div>'; } }
	}
	eA.mt.innerHTML = vM(1,a);
	eA.vw.innerHTML = vM(2,b);
}

function cY(i) {
	var j = 0;
	if (activemap() && yD !== 2) {
		if (i === 1 || i === 2) {
			if (gO === '') {
				i = '<div>Sorry, ' + siteX + '\'s map is not compatible with&nbsp;your&nbsp;browser.</div>See <a href="/About" title="About ' + siteX + '">About ' + siteX + '</a> for&nbsp;more&nbsp;information.';
			} else if (bA[0] === 'page' || i === 2) {
				i = 'maximi' + (britishX ? 's' : 'z') + 'e';
				i = 'Please ' + (bA[0] === 'atlas' ? i + ' your window for a better&nbsp;viewing&nbsp;experience.' : '<a title="' + i + '" onclick="return fast(\'Map\',0);">' + i + ' the map</a> for&nbsp;a&nbsp;better&nbsp;view.');
			} else {
				i = 'Explore ' + siteX + '\'s interactive map.';
			}
			uY(i);
		} else {
			if (i) {
				yY = i; j = i;
			} else if (sM !== -1 && !(sM === 0 && pX === 3)) {
				yY = 0; j = mA[sM];
			} else {
				j = yY;
			}
			if (j) { if (iC(j[2],j[3])) { uY(1); } else { j = 0; } }
		}
	}
	aU(j);
}

function flash(i,fV) {
	if (siteX !== 'Mapcarta') { eA.n5.className = ''; }
	eA.mz.className = '';
	if (i === 2) {
		setTimeout(function() { if (siteX !== 'Mapcarta') { eA.n5.className = 'e' + fV; } eA.mz.className = 'e' + fV; },250);
	} else {
		clearInterval(fI);
	}
	if (i === 1) { fI = setInterval(function() { flash(2,fV); },500); }
}

function cP() {
	var i = '', j, a, tA = ['1st','2nd','3rd','4th','5th'];
	if (pA.length) {
		a = shrink ? (shrink >= 2 ? 0 : 1) : Math.max(Math.min(Math.floor((mH()-73-Math.round(1.2*tH))/196),pA.length),0);
		eA.pp.className = 'pp' + a;
		for (j = 0; j < a; j++) { i += a === 1 ? ' - <a href="http://wikitravel.org/en/Image:' + pA[0] + '" title="Image Credits" target="_blank" rel="nofollow">Image Credits</a>': (j ? ',' : ' - Image Credits:') + ' <a href="http://wikitravel.org/en/Image:' + pA[j] + '" title="' + tA[j] + ' Image Credits" target="_blank" rel="nofollow">' + tA[j] + '</a>'; }
	}
	eA.te.innerHTML = '<a ' + (uX === 'About' ? 'onclick="return show(\'Guide\');"' : 'href="/About"') + ' title="Content Licensing Terms">Content Licensing Terms</a>' + i;
}

function uP(i) {
	var j, a = '', tA = [];
	if (!gO) { return; }
	if (i) {
		for (j = 0; j < i[0].length; j++) {
			a += '<div class="pi' + j + '"><div class="ppb"><div style="background-image:url(http://t.imedia.io/' + i[0][j][0].replace(/%/g,'-') + '.jpg);" onclick="preview([pR === -1 ? \'' + i[1] + '\' : 0,pR === -1 ? ' + j + ' : -1]);" onmouseover="preview([\'' + i[1] + '\',' + j + ']);" onmouseout="preview([0,-1]);" class="ppp"></div></div></div>';
			tA[j] = i[0][j][2];
		}
		eA.pp.innerHTML = a;
	}
	pA = tA;
	cP();
	eA.pp.style.display = a ? 'block' : 'none';
}

function cH(a) {
	var i = 0, j;
	while (i >= 0) {
		i = a.indexOf('<');
		if (i >= 0) {
			j = a.indexOf('>',i);
			if (j > i) { a = a.substr(0,Math.max(i,0)) + a.substr(j+1); } else { break; }
		}
	}
	while (a.charAt(0) === ' ') { a = a.substr(1); }
	while (a.charAt(a.length-1) === ' ') { a = a.substr(0,a.length-1); }
	return a;
}

function aM(i,j,a) {
	var b = i === 'Booking' ? j.substr(0,j.length-7) : 0;
	j = j.replace(/ & /g,' &amp; ');
	return i === sH ? '<p><span class="button">' + j + '</span></p>' : '<p><a class="button" onclick="' + (b ? 'rX.type = \'' + b.toLowerCase() + '\'; track(\'Booking\',\'' + b + '\',\'Left\',0); '  : '') + 'return ' + (a ? 'show' : 'see') + '(\'' + i + '\');" title="' + j + '">' + j + '</a></p>';
}

function aN(uV,cV,sV,hV,eV,dV,fV) {
	return '<div' + (dV === '' ? '' : ' id="o' + dV + '"') + '><table class="w' + sV + '"><tr><td><a title="' + (eV ? 'Hide' : 'Show ' + cV) + '" class="' + (eV ? 'down' : 'right') + '" onclick="this.className=\'' + (eV ? 'down' : 'right') + ' f' + fV + '\'; return nG([\'' + (uV ? uV + '\',\'' + cV.replace(/'/g,'\\\'') + '\'' : 'Main_Page\',0') + ',' + (eV ? 1 : 0) + ',' + fV + ']);"></a></td><td' + (hV ? ' class="bo"' : '') + '>' + xL('/' + uV,cV.replace(' arrondissement',' arrond.'),cV) + '</td></tr></table></div>';
}

function cN(uV,eV,wV) {
	var i = uV.substr(0,9) === 'Main_Page', j, a, b, c;
	j = aN('',siteX,0,i,eV && i,0,0) + fA[uV][0] + (isNaN(uV) && fA[uV][1] ? aN(fA[uV][1][0],fA[uV][1][1],fA[uV][1][2],1,eV,fA[uV][1][2],10) : '') + (eV ? fA[uV][2] : '');
	flash(0,0);
	if (siteX !== 'Mapcarta') { eA.n5.innerHTML = '<div class="lh">World Navigator</div><div class="wn">Select triangles to navigate</div>' + j.replace(/ id="o[\d]{1,2}"/gi,''); }
	eA.ms.innerHTML = '<div class="xo">' + j.replace(/ id="o/gi,' id="s') + '</div>';
	dO = 1; oR();
	eA.mz.innerHTML = j;
	aF();
	if (!activemap()) { return; }
	if (wW && gO) {
		if (!isNaN(uV) || (urlX !== uX && uV === uX)) {
			i = fA[uV][3].split('.*.');
			a = i[0];
			b = 2;
			while (i.length > b) {
				a += xL('/' + i[b-1],i[b],i[b]);
				if (i[b+1]) { a += i[b+1]; }
				b = b+3;
			}
			uY(xL((siteX === 'Mapcarta' ? '' : 'http://mapcarta.com') + '/' + (isNaN(uV) ? urlX : enC(uV)),isNaN(uV) ? nameX : fA[uV][1][1],isNaN(uV) ? nameX : fA[uV][1][1]) + a + '.');
		} else if (fA[uV][3] && uV !== 'Main_Page') {
			i = fA[uV][1][1];
			a = i.replace(/\s\(.+\)$/,'').replace(/^.+\//,'');
			b = xL('/' + fA[uV][1][0],a,a);
			c = fA[uV][3].replace(/<a/g,'H3R3<a').replace(/<\/a>/g,'</a>H3R3').split('H3R3');
			j = c.length;
			while (j--) { if (c[j].substr(0,2) !== '<a') { c[j] = c[j].replace(a + ' ',b + ' ').replace(a + ',',b + ','); } }
			if (wV) { uY(c.join('') + ' ' + xL('/' + fA[uV][1][0],bS(i) + '<b class="agap">&nbsp;</b><b class="guillemet">»</b>',i)); }
		} else {
			uY(0);
		}
	}
	uP([fA[uV][4],fA[uV][1][0]]);
	wW = 1;
}

function uN(uV,cV,eV) {
	var i, j, a = 1, b = 1, c, d, e, f, g, xV, tA = ['','',''], wV = wW;
	if (!uV) {
		uV = sM === -1 ? fU : mA[sM][1];
		cV = nS(sM === -1 ? (mX ? aX : '') : mA[sM][0]);
	}
	if (nN !== uV) { flash(0,0); }
	nN = uV;
	if (fA[uV]) {
		cN(uV,eV,1);
	} else {
		if (activemap() && wV) { uY(0); }
		ajax(
			'/dynamic/navigation6.php?c=' + uV + '&r=' + Math.floor(1000000000*Math.random()), function(rV) {
				if (rV) {
					if (!fA[uV]) {
						xV = rV.getElementsByTagName('f'); j = xV.length;
						for (i = j-1; i >= 0; i--) { tA[0] += aN(xV[i].getAttribute('u'),xV[i].getAttribute('c'),j-i,0,0,b++,a++); }
						j++;
						if (cV) { tA[1] = [uV,cV,j]; if (isNaN(uV)) { j++; b++; } }
						a = 11;
						xV = rV.getElementsByTagName('k');
						f = xV.length;
						for (i = 0; i < f; i++) {
							c = xV[i].getAttribute('u').split('|');
							d = xV[i].getAttribute('c').split('|');
							g = c.length; if (g === d.length) { for (e = 0; e < g; e++) { tA[2] += aN(c[e],d[e],j+(e ? 2 : 0),0,0,b++,a++); } }
						}
						xV = rV.getElementsByTagName('c');
						tA[3] = urlX !== uX && uV === uX ? ' is in .*.' + uX + '.*.' + cX + '.*.' : xV[0].getAttribute('s').replace(/\[aNd\]/g,'&');
						tA[4] = xV[0].getAttribute('f');
						if (tA[4]) {
							tA[4] = tA[4].split('||'); f = tA[4].length;
							for (i = 0; i < f; i++) { tA[4][i] = tA[4][i].split('|'); }
						}
						fA[uV] = tA;
					}
					if (uV === nN) { cN(uV,eV,wV); }
				}
			}
		);
	}
}

function xC() {
	var i, j = 2, a, b, c, d, e, f;
	if (nA[sH] === 1) {
		i = eA.xc.innerHTML;
		while (j < 5) {
			a = 1; e = ''; b = f = 0;
			while (a > 0) {
				a = i.substr(b).search(new RegExp('<div[^<>]+class=["]{0,1}h' + j + '[^<>]*>','i'));
				if (a > 0) {
					b = a+b;
					a = i.indexOf('>',b);
					if (a > 0) {
						a++;
						d = i.substring(b,a).match(/h[0-9]{4}/i);
						if (d) {
							c = i.substr(a).search(/<\/div>/i);
							if (c > 0) { e += aM(d.toString().substr(1),cH(i.substr(a,c)),0); f++; }
						}
					}
					b++;
				}
			}
			if (f > 2) { break; } else { j++; }
		}
		nA[sH] = e ? '<div class="lh">Contents</div>' + e : 0;
	}
	eA.n3.innerHTML = nA[sH] || '';
	eA.n3.style.display = nA[sH] ? 'block' : 'none';
	oR(); uN(0,0,1);
}

function uB(i) {
	var sW = map.getBounds().getSouthWest(), nE = map.getBounds().getNorthEast(), j;
	sB = sW.lat(); wB = sW.lng(); nB = nE.lat(); eB = nE.lng();
	if (!i) { return; }
	i = eB-wB+(wB > eB ? 360 : 0);
	if (i >= 180) {
		wBx = -180; eBx = 180;
	} else {
		i = i/2; j = wB-i; wBx = j < -180 ? j+360 : j; j = eB+i; eBx = j > 180 ? j-360 : j;
	}
	i = (nB-sB)/2;
	sBx = Math.max(sB-i,-85.051);
	nBx = Math.min(nB+i,85.051);
}

function iB(tV,nV,zV,zB) { return tV >= sB && tV <= nB && (wB < eB ? nV >= wB && nV <= eB : nV >= wB || nV <= eB) && zV < zB; }

function xB(tV,nV,zV,zB) { return tV >= sBx && tV <= nBx && (wBx < eBx ? nV >= wBx && nV <= eBx : nV >= wBx || nV <= eBx) && zV < zB; }

function cD(tV,nV) {
	var i, j = -1, dV, cV, a, b, c = 57.2958, d, zB = 10*(gZ()+1);
	uB(0);
	cV = mH()*mW()/(Math.pow(2,gZ()-2)*2500000);
	a = tV/c; d = mA.length;
	for (i = (pX === 3 ? 1 : 0); i < d; i++) {
		b = mA[i][2]/c;
		dV = Math.acos(Math.sin(a)*Math.sin(b)+Math.cos(a)*Math.cos(b)*Math.cos((mA[i][3]-nV)/c));
		if (isNaN(dV)) { dV = 0; }
		if (dV < cV) {
			if (iB(mA[i][2],mA[i][3],mA[i][6],zB)) {
				if (i !== sM || (!iC(mA[i][2],mA[i][3]) || eA.ab.style.display === 'none')) { cV = dV; j = i; }
			}
		}
	}
	return j;
}

function gM(tV,nV,i,zV) { return new Gm(new GLatLng(tV,nV),isNaN(i) ? 25 : iI(i),zV); }

function uS(i) {
	if (!gO || i === sM) { return; }
	if (tM) { map.removeOverlay(tM); }
	if (sM !== -1) { if (mA[sM][5]) { mA[sM][5].setIcon(iI(mA[sM][6]),0); } }
	sM = i;
	if (i === -1) {
		uY(0);
	} else if (mA[i][5]) {
		mA[i][5].setIcon(25,1);
		tM = gM(mA[i][2],mA[i][3],'x',987654329);
		map.addOverlay(tM);
	}
}

function wL(i) { if (i > wE) { eA.mg.className = 'wait'; } }

function rM() {
	var i = new Date().getTime();
	sA = [];
	iD = Math.floor(Math.random()*9876543210+i);
}

function nM(uV) { return (sM === -1 ? 1 : uV !== mA[sM][1]) && uV !== fM; }

function xM(a) {
	var i = 0;
	if (!sA[a][6]) {
		i = gM(sA[a][2],sA[a][3],sA[a][7],sA[a][5]);
		map.addOverlay(i);
	}
	return [sA[a][0],sA[a][1],sA[a][2],sA[a][3],sA[a][4],i,i ? sA[a][7] : 0];
}

function rC(tV,nV) {
	if (iC(tV,nV)) {
		cL();
		cY(0);
		eA.blunt.style.display = 'none';
	} else {
		map.panTo(new GLatLng(tV,nV));
	}
}

function goTo(gT,pT) {
	if (!gO) { return false; }
	gT = gT === -1 ? cD(pT.y,pT.x) : gT;
	if (gT === -1) {
		rC(pT.y,pT.x);
	} else {
		uS(gT);
		uN(0,0,1);
		uB(0);
		if (iB(mA[sM][2],mA[sM][3],mA[sM][6],10*(gZ()+1))) { rC(mA[sM][2],mA[sM][3]); }
	}
	return false;
}

function uM() {
	var mZ, i, j, a, aA = [], dA = [], tA = {};
	if (!activemap()) { return; }
	mZ = gZ();
	if ((pX || spY) && mA.length === 0) {
		sM = 0;
		mA[0] = spY ? [spY[2],spY[3],spY[0],spY[1],12,gM(spY[0],spY[1],'x',987654321),29] : [nameX,uX,tX,nX,zX,pX === 1 ? gM(tX,nX,'x',987654321) : 0,29];
		if (mA[0][5]) { map.addOverlay(mA[0][5]); }
		if (spY) { goTo(0,0); } else { aU(mA[0]); }
	}
	uB(1);
	i = sA.length;
	while (i--) {
		if (sA[i][6] ? (xB(sA[i][2],sA[i][3],0,1) && (sA[i][4] < mZ+4) && sA[i][4] > mZ-2) : xB(sA[i][2],sA[i][3],sA[i][7],10*(mZ+1))) {
			if (nM(sA[i][1])) { aA.push(i); }
		}
	}
	i = aA.length;
	while (i--) { tA[sA[aA[i]][1]] = i; }
	i = mA.length;
	while (i--) {
		if (i !== sM && (uX ? mA[i][1] !== uX : 1) && (spY ? mA[i][1] !== spY[3] : 1)) {
			if (tA.hasOwnProperty(mA[i][1])) {
				aA.splice(tA[mA[i][1]],1);
			} else {
				dA.push(i);
			}
		}
	}
	i = dA.length; j = aA.length; a = 0;
	while (i--) {
		if (mA[dA[i]][5]) { map.removeOverlay(mA[dA[i]][5]); }
		mA[dA[i]] = a < j ? xM(aA[a++]) : [0,0,987,987,0,0,0];
	}
	for (a; a < j; a++) { mA.push(xM(aA[a])); }
}

function mE() {
	var iT, xV, i, j, mZ = gZ();
	mO = 0;
	eA.blunt.style.display = 'none';
	uM();
	uB(1);
	if (Math.abs((sO-sBx)/(nO-sO)) > 0.2 || Math.abs((wO-wBx)/(eO-wO)) > 0.1 || Math.abs((nO-nBx)/(nO-sO)) > 0.2 || Math.abs((eO-eBx)/(eO-wO)) > 0.1 || zO !== mZ) {
		sO = sBx; wO = wBx; nO = nBx; eO = eBx; zO = mZ;
		if (sA.length > 2500) { rM(); }
		iT = iD; j = wN; wN++;
		ajax(
			'/dynamic/markers.php?i=' + iT + '&s=' + sBx + '&w=' + wBx + '&n=' + nBx + '&e=' + eBx + '&z=' + gZ() + '&r=' + Math.floor(1000000000*Math.random()), function(rV) {
				if (rV && iT === iD) {
					xV = rV.getElementsByTagName('m');
					i = xV.length;
					if (i) {
						while (i--) { sA.push([xV[i].getAttribute('c'),xV[i].getAttribute('u'),parseFloat(xV[i].getAttribute('t')),parseFloat(xV[i].getAttribute('n')),parseFloat(xV[i].getAttribute('z')),xV[i].getAttribute('p'),parseFloat(xV[i].getAttribute('j')),xV[i].getAttribute('x')]); }
						uM();
					}
					clearTimeout(wA[j]);
					if (wE < j) { wE = j; eA.mg.className = ''; }
				}
			}
		);
		wA[j] = setTimeout(function() { wL(j); },2500);
	}
}

function rS() {
	oR();
	if (!activemap()) { return; }
	eA.mg.style.top = (Math.floor(mH()/2)-11) + 'px';
	eA.mg.style.left = (Math.floor(mW()/2)-11) + 'px';
	if (oK === 2) {
		map.checkResize();
		uY(0); cL();
		lE.style.top = lE.style.left = '0';
		map.addControl(zS);
		if (gO) { cP(); mE(); eA.pr.style.display = 'none'; cY(yD ? (iM() ? 0 : 2) : 1); }
	}
}

function gG(i) {
	var j, a = i === 'none', b, c;
	c = a ? 'page' : 'gallery';
	if (bA[0] !== c) {
		if (subpageX === 'Gallery' && a) { reloadpage(''); return false; }
		historyupdate(a ? bK : 'Gallery');
		if (typeof(i) === 'object' && oX) {
			b = i[0].substr(0,i[0].length-4);
			j = iX.length;
			while (j--) { if (iX[j][0] === b) { i = j; break; } }
		}
		if (a) {
			clearTimeout(pI); eA.gg.className = '';
		} else {
			pI = setTimeout(function() { eA.gg.className = 'preload'; },2000);
		}
		changeview(c); rS();
		if (a) { eA.gg.innerHTML = ''; gK = [false,false]; return false; }
	}
	tG = i; uG();
	return false;
}

function kG(e) {
	var i = e.keyCode || 0;
	if (i === 27) { gG('none'); }
	if (i !== 37 && i !== 39) { return; }
	if (gK[0] === false || gK[1] === false) { return; }
	gG(gK[i === 37 ? 0 : 1]);
}

function vD(i) {
	var j = i ? 'video' : 'page';
	if (j === bA[0]) { return; }
	historyupdate(i ? 'Video' : bK); changeview(j); oR();
}

function vL() {
	var i = [];
	if (sH !== 'Guide') { return; }
	if (!lS || !oK) { setTimeout(vL,100); return; }
	if (mX || lX === 'Phrasebook') { i.push(aX + ' travel'); }
	if (kX && (!i || kX !== aX)) { i.push(kX + ' travel'); }
	i.push('travel guide watchmojo');
	vbstart(gE('vb'),gE('vp'),i,8,oR,vD);
}

function hD() { return (jX[lA[0]][1] || 'Top') + ' ' + (lA[1] || 'Travel') + ' Deals'; }

function qD() { return '<table><tr><td class="deal1 bv">Show deals for</td><td class="bv"><div class="wizbase"><input maxlength="50" value="Enter destination" onfocus="wizevent(this,0);" onkeydown="wizevent(this,event);" onblur="wizpop(0);" class="wizmedium wizisdeal" autocomplete="off" /><div class="wizpop"></div></div></td><td class="bv"><a title="Go" class="deal3" onclick="return false;"></a></td></tr></table>'; }

function lD(i,j) { return '<a class="button" onclick="return deals(' + (i ? "'" + i + "'" : 0) + ');" title="' + j + '">' + bS(j) + '</a>'; }

function sD() {
	var i = [], j, tA = ['Hotel','Package','Flight','Car','Cruise'];
	for (j = 0; j < 5; j++) { if (tA[j] !== lA[1]) { i.push(lD(tA[j],tA[j] + ' Deals')); } }
	return '<div class="dq">' + (sH === 'Deals' ? '' : lD(lA[1],'More ' + (lA[1] ? lA[1] + ' ' : '') + 'Deals')) + (lA[1] ? lD(0,'All Deals') : '') + i.join('') + '</div>';
}

function dD(dV) {
	var i, j, a, b, c = '', d;
	i = gE('dh'); if (i) { i.innerHTML = hD(); }
	i = gE('deal'); if (i) { i.innerHTML = qD(); i.className = 'mj'; }
	i = gE('ds'); if (i) { i.innerHTML = sD(); }
	i = gE('dd');
	if (!i) { return; }
	if (dV) {
		if (dV === 'none') {
			i.innerHTML = '<p>Sorry, no travel deals are available.</p>';
		} else {
			d = dV.length;
			for (j = 0; j < d; j++) {
				a = dV[j]; b = a[2].toLowerCase();
				c += '<a class="da mj" href="' + a[1] + '" title="'+ a[0] + '"><b class="' + (b === 'hotel' || b === 'flight' || b === 'package' || b === 'car' || b === 'cruise'  ? b : 'home') + '"></b><span class="dr"><span class="dw">'  + a[0] + ' — ' + a[3] + '<b class="agap">&nbsp;</b><b class="guillemet">»</b></span><span class="dt">' + a[5] + ', ' + a[4] + (a[6] ? ', ' + a[6] + '% off' : '') + '</span></span></a>';
			}
			i.innerHTML = c + '<div class="gap visualClear"></div>' + (sH === 'Deals' ? '<div class="si">Deals by BookingBuddy &nbsp; * Taxes and fees may be extra</div>' : '');
		}
	} else {
		i.innerHTML = '<p>Sorry, travel deals are currently unavailable.</p>';
	}
}

function uD() {
	var i, j = sH, a, b, c, d, xV, tA = ['Title','URL','DealType','Destination','Price','SourceAdvertiserName','PercentageOff'], dV = [];
	i = gE('dd');
	if (i) {
		a = lA[0]; b = lA[1]; c = lA[2];
		ajax(
			'/dynamic/deals2.php?a=' + jX[a][0] + '&b=' + b + '&c=' + c + '&d=iGuide' + (northernamericaX ? '-NA' : '') + (testX ? '&test=1' : '') + '&r=' + Math.floor(1000000000*Math.random()), function(rV) {
				if (lA[0] === a && lA[1] === b && lA[2] === c && sH === j) {
					if (rV) {
						xV = rV.getElementsByTagName('Deal'); d = xV.length;
						if (d) {
							for (a = 0; a < d; a++) {
								c = [];
								for (b = 0; b < 7; b++) {
									i = xV[a].getElementsByTagName(tA[b])[0];
									if (i) { i = i.childNodes[0]; i = i ? i.nodeValue : 0; }
									if (i) { c.push(i); } else if (b === 6) { c.push(0); }
								}
								if (c.length === 7) { dV.push(c); }
							}
						}
						if (dV.length) {
							dD(dV); oR();
						} else if (lA[0]+1 < jX.length) {
							lA[0]++; uD();
						} else {
							dD('none'); oR();
						}
					} else {
						dD(0); oR();
					}
				}
			}
		);
	}
	oR();
}

function pO(i,c) {
	var j, a = '<div class="pj">', b, d = i.length;
	for (j = 0; j < d; j++) {
		b = i[j][0].replace(/%/g,'-');
		a += '<div class="pc"><div class="pi"><img src="http://t.imedia.io/' + b + '.jpg" alt="' + i[j][1] + '" class="pii" /><a href="http://imedia.io/photos/' + b + '.jpg" onclick="return gG(' + (j+c) + ');" title="Enlarge Image" target="_blank" onmouseover="amplify([this,173]);" onmouseout="xI = setTimeout(function() { amplify(0); },100);" class="pia"></a><b class="pib"></b></div><div class="pt">' + xL('/' + rE(i[j][0]) + '" class="bo',i[j][1],i[j][1]) + '&nbsp;<span class="silver">•</span> <a href="http://wikitravel.org/en/Image:' + i[j][2] + '" title="Image Credits" target="_blank" rel="nofollow">Image&nbsp;Credits</a></div></div>';
	}
	return a + '</div>';
}

function aT(a,b,c,d) {
	var e = c ? 'Map' : sH, f, i, tA = {'google':800,'stumbleupon':800,'delicious':1050,'digg':1050,'orkut':800,'blogger':800,'linkedin':600,'googlebuzz':700};
	f = e === 'Photos' ? oX !== 'Featured' : (e === 'Deals' ? jX.length > 1 : (i === 'Map' ? pX : 1));
	i = 'http://www.addthis.com/bookmark.php?v=250&amp;pub=ra-4db086e974740707&amp;lng=en' + (a === 'addthis' ? '' : '&amp;s=' + a) + '&amp;url=http%3A%2F%2F' + domainX + (f ? '/' + urlX : '') + (d ? '/' + d[0] : '%23/' + e) + '&amp;title=' + (d ? d[1] : (f ? soX : siteX + (siteX === 'iGuide' ? '%20Interactive%20Travel%20Guide' : '')) + '%20-%20' + e);
	return '<a class="' + a + '" href="' + i + '" rel="nofollow" title="' + b + '" target="_blank" onclick="track(\'Share\',\'' + (c ? 'Map' : 'Bottom') + '\',\'' + a + '\',0); window.open(\'' + i + '\',\'\',\'width=' + (tA[a] || 500) + ',height=500,top=0,left=0,scrollbars=yes,resizable=yes\'); return false;"></a>';
}

function hU(i,j) { return j ? i.replace(/ class="h3/g,' class="h2').replace(/ class="h4/g,' class="h3').replace(/ class="h5/g,' class="h4') : i.replace(/ class="h4/g,' class="h2').replace(/ class="h5/g,' class="h3'); }

function eD(i,j) { return '<div class="edit visualClear"><form name="editform" action="/edit.php" method="post" target="_blank" class="editform"><input type="hidden" name="u" value="' + i + '" /><a title="Edit or add to this article" onclick="track(\'Edit\',\'' + j + '\',\'' + i + '\',0); document.editform.submit(); return false;" class="button">Edit or add to this article</a></form></div>'; }

function fS(i) {
	var j;
	if (qA[0] && qA[1] && qA[0].length === qA[1].length) {
		for (j = qA[0].length-1; j >= 0; j--) { if (qA[0][j] === i) { return hU(qA[1][j],i.indexOf('/') !== -1 ? 0 : 1) + eD(uX,'Guide'); } }
	}
	return '<div class="ll"></div>';
}

function hG(i) { var j; for (j = titlesX.length-1; j >= 0; j--) { if (titlesX[j][0] === i) { return titlesX[j][1]; } } return i; }

function sQ() {
	var i;
	if (!readmore) { return; }
	i = gE('summary');
	if (i) {
		i.className = 'naked';
		i.innerHTML = fS(sX) + '<div class="k3"></div>'; rS();
	}
}

function sG() {
	var i;
	if (qA[0]) { sQ(); return; }
	ajax(
		'/dynamic/sections.php?u=' + uX + '&r=' + Math.floor(1000000000*Math.random()), function(rV) {
			if (rV && !qA[0]) {
				eval('qA = (' + rV + ')');
				sQ();
				i = gE('reader'); if (sH === rR && i) { i.innerHTML = fS(rR); rS(); }
			}
		}
	);
}

function gC(i) {
	var a, b = '', c = 0, d, tA = [['']], sV;
	if (!contentsX) { return; }
	for (a = 0; a < contentsX.length; a++) {
		d = contentsX[a];
		if (typeof(d) === 'object') {
			if (!tA[c]) { tA[c] = ['']; }
			tA[c][0] += d[2] === i ? '<span class="' + (d[1] ? 'h3' : 'subsection button') + '">' + d[0] + '</span>' : '<a href="/' + uX + '/' + d[2] + '" title="' + d[0] + '" class="' + (d[1] ? 'h3' : 'subsection button') + '" onclick="return fast(\'' + d[2] + '\',0);">' + d[0] + '</a>';
		} else {
			tA[c][0] += '<div class="k2"></div>';
			tA[c][1] = d;
			c++;
		}
	}
	sV = 0;
	for (a = 0; a < tA.length; a++) { sV += tA[a][1]; }
	d = Math.min(Math.floor(sV/2),sV-tA[tA.length-1][1]-1);
	c = 0;
	for (a = 0; a < tA.length; a++) {
		b += tA[a][0];
		if (d !== false) {
			c += tA[a][1];
			if (c > d) { b += '</td><td class="c2">'; d = false; }
		}
	}
	a = nS(aX);
	return '<div class="h2 nbm visualClear">' + a + (mX ? ' Travel Guide' : '') + '</div><div class="si">Select a section to browse the ' + (mX ? a + ' travel guide' : a + ' guide') + '</div><div class="cc"><table><tr><td class="c1">' + b + '</td></tr></table></div><div class="k1"></div>';
}

function uC() {
	var i = sH, j, hV, tV, cV = 0, xV = 0, lV = 1, gV = 0;
	if (i === 'Photos') {
		lA = [0,dT,6];
		hV = oX + ' Photos';
		tV = '<div class="gap"></div><p>Please select an image to open the <a title="photo gallery" onclick="return gG(0);">photo gallery</a>.</p><div class="gap"></div>' + pO(iX,0) + (oX2 ? '<h2>' + oX2 + ' Photos</h2>' + pO(iX2,iX.length) : '') + (oX3 ? '<h2>' + oX3 + ' Photos</h2>' + pO(iX3,iX.length+iX2.length) : '');
		eA.n3.style.display = 'none';
	} else if (i === 'Deals') {
		lA = [0,dT,15];
		hV = hD();
		tV = '<div class="k3"></div><table><tr><td><div id="deal" class="mj">' + qD() + '</div></td></tr></table><div class="k3"></div><div id="ds">' + sD() + '</div><div id="dd"><div class="dl"></div></div>';
	} else if (i === 'Hotels' || i === 'Flights') {
		j = i === 'Hotels';
		lA = [0,j ? 'Hotel' : 'Flight',8];
		rX.type = j ? 'hotel' : 'flight';
		cV = j ? hX : fX;
		hV = pX && cV ? (cV === 1 ? cX : cV) + ' ' + i : i;
		if (xA.hasOwnProperty('hx')) {
			xV = xA[j ? 'hc' : 'fc'];
			tV = wizwidget(1) + '<div class="gap"></div><div class="naked">' + hU(xA[j ? 'hx' : 'fx'],j) + '</div>' + eD(xV[1],i);
		} else {
			tV = '<div class="gap"></div><div class="ll"></div>';
			lV = 0;
			eA.n3.style.display = 'none';
		}
	} else {
		rR = i;
		j = i.match(/hotel/i) ? 1 : (i.match(/flight|plane|getting/i) ? 2 : 0);
		lA = [0,j === 2 ? 'Flight' : 'Hotel',8];
		if (j) { rX.type = j === 2 ? 'flight' : 'hotel'; }
		xV = [creditsX,uX];
		cV = 1;
		hV = hG(i);
		tV = (j ? wizwidget(1) + '<div class="gap"></div>' : '<div class="k1"></div>') + '<div id="reader" class="naked">' + fS(i) + '</div>' + gC(i) + (j ? '' : wizwidget(0));
		lV = qA[0] ? 1 : 0;
		gV = [i,hV];
	}
	if (gX) {
		j = hV.replace(/ [^ ]+$/,'').length+1;
		hV = hV.substr(0,j) + '<span class="nowrap inline">' + hV.substr(j) + '<span id="pageplus" class="titleplus"></span></span>';
	}
	tV = '<div ' + (i === 'Deals' ? 'id="dh" ' : '') + 'class="h1">' + hV + '</div>' + dM + tV + '<div class="gap visualClear"></div>';
	if (lV) {
		if (i === 'Photos' || i === 'Deals') { tV += wizwidget(0); }
		if (siteX === 'iGuide' && i === 'Hotels') { tV += '<div class="k2"></div><div id="dh" class="h2 nbm">' + hD() + '</div><div class="si">Deals by BookingBuddy &nbsp; * Taxes and fees may be extra</div><div class="k2"></div><table><tr><td><div id="deal" class="mj">' + qD() + '</div></td></tr></table><div id="dd"><div class="dl"></div></div><div id="ds">' + sD() + '</div>'; }
	}
	eA.n2.innerHTML = '<div class="lh">' + (vX ? aX : siteX) + '</div>' + aM('Guide',lX === 'Guide' ? (siteX === 'iGuide' ? 'Travel Guide' : (uX ? 'Tourist Information' : 'Home')) : (lX === 'Search' ? 'Search Results' : lX),1) + (oX ? aM('Photos','Photos',1) : '') + aM('Map',(siteX === 'iGuide' ? 'Interactive' : 'Tourist') + ' Map',1) + (hX ? aM('Hotels','Hotel Information',1) : '') + (fX ? aM('Flights','Flight Information',1) : '') + (siteX === 'iGuide' ? aM('Deals','Travel Deals',1) : '') + aM('Booking','Hotel Search',1) + aM('Booking','Flight Search',1) + aM('Booking','Car Search',1);
	eA.xc.innerHTML = tV + '<div class="sob mj"><div class="so">' + aT('facebook','Share on Facebook',0,gV) + aT('twitter','Tweet This',0,gV) + aT('google','Add to Google Bookmarks',0,gV) + aT('myspace','Share on MySpace',0,gV) + aT('stumbleupon','Share on StumbleUpon',0,gV) + aT('delicious','Share on Delicious',0,gV) + aT('digg','Digg This',0,gV) + aT('orkut','Share on Orkut',0,gV) + aT('blogger','Blog This',0,gV) + aT('reddit','Share on Reddit',0,gV) + aT('linkedin','Share on Linkedin',0,gV) + aT('tumblr','Share on Tumblr',0,gV) + aT('googlebuzz','Buzz This',0,gV) + aT('email','Email This',0,gV) + aT('addthis','More Choices',0,gV) + '</div></div><div class="mh">' + (siteX === 'iGuide' ? 'iGuide, the Interactive Travel Guide' : 'Everything You need to travel, all in one place') + '. <a href="/About" title="About ' + siteX + '">About&nbsp;' + siteX + '</a>.</div><div class="le">' + (xV ? 'Based on ' + (cV ? '<a href="http://wikitravel.org/en/' + xV[1] + '" title="' + (cV === 1 ? cX : cV) + '" target="_blank" rel="nofollow" class="it">' + (cV === 1 ? cX : cV) + '</a>' : 'work') + ' by ' + xV[0] + ', ' + siteX + ' and <a href="http://wikitravel.org/wiki/en/index.php?title=' + xV[1] + '&amp;action=history" title="Authors" target="_blank" rel="nofollow">others</a>. ' : '') + 'Content is available under <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-ShareAlike 3.0" target="_blank" rel="nofollow">Creative Commons Attribution-ShareAlike 3.0</a>. See <a href="http://wikitravel.org/en/Image:' + bX + '" title="background image credits" target="_blank" rel="nofollow">background image credits</a>.</div>';
	plusone(1);
	uD();
	if (lV) { xC(); }
	if (gV) {
		sG();
	} else if ((i === 'Hotels' || i === 'Flights') && !xA.hasOwnProperty('hx')) {
		ajax(
			'/dynamic/contents2.php?u=' + uX + '&r=' + Math.floor(1000000000*Math.random()), function(rV) {
				if (rV && !xA.hasOwnProperty('hx')) { eval('xA = (' + rV + ')'); if (sH === 'Hotels' || sH === 'Flights') { uC(); } }
			}
		);
	}
}

function uL(lL) {
	var iL, i, j, a, b;
	if (mO) { return; }
	iL = cD(lL.lat(),lL.lng());
	if (iL !== -1 && sL) {
		if (iL !== lB) {
			i = map.fromLatLngToDivPixel(new GLatLng(mA[iL][2],mA[iL][3]));
			j = map.fromLatLngToDivPixel(map.getCenter());
			lE.innerHTML = '<table onclick="return goTo(\'' + iL + '\',0);"><tr><td class="lbd">' + bS(mA[iL][0]) + '</td></tr></table>';
			a = lE.offsetHeight;
			b = Math.floor(mH()/2);
			lE.style.top = Math.max(Math.min(i.y+Math.floor(a/-2),j.y+b-a-2),j.y-b+2) + 'px';
			a = lE.offsetWidth;
			if (mA[iL][5]) {
				lE.style.left = (i.x+(i.x > j.x ? -9-a : 9)) + 'px';
			} else {
				b = Math.floor(mW()/2);
				lE.style.left = Math.max(Math.min(i.x+Math.floor(a/-2),j.x+b-a-2),j.x-b+2) + 'px';
			}
			if (lB !== -1) { if (mA[lB][5]) { mA[lB][5].setIcon(iI(mA[lB][6]),0); } }
			if (mA[iL][5] && iL !== sM) { mA[iL][5].setIcon(10+iI(mA[iL][6]),1); }
			lB = iL;
		}
	} else {
		cL();
	}
}

function bC() {
	clearTimeout(jI);
	eA.blunt.style.display = 'block';
	jI = setTimeout(function() { eA.blunt.style.display = 'none'; },2000);
}

function qL(i,j) { return '<a ' + fL[0] + ' rel="nofollow" title="' + i + '" onclick="track(\'Featured\',\'' + fL[7] + '\',\'' + uX + '\',0); return true;">' + j + '</a>'; }

function aL(i) { return i.replace(/\[([^\]]+)\]/g,qL('$1','$1')); }

function aP(i,j) { eA[i] = document.createElement('div'); eA[i].className = i; j.appendChild(eA[i]); }

function iO(i) { return 'this.style.backgroundPosition = \'' + (i*18) + 'px -169px\';'; }

function lZ(i) { return '<a ' + (i ? 'class="jz" ' : '') + 'title="Zoom ' + (i === -1 ? 'Out' : 'In') + '" onclick="return zoomTo(\'' + (i === -1 ? '-' : '+') + '\');"' + (i ? ' onmouseover="' + iO(i-2) + '" onmouseout="' + iO(i-1) + '"' : '') + '></a>'; }

function uZ() {
	var mZ = gZ(), i, j = '';
	i = Math.min(171-mZ*9,152);
	dZ.top = i; kZ.style.top = i + 'px';
	for (i = 19; i >= 2; i--) { j += i === mZ ? '</div><div class="dz"><div class="ez"><div class="fz"></div></div></div><div>' : '<a class="az" title="Zoom ' + (i > mZ ? 'In' : 'Out') + '" onclick="return zoomTo(' + i + ');"><div class="ez"><div class="fz"></div></div></a>'; }
	xZ.innerHTML = '<div>' + j + '</div>';
}

function tZ() { return Math.round((171-dZ.top)/9); }

function zZ() { zoomTo(tZ()); uZ(); }

function lM() {

	var i;

	if (GBrowserIsCompatible()) {

		rM();

		map = new GMap2(gE('map'), { draggableCursor:'pointer' });
		if (zX === 2) { zX = bZ(); }

		Gm.prototype = new GOverlay();

		Gm.prototype.initialize = function(map) {
			var i = document.createElement('div');
			i.className = 'g' + this.icon;
			i.style.zIndex = this.zIndex;
			map.getPane(G_MAP_OVERLAY_LAYER_PANE).appendChild(i);
			this.map_ = map;
			this.div_ = i;
		};

		Gm.prototype.remove = function() { this.div_.parentNode.removeChild(this.div_); };

		Gm.prototype.redraw = function(i) {
			i = this.map_.fromLatLngToDivPixel(this.latLng);
			this.div_.style.left = (i.x-8) + 'px';
			this.div_.style.top = (i.y-8) + 'px';
		};

		Gm.prototype.setIcon = function(i,j) { this.div_.className = 'g' + i; this.div_.style.zIndex = j ? 987654325 : this.zIndex; };

		Zs.prototype = new GControl();

		Zs.prototype.initialize = function(map) {
			var i;
			cZ = document.createElement('div'); cZ.style.visibility = gO ? 'visible' : 'hidden'; cZ.className = 'cz';
			i = document.createElement('div'); i.className = 'iz'; i.innerHTML = lZ(1); cZ.appendChild(i);
			i = document.createElement('div'); i.className = 'oz'; i.innerHTML = lZ(-1); cZ.appendChild(i);
			i = document.createElement('div'); i.className = 'sz'; cZ.appendChild(i);
			xZ = document.createElement('div'); xZ.className = 'xz'; i.appendChild(xZ);
			kZ = document.createElement('div'); kZ.className = 'kz'; i.appendChild(kZ);
			dZ = new GDraggableObject(kZ, { container:i });
			cZ.onmouseover = function() { sL = 0; cL(); }; cZ.onmouseout = function() { sL = 1; };
			map.getContainer().appendChild(cZ);
			uZ();
			GEvent.addListener(map,'zoomend',uZ);
			GEvent.addListener(dZ,'dragend',zZ);
			setTimeout(function() { cZ.style.visibility = 'visible'; },1000);
			return cZ;
		};

		Zs.prototype.getDefaultPosition = function() { return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(shrink ? 12 : 223,(shrink ? eA.mm.offsetHeight : Math.round(tH*1.2))+25)); };

		zS = new Zs();

		lE = document.createElement('div');
		lE.className = 'lb';
		map.getPane(G_MAP_MARKER_PANE).appendChild(lE);

		aP('ab',map.getPane(G_MAP_FLOAT_SHADOW_PANE));
		for (i = 1; i < 9; i++) { aP('a' + i,eA.ab); }

		oK = 2; window.onresize = rS; rS();
		eA.mg.className = '';

		i = gE('mapsocial');
		i.innerHTML = '<div class="at">' + aT('facebook','Share on Facebook',1,0) + aT('twitter','Tweet This',1,0) + aT('google','Add to Google Bookmarks',1,0) + aT('email','Email This',1,0) + aT('addthis','More Choices',1,0) + '</div><div id="mapplus"></div><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2F' + domainX + '&amp;layout=button_count&amp;show_faces=false&amp;width=84&amp;action=like&amp;colorscheme=light&amp;font=lucida-grande&amp;height=20&amp;locale=en_' + (britishX ? 'GB' : 'US') + '" scrolling="no" frameborder="0" allowtransparency="true" class="likeframe"></iframe>';
		i.style.visibility = 'visible';
		plusone(0);

		GEvent.addListener(map,'mousemove',uL);
		GEvent.addListener(map,'mouseout',cL);
		GEvent.addListener(map,'click',function(gT,pT) { bC(); goTo(-1,pT); });
		GEvent.addListener(map,'movestart',function() { mS(1); });
		GEvent.addListener(map,'moveend',function() { if (gO) { cY(0); } mE(); });

		map.enableContinuousZoom();
		map.disableGoogleBar();
		map.disableDoubleClickZoom();

		if (spY) {
			map.setCenter(new GLatLng(spY[0],spY[1]), 12, G_HYBRID_MAP);
		} else {
			map.setCenter(new GLatLng(tX,nX), zX, G_HYBRID_MAP);
		}

		gO = 1;

		cM(0);
		eA.mm.style.visibility = 'visible';
		eA.mt.style.visibility = 'visible';
		eA.vw.style.visibility = 'visible';
		cP();

		yD = 0;
		if (!spY) { cY(1); }
		setTimeout(function () { yD = 1; },3000);

	} else {

		gO = '';
		eA.mm.style.visibility = 'visible';
		cY(1);

	}

}

function loadmap() {
	fM = spY ? spY[3] : uX;
	if (!mL) {
		mL = 1;
		uY('Loading, please wait…');
		google.load('maps','2.361',{'other_params':'sensor=false','callback':lM});
	}
}

function setmap() {
	uY(1);
	if (gO) {
		if (spY) {
			map.setCenter(new GLatLng(spY[0],spY[1]),12);
		} else {
			map.setCenter(new GLatLng(tX,nX),zX); wW = 0; cY(1);
		}
	}
	uN(0,0,1);
	if (gO) { uM(); }
}

function show(i) {
	var a;
	if (delay || i === sH) { return false; }
	delay = 1; setTimeout(function() { delay = 0; }, 700);
	if (i === 'Guide') {
		if (sX) {
			window.location.href = 'http://' + domainX + (urlX ? '/' + urlX : ''); return false;
		} else {
			reloadpage(''); return false;
		}
	} else if (i === 'Booking') {
		wizcampaign = wizX; wizsearch(rX.type,1); track('Pages','Booking',bK,0); return false;
	} else {
		a = gE('pagemap');
		if (a) { document.body.appendChild(gE('mapbox')); }
	}
	historyupdate(i);
	nN = 0;
	if (i === 'Map') {
		loadmap();
	} else {
		spY = 0;
		uS(-1);
		uC();
		uP(0);
	}
	changeview(i === 'Map' ? 'atlas' : 'page');
	rS();
	if (i === 'Map') {
		setmap();
	} else {
		if (gO) { uY(0); cL(); yY = 0; mA = []; map.clearOverlays(); }
		if (vV) { vL(); }
	}
	return false;
}

function deals(i) {	var j; dT = i; if (sH === 'Deals') { j = gE('dd'); if (j) { j.innerHTML = '<div class="dl"></div>'; } lA = [0,i,15]; uD(); } else { show('Deals'); } return false; }

function gP(i,c) {
	var j, a = '', b, d = i.length;
	for (j = 0; j < d; j++) {
		b = i[j][0].replace(/%/g,'-');
		a += '<div class="pk"><div class="pi"><a href="http://imedia.io/photos/' + b + '.jpg" onclick="return gG(' + (j+c) + ');" title="' + i[j][1] + '" target="_blank" class="pia"></a><div style="background-image:url(http://t.imedia.io/' + b + '.jpg);" class="pid"></div></div></div>';
	}
	return a;
}

function spy(tV,nV,cV,uV) { spY = [tV,nV,cV,uV]; show('Map'); return false; }

function mapType(i) {
	var tA = {'Street':G_NORMAL_MAP,'Terrain':G_PHYSICAL_MAP,'Satellite':G_SATELLITE_MAP,'Hybrid':G_HYBRID_MAP};
	if (!gO) { return false; }
	if (i !== mT) {
		bA[1] = i === 'Hybrid' || i === 'Satellite' ? 'satellite' : '';
		mT = i; map.setMapType(tA[i]); cB();
	}
	cM(0);
	return false;
}

function see(i) {
	var j = gE('h' + i);
	if (j) { window.scrollTo(0,j.offsetTop); }
	return false;
}

function view(i) {
	var uV = jA[i][1], cV = jA[i][2], tV = jA[i][3], nV = jA[i][4], zV = jA[i][5] || bZ();
	uP(0);
	cM(0);
	uS(-1);
	mS(1);
	yD = 2;
	map.setCenter(new GLatLng(tV,nV),zV);
	yD = 1;
	uN(uV,cV,1);
	cY(jA[i][0] === 'World' ? (iM() ? 0 : 2) : [cV,uV,tV,nV,zV]);
	return false;
}

function nG(i) {
	var j, gT = -1;
	flash(1,i[3]);
	if (i[2]) {
		uN(i[0],i[1],0);
	} else {
		if (activemap() && i[0] !== 'Main_Page') {
			j = mA.length;
			while (j--) { if (i[0] === mA[j][1]) { gT = j; break; } }
		}
		if (gT === -1) {
			uS(-1);
			uN(i[0],i[1],1);
		} else {
			goTo(gT,0);
		}
	}
	return false;
}

function sS() {
	var i, j, a = 0;
	i = gH(); j = gW();
	if (i !== oH || j !== oW) { oH = i; oW = j; a = 1; }
	i = eA.ts.offsetHeight;
	if (i > 2 && i !== tH) { tH = i; aF(); a = 1; }
	if (a) { rS(); setTimeout(rS,500); }
}

function showpage(i) {
	i = i || 'Guide';
	if (!inarray(i,pagesX) || i === sH) { return; }
	if (subpageX === sH && (sH === 'Map' || sH === 'Booking' || sH === 'Gallery')) { reloadpage(i); return; }
	historyskip = 1;
	if (sH === 'Booking') {
		wizdisplay(0);
	} else if (i === 'Gallery' || sH === 'Gallery') {
		gG(i === 'Gallery' ? tG : 'none');
	} else if (sH === 'Video') {
		vbstop();
	} else if (i === 'Video') {
		vbplay(-1);
	} else {
		delay = 0; show(i);
	}
	historyskip = 0;
}

function historychange(i) { showpage(i.path.replace('/','')); }

function amp(i) {
	var a = 0, b, c;
	if (yA[0]) {
		b = yA[0].parentNode.childNodes;
		for (c = 0; c < b.length; c++) { if (b[c].nodeName.toLowerCase().indexOf('img') !== -1) { a = b[c]; } }
	}
	if (a) {
		a.style.width = a.style.height = (yA[1]+2*i) + 'px';
		a.style.margin = (1-i) + 'px';
		if (i && i < 3) { zI = setTimeout(function() { amp(i+1); },70); }
	}
	if (!a || !i) { clearTimeout(zI); yA = [0,0]; }
}

function amplify(a) {
	if (a) { clearTimeout(xI); }
	if (!a) {
		amp(0);
	} else if (a[0] !== yA[0]) {
		if (yA[0]) { amp(0); }
		yA = a; amp(1);
	}
}

function fast(i,j) {
	if (!oK) { fF = [i,j]; return false; }
	if (j === 4) { readmore = 1; sG(); } else if (j === 3) { gG(i); } else if (j === 2) { nG(i); } else if (j) { see(i); } else { show(i); }
	return false;
}

function ready() {

	var i, j;

	if (lO) { return; }
	lO = 1;

	findmap();

	i = gE('mapbox');
	i.innerHTML = '<div id="map"></div><div id="fullmap"><a class="fulla" title="Maximi' + (britishX ? 's' : 'z') + 'e" onclick="return fast(\'Map\',0);"></a></div><div id="blunt"></div><div id="mm"><a href="/" title="' + siteX + '" class="brand"></a><div class="brandf ffa"><form action="/" method="post" class="fff"><input class="ffi" name="s" maxlength="50" value="' + qX + '" title="" onfocus="this.value=\'\';" onblur="if (this.value === \'\') { this.value=\'' + qX + '\'; }" autocomplete="off" /><div class="ffd"><input type="image" class="ffx ffb" src="http://imedia.io/images/search.png" title="Search" alt="Search" /><input type="image" class="ffx ffie" src="http://imedia.io/images/clear.gif" title="Search" alt="Search" /></div></form></div><div id="mx"><div class="xo"><div id="mz"><div class="ml"><img src="http://imedia.io/images/progress3.gif" alt="Please Wait" /></div></div></div></div></div><div id="mt"></div><div id="vw"></div><div id="pp"></div><div id="mg" class="pre">' + lZ(0) + '<img src="http://imedia.io/images/progress4.gif" alt="Please Wait" class="spin" /></div><div id="aa"></div><div id="te"></div><div id="y1"><table><tr><td><div id="y2"><div id="y3"></div></div></td></tr></table></div><div id="pr"></div><div id="ms"></div><div id="mapsocial"></div>';

	wizsethotel(rX.to);

	i = ['blunt','mm','mt','vw','y2','mg','aa','pp','te','pr'];
	while (i.length) {
		j = i.pop();
		eA[j] = gE(j); eA[j].onmouseover = oM;
	}
	i = ['map','mapbox','dm','bw','ts','ms','mz','mx','y1','y3'];
	if (siteX !== 'Mapcarta') { i.push('pagebox','x2','x3','xc','n1','n2','n3','n4','n5','n6','magic','blend','gg'); }
	while (i.length) {
		j = i.pop();
		eA[j] = gE(j);
	}

	oH = gH(); oW = gW(); tH = eA.ts.offsetHeight; setInterval(sS,500);

	if (!subpageX) {

		plusone(1);

		if (uX === 'About') { eA.xc.innerHTML = eA.xc.innerHTML.replace('mail at imedia','mail@imedia'); }

		i = gE('fl');
		if (i) {
			j = dX.length;
			while (j--) {
				fL = dX[j];
				fL[0] = (fL[0].indexOf('@') === -1 ? 'target="_blank" href="http://' : 'href="mailto:') + fL[0] + '"';
				fL[7] = fL[1].replace(/\'/g,'\\\'');
				dX[j] = '<h3>' + fL[1] + '</h3><p class="flp">' + aL(fL[2]) + '</p><div class="flx' + (fL[4].substring(fL[4].length-3) === 'png' ? '' : ' rounded') + '" style="height:' + fL[5] + 'px; width:' + fL[6] + 'px;">' + qL(fL[1] + '" style="background-image:url(/ads/' + fL[4] + ');','') + '</div><table class="flt"><tr><td><div class="mj">' + aL(fL[3]) + '</div></td></tr></table><div class="gap visualClear"></div>';
			}
			i.innerHTML = dX.join('') + '<div class="k4"></div>';
		}

	}

	if (siteX !== 'Mapcarta') {
		eA.n6.innerHTML = '<div id="pbt">' + oX + ' Photos</div>' + gP(iX,0) + (oX2 ? '<div id="pbt2">' + oX2 + ' Photos</div>' + gP(iX2,iX.length) : '') + (oX3 ? '<div id="pbt3">' + oX3 + ' Photos</div>' + gP(iX3,iX.length+iX2.length) : '');
		eA.pbt = gE('pbt');
		if (oX2) { eA.pbt2 = gE('pbt2'); }
		if (oX3) { eA.pbt3 = gE('pbt3'); }
	}

	window.onresize = oR; oR();

	dM = eA.dm.innerHTML.replace(/(<div[^<>]+class[^<>]{1,2})dropyes([^<>]*>)/gi,'$1dropno$2');

	if (siteX !== 'Mapcarta') {
		i = eA.n3.innerHTML;
		if (i.length > 9) { nA.Guide = i; }
	}

	oK = 1;

	if (subpageX) {

		showpage(subpageX);
		document.body.style.visibility = 'visible';

	} else {

		if (fF) { fast(fF[0],fF[1]); }
		uD();
		if (vV) { google.load('search', '1', {'callback' : function() { lS = 1; vL(); }}); }

		if (pagemap) { loadmap(); setmap(); }

	}

	if (titlesX.length && !subpageX) { setTimeout(sG,2000); }

}

function loaded() {
	SWFAddress.addEventListener(SWFAddressEvent.EXTERNAL_CHANGE,historychange);
	if (!subpageX) { SWFAddress.setValue(''); }
	setTimeout(function() { lO = 2; historyexecute(); },10);
}

if (document.addEventListener) { document.addEventListener('DOMContentLoaded',ready,false); }
