var iPad=false;var openIb,openInitialWindow;if(navigator.userAgent.match(/iPad/i)){iPad=true}var mobile=false;var mobstr='false';$(window).load(function(){$('a').click(function(){var href=$(this).attr('href');var target=$(this).attr('target');if(href!="#"&&target!="_blank"){window.location.hash='!'+href}});if($('body').hasClass('mobile')){mobile=true;mobstr='true'};$('.feed-text').cycle({fx:'scrollVert',rev:1,timeout:10000,prev:'#feed-next',next:'#feed-prev'});$('.feed').width($(window).width()-16);$('.feed .feed-nav').show();$('.feed .close').live('click',function(e){$(this).attr('class','open');$(this).closest('.feed').css('min-width','0');$(this).closest('.feed').animate({'width':'192px'});$('.feed-text').cycle('pause');$('.feed .feed-nav').hide();e.preventDefault()});$('.feed .open').live('click',function(e){$(this).attr('class','close');$(this).closest('.feed').animate({'width':($(window).width()-16)},500,function(){$(this).closest('.feed').css('min-width','660px')});$('.feed-text').cycle('resume');$('.feed .feed-nav').show();e.preventDefault()});$('#feed-next').live('click',function(e){$('.feed-text').cycle('next');e.preventDefault()});$('#feed-prev').live('click',function(e){$('.feed-text').cycle('prev');e.preventDefault()});$('#navigation .close').live('click',function(e){$(this).attr('class','open');$(this).closest('#navigation').css('min-width','0');$(this).closest('#navigation').animate({'width':'179px'},500,function(){$(this).closest('#navigation').find('.content td a').css('background','none')});e.preventDefault()});$('#navigation .open').live('click',function(e){$(this).attr('class','close');$(this).closest('#navigation').find('.content td a').css('background','#595959');$(this).closest('#navigation').animate({'width':($(window).width()-16)},500,function(){$(this).closest('#navigation').css('min-width','660px')});e.preventDefault()});$('#navigation td a').live('click',function(e){e.preventDefault()});$(window).resize(function(){if($('#navigation a.close').length>0){$('#navigation').css('width',($(window).width()-16))}if($('.feed a.close').length>0){$('.feed').css('width',($(window).width()-16))}});var maxZoom=7;var minZoom=4;if(mobile){minZoom=4;maxZoom=4}var zenoTypeOptions={getTileUrl:function(coord,zoom){var normalizedCoord=getNormalizedCoord(coord,zoom);if(!normalizedCoord){return null}var bound=Math.pow(2,zoom);return"tiles"+"/"+zoom+"/"+normalizedCoord.x+"/"+(bound-normalizedCoord.y-1)+".png"},tileSize:new google.maps.Size(256,256),isPng:true,maxZoom:maxZoom,minZoom:minZoom,radius:24000,name:"zeno"};var zenoMapType=new google.maps.ImageMapType(zenoTypeOptions);var myLatlng=new google.maps.LatLng(-59,-70);var myOptions={center:myLatlng,zoom:6,backgroundColor:'#ededed',panControl:false,zoomControl:true,streetViewControl:false,mapTypeControl:false,scaleControl:false,mapTypeControlOptions:{mapTypeIds:["zeno"]},zoomControlOptions:{position:google.maps.ControlPosition.LEFT_TOP}};if(mobile){myOptions.zoom=5;myOptions.zoomControlOptions={position:google.maps.ControlPosition.TOP_LEFT};myOptions.zoomControl=false}var map=new google.maps.Map(document.getElementById("map_canvas"),myOptions);map.mapTypes.set('zeno',zenoMapType);map.setMapTypeId('zeno');if(!mobile){var controlDiv=document.createElement('DIV');controlDiv.index=1;controlDiv.style.height='33px';map.controls[google.maps.ControlPosition.TOP_LEFT].push(controlDiv)}var ibOptions={content:'',box:'',maxWidth:0,pixelOffset:new google.maps.Size(-348,-455),zIndex:8000,boxStyle:{width:"696px",height:"420px"},closeBoxMargin:"10px 10px 2px 2px",closeBoxURL:"images/close.png",infoBoxClearance:new google.maps.Size(30,60),isHidden:false,pane:"floatPane",enableEventPropagation:false};if(mobile){ibOptions.infoBoxClearance=new google.maps.Size(50,3);ibOptions.closeBoxURL="images/close-mobile.png"}var ib=new InfoBox(ibOptions);var ib2Options={pixelOffset:new google.maps.Size(0,-12),content:'',boxClass:"infobox-hover",closeBoxURL:"",disableAutoPan:true,maxWidth:0,zIndex:100,isHidden:false,pane:"floatPane",enableEventPropagation:true};var ib2=new InfoBox(ib2Options);var circles=Array();circles[1]=new google.maps.Circle({content:$('#box1-container').html(),box:1,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-58.1,-70.34),radius:150200});circles[2]=new google.maps.Circle({content:$('#box2-container').html(),box:2,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-56.4,-59.5),radius:164000});circles[3]=new google.maps.Circle({content:$('#box3-container').html(),box:3,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-54.85,-49.18),radius:168300});circles[4]=new google.maps.Circle({content:$('#box4-container').html(),box:4,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-53.25,-39.41),radius:185500});circles[5]=new google.maps.Circle({content:$('#box5-container').html(),box:5,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-58.45,-44.4),radius:194000});circles[6]=new google.maps.Circle({content:$('#box6-container').html(),box:6,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-63.95,-50.95),radius:181000});circles[7]=new google.maps.Circle({content:$('#box7-container').html(),box:7,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-69.8,-59),radius:153000});circles[8]=new google.maps.Circle({content:$('#box8-container').html(),box:8,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-68.14,-45.42),radius:149000});circles[9]=new google.maps.Circle({content:$('#box9-container').html(),box:9,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-66.455,-32.82),radius:148000});circles[10]=new google.maps.Circle({content:$('#box10-container').html(),box:10,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-64.88,-21.26),radius:138000});circles[11]=new google.maps.Circle({content:$('#box11-container').html(),box:11,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-62.355,-66.92),radius:85000});circles[12]=new google.maps.Circle({content:$('#box12-container').html(),box:12,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-60.75,-55.41),radius:85500});circles[13]=new google.maps.Circle({content:$('#box13-container').html(),box:13,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-57.58,-34.26),radius:87700});circles[14]=new google.maps.Circle({content:$('#box14-container').html(),box:14,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-66.175,-63.29),radius:81100});circles[15]=new google.maps.Circle({content:$('#box15-container').html(),box:15,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-62.9,-39.27),radius:82800});circles[16]=new google.maps.Circle({content:$('#box16-container').html(),box:16,clickable:true,strokeOpacity:0,fillOpacity:0,map:map,center:new google.maps.LatLng(-61.27,-28.46),radius:85400});for(var i=1;i<circles.length;i++){google.maps.event.addListener(circles[i],'click',function(){ib.setContent(this.content);ib.box=this.box;ib.setPosition(this.center);ib.open(map);ib2.close()});google.maps.event.addListener(circles[i],'mouseover',function(){var boxNum=this.box;if(ib.box!=boxNum||$('.infoBox').length==0){var hbox=$('#hbox'+boxNum).html();ib2.setContent(hbox);ib2.setPosition(this.center);ib2.open(map)}});google.maps.event.addListener(circles[i],'mouseout',function(){ib2.close()})}var openIntialWindowInterval=null;google.maps.event.addListenerOnce(map,'idle',function(){if(window.location.hash==''||window.location.hash==undefined){openIntialWindowInterval=setInterval('openInitialWindow()',2500)}});openInitialWindow=function(){openIb(1,'/content/page/welcome');clearInterval(openIntialWindowInterval)};openIb=function(circleNumber,location){if(location!=undefined){window.location.hash='!'+location}ib.setContent(circles[circleNumber].content);ib.setPosition(circles[circleNumber].center);ib.box=circleNumber;ib.open(map);mapInteractOn()};google.maps.event.addListener(map,'zoom_changed',function(){if(!mobile){ib.close()}});google.maps.event.addListener(ib,'domready',function(e){var boxNum=$('.infoBox div:first').attr('id').substr(3);if($('.infoBox .loading').length>0){var boxBackground=false;$.getJSON('content/object/'+boxNum,function(data){$('#boxes #box'+boxNum+' .box-content').html('<h2>'+data.title+'</h2>'+data.body);window.location.hash='!/'+data.path;$('#boxes #box'+boxNum).removeClass('load');var markup=$('#boxes #box'+boxNum+'-container').html();ib.setContent(markup);circles[boxNum].content=markup;$('.infoBox .box').removeClass('load');if(boxNum==4){handleLogoList()}else if(boxNum==10){handleLocations()}else if(boxNum==16){handleCultureSlideshow()}else if(boxNum==3){var cloudFPS=30;var cloudSpeed=.2;if(iPad){cloudFPS=20;cloudSpeed=.5}else if(mobile){cloudFPS=10;cloudSpeed=1}$(".infoBox .carousel-cont").CloudCarousel({xPos:307,yPos:0,buttonLeft:$(".infoBox .left-but"),buttonRight:$(".infoBox .right-but"),altBox:$(".infoBox .team-text"),yRadius:100,xRadius:295,bringToFront:true,ind:0,currentImage:1,FPS:cloudFPS,speed:cloudSpeed})}})}else{$.getJSON('content/object/'+boxNum,function(data){window.location.hash='!/'+data.path});if(boxNum==4){handleLogoList()}else if(boxNum==10){handleLocations()}else if(boxNum==16){handleCultureSlideshow()}else if(boxNum==3){var cloudFPS=30;var cloudSpeed=.2;if(iPad){cloudFPS=20;cloudSpeed=.5}$(".infoBox .carousel-cont").CloudCarousel({xPos:307,yPos:0,buttonLeft:$(".infoBox .left-but"),buttonRight:$(".infoBox .right-but"),altBox:$(".infoBox .team-text"),yRadius:100,xRadius:295,bringToFront:true,ind:0,currentImage:1})}}$('.infoBox img:first').attr('align','')});var mapInteractOff=function(){map.setOptions({scrollwheel:false,draggable:false,disableDoubleClickZoom:true});if(mobile){map.setOptions({draggable:true})}};var mapInteractOn=function(){map.setOptions({scrollwheel:true,draggable:true,disableDoubleClickZoom:false})};$(".infoBox").live("mouseenter",function(){mapInteractOff()});$(".infoBox").live("mouseleave",function(){mapInteractOn()});$(".infoBox").live("touchstart",function(){mapInteractOff()});$(".infoBox").live("touchend",function(){mapInteractOn()});google.maps.event.addListener(ib,'closeclick',function(){mapInteractOn()});$('.open-panel').live("click",function(e){var href=$(this).attr('href');panelOpen(href);e.preventDefault()});if(window.location.hash){var location=window.location.hash.substr(2);if(location.substr(0,1)!='/')location='/'+location;if(location=='/content/blog'){openIb(14,location)}else if(location=='/content/news'){openIb(13,location)}else if(location=='/content/careers'){openIb(15,location)}else{if(location.substr(9,4)=='page'){$('#temp-var-container').load(location+" .field-name-field-infobox-reference .field-item",function(){if($('#temp-var-container .field-item').html()){openIb($('#temp-var-container .field-item').html(),location);$('#panel #panel-content').load("/content/blog #main",function(){handlePanelInternals(location)})}else{panelOpen(location)}})}else{panelOpen(location)}}}$(window).resize(function(){$('#panel .scroll-pane').jScrollPane()})});var panelOffset=935;if(iPad)panelOffset=768;function panelOpen(location){window.location.hash='!'+location;$('#panel #panel-content').html('<div class="loading">&nbsp;</div>');$('#panel-logo').hide();$('#panel #panel-content').load(location+" #main",function(){handlePanelInternals(location)});$('#panel').show();$('#panel').animate({right:0},500);$('#map_canvas').animate({right:panelOffset+'px'},500);$('.feed, #navigation').animate({left:(8-panelOffset)+'px'},500)}function panelClose(){$("#panel").animate({right:-panelOffset+'px'},500,function(){$(this).hide()});$('#map_canvas').animate({right:0},500);$('.feed, #navigation').animate({left:'8px'},500);$('#panel-logo').hide()}function handlePanelInternals(location){handleShare(location);$('#panel-logo').show();$('#case-study-menu a.active').closest('li.title').addClass('active-ancestor');$('#panel .scroll-pane').jScrollPane();handleCaptions();$('#case-study-menu li.title').hover(function(){$(this).find('.practice-logo').addClass('image-bottom-align');$(this).addClass('title-hover')},function(){$(this).find('.practice-logo').removeClass('image-bottom-align');$(this).removeClass('title-hover')});$('#panel #panel-content a').click(function(e){if($(this).closest('.field-name-body').length==0){var location=$(this).attr('href');var target=$(this).attr('target');if(location!="#"&&target!="_blank"){window.location.hash='!'+location}$('#panel-logo').hide();$('#panel #panel-content').html('<div class="loading">&nbsp;</div>');$('#panel #panel-content').load(location+" #main",function(){handlePanelInternals(location)});e.preventDefault()}})}function getNormalizedCoord(coord,zoom){var y=coord.y;var x=coord.x;var tileRange=1<<zoom;if(y<0||y>=tileRange){return null}if(x<0||x>=tileRange){x=(x%tileRange+tileRange)%tileRange}return{x:x,y:y}}var logoRepeat=null;var logosStepping,logosOffset,logosElement,logosList,$list;function startLogosTimer(){clearInterval(logoRepeat);logoRepeat=null;if(iPad||mobile){logoRepeat=setInterval("renderLogoList()",60)}else{logoRepeat=setInterval("renderLogoList()",20)}}function handleLogoList(){logosElement=$('.infoBox #logo-lists a');logosList=$('.infoBox .logos');$list=$(logosList);if(iPad){logosStepping=0.025}else if(mobile){logosStepping=0.03}else{logosStepping=0.005}logosOffset=0;logoRepeat=null;clearInterval(logoRepeat);$('.infoBox .logos a').click(function(e){e.preventDefault()});if(!mobile){$list.mousemove(function(e){var topOfList=$list.eq(0).offset().top;var listHeight=$list.height();logosStepping=((e.clientY-topOfList)/listHeight*0.2-0.1)*.8});$list.hover(function(){},function(){var topOfList=$list.eq(0).offset().top;var listHeight=$list.height();logosStepping=logosStepping*.1})}for(var i=logosElement.length-1;i>=0;i--){logosElement[i].elemAngle=i*Math.PI*2/logosElement.length}startLogosTimer()}function renderLogoList(){if($('.infoBox .logos').length>0){for(var i=logosElement.length-1;i>=0;i--){var angle=logosElement[i].elemAngle+logosOffset;var x=100+Math.sin(angle);var y=40+Math.cos(angle)*40;var size=Math.round(40-Math.sin(angle)*40);var elementCenter=$(logosElement[i]).width()/2;var leftValue=(($list.width()/2)*x/100-elementCenter)+"px";var opacity=size/100;if(opacity<.3){opacity=opacity*.5}else if(opacity<.35){opacity=opacity*.7}else if(opacity<.4){opacity=opacity*.79}else if(opacity<.5){opacity=opacity*.90}else if(opacity>.8){opacity=opacity*1.55}else if(opacity>.7){opacity=opacity*1.5}else if(opacity>.6){opacity=opacity*1.45}else if(opacity>.57){opacity=opacity*1.35}else if(opacity>.54){opacity=opacity*1.25}else if(opacity>.5){opacity=opacity*1.1}$(logosElement[i]).css("fontSize",size+"pt");$(logosElement[i]).css("opacity",opacity);$(logosElement[i]).css("zIndex",size);$(logosElement[i]).css("left",leftValue);$(logosElement[i]).css("top",y+"%");$(logosElement[i]).css("top",y+"%")}logosOffset+=logosStepping}else{clearInterval(logoRepeat);logoRepeat=null}}function handleCultureSlideshow(){$('.culture-slideshow div.navigation').css({'width':'175px','float':'left','margin-left':'3px'});$('.culture-slideshow div.content').css('display','block');var gallery=$('.infoBox .infobox-thumbs').galleriffic({delay:2500,numThumbs:15,preloadAhead:5,enableTopPager:false,enableBottomPager:false,maxPagesToShow:1,imageContainerSel:'.infoBox .g-slideshow',controlsContainerSel:'.infoBox .g-controls',captionContainerSel:'.infoBox .g-caption',loadingContainerSel:'.infoBox .g-loading',playLinkText:'Begin Slideshow',pauseLinkText:'Pause Slideshow',prevLinkText:'Previous Photo',nextLinkText:'Next Photo',defaultTransitionDuration:900})}function handleLocations(){$('.infoBox #locations-list .location-name').mouseup(function(){$('.infoBox .active-location').removeClass('active-location');$(this).closest('li').addClass('active-location');$('.infoBox .location-info').html($(this).closest('li').html())})}var shared=false;function handleShare(url){if(shared==false){shared=true;var switchTo5x=false;$.getScript("http://w.sharethis.com/button/buttons.js",function(){stLight.options({publisher:"2bbc4837-649f-40d6-a645-3d70d32f8c61"});stWidget.addEntry({"service":"sharethis","element":document.getElementById('shareWidget'),"url":"http://zenogroup.com"+url,"title":'ZenoGroup',"type":"chicklet","text":"ShareThis"})})}else{stWidget.addEntry({"service":"sharethis","element":document.getElementById('shareWidget'),"url":"http://zenogroup.com"+url,"title":'ZenoGroup',"type":"chicklet","text":"ShareThis"})}}function handleCaptions(){$('.node-article .field-name-body img').each(function(){if($(this).attr('alt')!=null){$(this).wrap('<div class="caption"></div>').after('<div>'+$(this).attr('alt')+'</div>');$(this).closest('.caption').css('float',$(this).css('float')).css('margin',$(this).css('margin')).css('padding',$(this).css('padding'));$(this).closest('.caption').css('width',$(this).attr('width')+'px');$(this).css('float','none').css('margin',0).css('padding',0)}})}
