;(function($){var ver='Lite-1.3';$.fn.cycle=function(options){return this.each(function(){options=options||{};if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){window.console&&console.log('terminating; too few slides: '+els.length);return;} var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});var meta=$.isFunction($cont.data)?$cont.data(opts.metaAttr):null;if(meta) opts=$.extend(opts,meta);opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});var cls=this.className;opts.width=parseInt((cls.match(/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(/t:(\d+)/)||[])[1])||opts.timeout;if($cont.css('position')=='static') $cont.css('position','relative');if(opts.width) $cont.width(opts.width);if(opts.height&&opts.height!='auto') $cont.height(opts.height);var first=0;$slides.css({position:'absolute',top:0,left:0}).each(function(i){$(this).css('z-index',els.length-i)});$(els[first]).css('opacity',1).show();if($.browser.msie)els[first].style.removeAttribute('filter');if(opts.fit&&opts.width) $slides.width(opts.width);if(opts.fit&&opts.height&&opts.height!='auto') $slides.height(opts.height);if(opts.pause) $cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;});var txFn=$.fn.cycle.transitions[opts.fx];txFn&&txFn($cont,$slides,opts);$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();});if(opts.cssFirst) $($slides[first]).css(opts.cssFirst);if(opts.timeout){if(opts.speed.constructor==String) opts.speed={slow:600,fast:200}[opts.speed]||400;if(!opts.sync) opts.speed=opts.speed/2;while((opts.timeout-opts.speed)<250) opts.timeout+=opts.speed;} opts.speedIn=opts.speed;opts.speedOut=opts.speed;opts.slideCount=els.length;opts.currSlide=first;opts.nextSlide=1;var e0=$slides[first];if(opts.before.length) opts.before[0].apply(e0,[e0,e0,opts,true]);if(opts.after.length>1) opts.after[1].apply(e0,[e0,e0,opts,true]);if(opts.click&&!opts.next) opts.next=opts.click;if(opts.next) $(opts.next).bind('click',function(){return advance(els,opts,opts.rev?-1:1)});if(opts.prev) $(opts.prev).bind('click',function(){return advance(els,opts,opts.rev?1:-1)});if(opts.timeout) this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout+(opts.delay||0));});};function go(els,opts,manual,fwd){if(opts.busy)return;var p=els[0].parentNode,curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleTimeout===0&&!manual) return;if(manual||!p.cyclePause){if(opts.before.length) $.each(opts.before,function(i,o){o.apply(next,[curr,next,opts,fwd]);});var after=function(){if($.browser.msie) this.style.removeAttribute('filter');$.each(opts.after,function(i,o){o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;$.fn.cycle.custom(curr,next,opts,after);} var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;} if(opts.timeout) p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout);};function advance(els,opts,val){var p=els[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;} opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){opts.nextSlide=els.length-1;} else if(opts.nextSlide>=els.length){opts.nextSlide=0;} go(els,opts,1,val>=0);return false;};$.fn.cycle.custom=function(curr,next,opts,cb){var $l=$(curr),$n=$(next);$n.css(opts.cssBefore);var fn=function(){$n.animate(opts.animIn,opts.speedIn,opts.easeIn,cb)};$l.animate(opts.animOut,opts.speedOut,opts.easeOut,function(){$l.css(opts.cssAfter);if(!opts.sync)fn();});if(opts.sync)fn();};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(':eq(0)').hide();opts.cssBefore={opacity:0,display:'block'};opts.cssAfter={display:'none'};opts.animOut={opacity:0};opts.animIn={opacity:1};},fadeout:function($cont,$slides,opts){opts.before.push(function(curr,next,opts,fwd){$(curr).css('zIndex',opts.slideCount+(fwd===true?1:0));$(next).css('zIndex',opts.slideCount+(fwd===true?0:1));});$slides.not(':eq(0)').hide();opts.cssBefore={opacity:1,display:'block',zIndex:1};opts.cssAfter={display:'none',zIndex:0};opts.animOut={opacity:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={animIn:{},animOut:{},fx:'fade',after:null,before:null,cssBefore:{},cssAfter:{},delay:0,fit:0,height:'auto',metaAttr:'cycle',next:null,pause:0,prev:null,speed:1000,slideExpr:null,sync:1,timeout:4000};})(jQuery);$(document).ready(function(){$("#navi li a#careers").attr("href","http://#");$("#navi li a#careers").attr("target","_blank");$(".pointer").click(function(){$(".mapItem .info").fadeOut();$(this).next().fadeIn();var targetHeight=$(this).parent().find(".info").height();var newHeight=targetHeight/2;$(this).parent().find(".info").css("margin-top",-newHeight+10);});$(".close").click(function(){$(".mapItem .info").fadeOut();});$("#image-slideshow-1").cycle({speed:3000});$("#image-slideshow-2").cycle({speed:3000});$("#image-slideshow-3").cycle({speed:3000});$("#image-slideshow-4").cycle({speed:3000});$("#image-slideshow-5").cycle({speed:3000});$("#image-slideshow-6").cycle({speed:3000});$("#image-slideshow-7").cycle({speed:3000});$("#image-slideshow-8").cycle({speed:3000});$("#image-slideshow-9").cycle({speed:3000});$("#image-slideshow-10").cycle({speed:3000});formatMap();});$(window).resize(function(){formatMap();});function formatMap(){var windowWidth=$(window).width();var newWidth=0;$("#news div").each(function(){newWidth+=$(this).outerWidth(true);});if(windowWidth>newWidth){var filler=windowWidth-newWidth;console.log(filler);$("#news").width(newWidth+filler);}else{$("#news").width(newWidth);} var $d=$("#mapDrag");var wrapperWidth=$("#mapDrag").width()-$("#mapWrapper").width();var horCenter=wrapperWidth/2-41;var wrapperHeight=$("#mapDrag").height()-$("#mapWrapper").height();var verCenter=wrapperHeight/2-500;var x1,x2,y1,y2,t1,t2;var minDistance=40;var onMouseMove=function(e){var mouseEvents=$d.data("mouseEvents");if(e.timeStamp-mouseEvents[mouseEvents.length-1].timeStamp>40){mouseEvents.push(e);if(mouseEvents.length>2){mouseEvents.shift();}}} var onMouseUp=function(){$(document).unbind("mousemove mouseup");} var img=$d.draggable({containment:'#viewport',create:function(){$(this).css({top:verCenter,left:horCenter});},start:function(e,ui){$d.data("mouseEvents",[e]);$(document).mousemove(onMouseMove).mouseup(onMouseUp);},stop:function(e,ui){$d.stop();$d.css("text-indent",100);$d.children().css("text-indent",0);var lastE=$d.data("mouseEvents").shift();x1=lastE.pageX;y1=lastE.pageY;t1=lastE.timeStamp;x2=e.pageX;y2=e.pageY;t2=e.timeStamp;var dX=x2-x1,dY=y2-y1,dMs=Math.max(t2-t1,1);var speedX=Math.max(Math.min(dX/dMs,1),-1),speedY=Math.max(Math.min(dY/dMs,1),-1);var distance=Math.sqrt(Math.pow(x1-x2,2)+Math.pow(y1-y2,2));if(distance>minDistance){var lastStepTime=new Date();$d.animate({textIndent:0},{duration:Math.max(Math.abs(speedX),Math.abs(speedY))*2000,step:function(currentStep){speedX*=(currentStep/100);speedY*=(currentStep/100);var now=new Date();var stepDuration=now.getTime()-lastStepTime.getTime();lastStepTime=now;var position=$d.position();var newLeft=(position.left+(speedX*stepDuration/4)),newTop=(position.top+(speedY*stepDuration/4));$d.css({left:newLeft+"px",top:newTop+"px"});}});}}}),h=img.height()-40,w=img.width()-40,outer=$('#mapWrapper'),oH=outer.height(),oW=outer.width(),iH=h+(h-oH),iW=w+(w-oW),iT='-'+((iH-oH)/2)+'px',iL='-'+((iW-oW)/2)+'px';$('#viewport').css({width:iW,height:iH,top:iT,left:iL});}