function theLobby_getLinks(){var navs=[];$(".lobbyNav a").each(function(){var pos=navs.length;var nav=$("#"+this.id);nav.click(function(){theLobby_curPos=-1;theLobby_hideCurrent(pos);theLobby_isClick=true;return false});navs[pos]=nav});return navs}function theLobby_getContents(){if(!this.theLobby_Contents){var navs=[];$(".lobbyContent div").each(function(){if(this.id.length>9&&this.id.substring(0,9)=="theLobby_"){var content=$("#"+this.id);content.isHiding=false;content.isShowing=false;content.isVisible=this.style.display.toLowerCase()!="none";content.isMovingArrow=false;content.isContinue=false;content.fadeSpeed=500;navs[navs.length]=content}});this.theLobby_Contents=navs}return theLobby_Contents}function theLobby_showCurrent(newPos){var contents=theLobby_getContents();contents[newPos].isShowing=true;if(!theLobby_isClick){fadeInElement(contents[newPos],contents[newPos].fadeSpeed,function(){contents[newPos].isShowing=false;contents[newPos].isVisible=true})}else{fadeInElement(contents[newPos],contents[newPos].fadeSpeed/2,function(){contents[newPos].isShowing=false;contents[newPos].isVisible=true})}}function theLobby_moveArrow(newPos){var posStr=theLobby_arrow[0].style.left;if(posStr.length==0){theLobby_arrow[0].style.left="17px"}var pos=posStr.substring(0,posStr.length-2);var oldPos=pos;switch(newPos){case 0:pos=17;break;case 1:pos=71;break;case 2:pos=129;break;case 3:pos=184;break;case 4:pos=239;break}if(oldPos>=0&&oldPos<39){oldPos=0}else{if(oldPos>=39&&oldPos<100){oldPos=1}else{if(oldPos>=100&&oldPos<156){oldPos=2}else{if(oldPos>=156&&oldPos<201){oldPos=3}else{oldPos=4}}}}var arrowMover=function(){var curPosStr=theLobby_arrow[0].style.left;if(curPosStr.length==0){theLobby_arrow[0].style.left="17px"}var curPos=parseInt(curPosStr.substring(0,curPosStr.length-2));var speed=Math.abs(oldPos-newPos)+4;if(theLobby_isClick){speed=speed*2}if(curPos<pos){if(pos-curPos<speed){curPos=pos}else{curPos+=speed}theLobby_arrow[0].style.left=curPos+"px";setTimeout(arrowMover,40)}else{if(curPos>pos){if(pos-curPos>-speed){curPos=pos}else{curPos-=speed}theLobby_arrow[0].style.left=curPos+"px";setTimeout(arrowMover,40)}else{theLobby_showCurrent(newPos)}}};setTimeout(arrowMover,40)}function theLobby_hideCurrent(newPos){var contents=theLobby_getContents();for(var i=0;i<contents.length;i++){if(i==newPos){continue}if(contents[i].isShowing||contents[i].isHiding||contents[i].isMovingArrow){}else{if(contents[i].isVisible){var j=i;contents[i].isContinue=true;contents[i].isHiding=true;if(!theLobby_isClick){fadeOutElement(contents[i],contents[i].fadeSpeed,function(){contents[j].isHiding=false;contents[j].isVisible=false;theLobby_moveArrow(newPos)})}else{fadeOutElement(contents[i],contents[i].fadeSpeed/2,function(){contents[j].isHiding=false;contents[j].isVisible=false;theLobby_moveArrow(newPos)})}}}}}function theLobby_autoMove(){if(!theLobby_isClick){var contents=theLobby_getContents();if(theLobby_curPos==contents.length-1){theLobby_curPos=0}else{theLobby_curPos++}theLobby_hideCurrent(theLobby_curPos);setTimeout(theLobby_autoMove,5000)}}function theLobby_init(){theLobby_arrow=$(".lobbyArrow");theLobby_isClick=false;theLobby_curPos=0;theLobby_getContents();theLobby_getLinks();var theLobby_header=$("#theLobby_header");theLobby_header.mouseenter(function(){var inNode=theLobby_header;var curNode=inNode[0];var pos={left:208,top:17};var isRelative=true;if(jQuery.browser.msie&&(jQuery.browser.version=="6.0"||jQuery.browser.version=="7.0")){isRelative=false;pos.left=208;pos.top=17}displayPopup(inNode,pos.left,pos.top,"Get an inside look at the world of travel, culture and leisure with our premier travel blog, featuring fascinating articles, short stories and more.",isRelative)}).mouseleave(function(){hidePopup()});setTimeout(theLobby_autoMove,5000)}function fadeOutElement(element,speed,callback){var BG_backgroundElement=null;BG_backgroundElement=document.createElement("div");BG_backgroundElement.style.backgroundColor="#FFFFFF";BG_backgroundElement.style.position="absolute";BG_backgroundElement.style.zIndex=100000;BG_backgroundElement=$(BG_backgroundElement);BG_backgroundElement.appendTo($("body"));BG_backgroundElement[0].style.display="none";BG_backgroundElement.hide();var inElm=element;BG_backgroundElement[0].style.height=element.height()+"px";BG_backgroundElement[0].style.width=element.width()+"px";BG_backgroundElement[0].style.left=element.offset().left+"px";BG_backgroundElement[0].style.top=element.offset().top+"px";BG_backgroundElement.fadeIn(speed,function(){inElm.hide();BG_backgroundElement[0].parentNode.removeChild(BG_backgroundElement[0]);callback()})}function fadeInElement(element,speed,callback){var BG_backgroundElement=null;BG_backgroundElement=document.createElement("div");BG_backgroundElement.style.backgroundColor="#FFFFFF";BG_backgroundElement.style.position="absolute";BG_backgroundElement.style.zIndex=100000;BG_backgroundElement=$(BG_backgroundElement);BG_backgroundElement.appendTo($("body"));BG_backgroundElement[0].style.display="none";BG_backgroundElement.show();element.show();BG_backgroundElement[0].style.height=element.height()+"px";BG_backgroundElement[0].style.width=element.width()+"px";if(jQuery.browser.safari){BG_backgroundElement[0].style.left=(element.offset().left+10)+"px"}else{BG_backgroundElement[0].style.left=(element.offset().left+10)+"px"}BG_backgroundElement[0].style.top=element.offset().top+"px";var inElm=element;BG_backgroundElement.fadeOut(speed,function(){BG_backgroundElement[0].parentNode.removeChild(BG_backgroundElement[0]);callback()})};
