$("html").attr("class","js");function errorsuppressor(){return true;}
if(location.href.indexOf("localhost")==-1){window.onerror=errorsuppressor;}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function insertAfter(newElement,targetElement){var parent=targetElement.parentNode;if(parent.lastChild==targetElement){parent.appendChild(newElement);}else{parent.insertBefore(newElement,targetElement.nextSibling);}}
function populateElement(selector,defvalue){$(selector).each(function(){if($.trim(this.value)==""){this.value=defvalue;}});$(selector).focus(function(){if(this.value==defvalue){this.value="";}});$(selector).blur(function(){if($.trim(this.value)==""){this.value=defvalue;}});}
if(!$("body.override").length){$(".article.single").css('left',function(){return $(this).offset().left;}).animate({"left":"0"},1200);}
if($("body.articles").length||$("#profiles").length){$("body").prepend("<div id=\"fb-root\"></div>");if($("body.articles").length){$(".content").append("<fb:comments migrated=\"1\"></fb:comments>");}else{$(".content").append("<fb:like></fb:like>");}
window.fbAsyncInit=function(){FB.init({appId:"150531684982543",status:true,cookie:true,xfbml:true});};(function(){var e=document.createElement("script");e.async=true;e.src=document.location.protocol+"//connect.facebook.net/en_US/all.js";document.getElementById("fb-root").appendChild(e);}());}
$("a.external, body.our-expertise-detail.override .article a").click(function(){this.target="_blank";});var searchLabel=$("#ctl00_header_lblSearchWebsite").text();var searchQuestion=$("#header fieldset .text");searchQuestion.val(searchLabel);populateElement(searchQuestion,searchLabel);var items=$("#highlights-content ul > li").length;if(items>4){$("#highlights-content").wrap('<div id="highlights-wrap" />');$("#highlights-wrap").append('<a id="scroll-back" href="#" class="scroll-button prev disabled" role="button">Go Back</a>');$("#scroll-back").addClass("scroll-back-off");$("#highlights-wrap").append('<a id="scroll-forward" href="#" class="scroll-button next" role="button">View More</a>');}
$("#scroll-back, #scroll-forward").click(function(){return false;});function resizeHighlights(){viewPort=$(window).width();if(viewPort>=1004){itemAmount=4;$(".wrapper").css("min-width","1263px");$("#highlights-content").addClass("expand");$("#highlights-wrap").addClass("expand");}else{itemAmount=3;$("#highlights-content").removeClass("expand");$("#highlights-wrap").removeClass("expand");}}
function viewPortSize(){resizeHighlights()}
resizeHighlights();$("#footer").append('<a id="footer-control" href="#">Expand</a>');$("#footer-control").toggle(function(){$(this).text("Hide").attr("title","Hide view").addClass("expand");$("#highlights").animate({"bottom":"35px"},"medium");return false;},function(){$(this).text("Expand").attr("title","Expand view").removeClass("expand");;$("#highlights").animate({"bottom":"-105px"},"fast");return false;});var modalWindow={parent:"body",windowId:null,content:null,width:null,height:null,close:function(){$(".modal-window").remove();$(".modal-overlay").remove();},open:function(){var modal="";modal+="<div class=\"modal-overlay\"></div>";modal+="<div id=\""+this.windowId+"\" class=\"modal-window\" style=\"width:"+this.width+"px; height:"+this.height+"px; margin-top:-"+(this.height/2)+"px; margin-left:-"+(this.width/2)+"px;\">";modal+=this.content;modal+="</div>";$(this.parent).append(modal);$(".modal-window").append("<a class=\"close-window\">Close Window</a>");$(".close-window").click(function(){modalWindow.close();});$(".modal-overlay").click(function(){modalWindow.close();});}};var openModal=function(URL){modalWindow.windowId="generic-modal";modalWindow.width=980;modalWindow.height=575;modalWindow.content="<iframe width=\"980\" height=\"575\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"false\" src=\""+URL+"?layout=1\"></iframe>";modalWindow.open();return false;};$(".modal").click(function(){openModal(this.href);return false;});if($("body.default").length){function stopSlide(){$("#our-vision").cycle("stop");}
function pauseSlide(){$("#our-vision").cycle("pause");}
function resumeSlide(){$("#our-vision").cycle("resume");}
function innerSlide(){if($(".inner-slide").is(":visible")){pauseSlide();$(".inner-slide").cycle({fx:"fade",cleartype:true,cleartypeNoBg:true,autostop:1,timeout:3000,end:resumeSlide});}}
$("#our-vision div").hide();$("#our-vision div:first").show();$("#our-vision").after('<div id="nav-indicator" role="navigation">').cycle({fx:"fade",speed:"fast",cleartype:true,cleartypeNoBg:true,delay:1000,autostop:0,timeout:11000,pager:"#nav-indicator",activePagerClass:"active",onPagerEvent:function(){pauseSlide();},after:innerSlide});}
if($("body#connect").length){$("#aside a.button").click(function(){$("#aside li").removeClass("default");$("#aside .widget").hide();$(this).parent().addClass("default");$(this).next().show();$(".playing_gsvb").removeAttr("style").removeClass("playing_gsvb").addClass("idle_gsvb");$(".player_gsvb").remove();$(".resultDiv_gsvb").removeAttr("title");return false;});$("li#facebook .widget").append("<iframe src='http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Faiaglobal&width=221&colorscheme=light&show_faces=false&border_color&stream=true&header=false&height=343' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:221px; height:343px;' allowTransparency='true'></iframe>");$("li#linkedin .widget").append("<div id=\"pg-linkedin\"></div>");new LinkedIn.CompanyInsiderBox("pg-linkedin","aia ltd");$("li#youtube .widget").append("<div id=\"videobar\"></div>");window._uds_vbw_donotrepair=true;function LoadVideoBar(){var videoBar;var options={largeResultSet:true,horizontal:false,autoExecuteList:{executeList:["ytchannel:TMPWorldwideNA"]}}
videoBar=new GSvideoBar(document.getElementById("videobar"),GSvideoBar.PLAYER_ROOT_FLOATING,options);}
GSearch.setOnLoadCallback(LoadVideoBar);}
if($("body.our-work-client").length){$("body.override .share").appendTo("#section");$(".panel").hide();$(".panel:first").show();$("#client-uri").after("<div id='campaign-details'/>");$("body.override .panel:first h2").clone().appendTo("#campaign-details");$("body.override .panel:first p.details").clone().appendTo("#campaign-details");var panelItems=$(".panel").length;if(panelItems>1){$("#client-uri").after("<ul id='page'/>");$("#page").append("<li id='p-previous'><a href='#previous'>Previous</a></li>");$("#page").append("<li id='p-next'><a href='#next'>Next</a></li>");$("#p-previous a, #p-next a").click(function(){var $visibleItem=$(".panel:visible");var total=$(".panel").length;var index=$visibleItem.prevAll().length;$(this).attr("hash")=="#next"?index++:index--;if(index==-1){index=total-1;}
if(index==total){index=0}
$visibleItem.hide();$("#campaign-details").empty();$("body.override .panel:eq("+index+") h2").clone().appendTo("#campaign-details");$("body.override .panel:eq("+index+") p.details").clone().appendTo("#campaign-details");$(".panel:eq("+index+")").fadeIn(500);return false;});}}
if($("body.our-expertise-detail").length){$(".sample, .tb-overview").hide();$("#tb-container h1").text($(".tb-overview:first h2.heading").text());$(".sample:first, .tb-overview:first").show();$("#services-nav a, #tb-nav a, #tb-sub-nav a").click(function(){$(".sample, .tb-overview").hide();$("#tb-sub-nav a").addClass("selected").not(this).removeClass("selected");$("#tb-container h1").text($($(this).attr("href")+" h2.heading").text());$($(this).attr("href")).fadeIn("fast");return false;});var sNavItems=$("#services-nav li").length;if(sNavItems<2){$("#services-home").hide();}
$("body.override #tb-sub-nav-container").insertAfter(".content");$("#tb-sub-nav-container h2").click(function(){if($("#tb-sub-nav").is(":visible")){$(this).parent().animate({"bottom":"-173px"},"fast");$(".tb-overview:visible").removeClass("boxy-mc-box-box");$("#tb-sub-nav").hide();}else{$(".tb-overview:visible").addClass("boxy-mc-box-box");$(this).parent().animate({"bottom":"0"},"slow");$("#tb-sub-nav").show();}});$("#tb-sub-nav a").click(function(){$("#tb-nav").hide();$("#tb-sub-nav-container").animate({"bottom":"-173px"},"fast");$(".tb-overview").removeClass("boxy-mc-box-box");$("#tb-sub-nav").hide();});}
function initOurWork(){$("#panel-detail .content").append('<ul id="filter-nav"><li><a href="#" id="client" class="selected" role="navigation">Client</a></li><li><a href="#" id="sector" role="navigation">Sector</a></li></ul>');$("#client").click(function(e){e.preventDefault();$("#listing").hide();$(".gallery").fadeIn("fast");$("#filter-nav a").addClass("selected").not(this).removeClass("selected");});$("#sector").click(function(e){$("#listing").remove();e.preventDefault();$(".gallery").hide();$("#filter-nav a").addClass("selected").not(this).removeClass("selected");var my_categories=[];$(".gallery li span").each(function(index){my_categories.push($(this).text());});my_categories=$.unique(my_categories);vCategory="";$("#aside").append("<div id='listing'></div>");for(cat in my_categories){vCategory=my_categories[cat];vCatID=vCategory.replace(/ /g,"-");$("#listing").append("<h2 id='"+vCatID+"'>"+vCategory.replace(/-/g,"/")+"</h2>");$("#listing").append("<div class='category' style='display:none' id='div-"+vCatID+"'></div>");$(".gallery li span:contains('"+vCategory+"')").each(function(i){$("#div-"+vCatID).append($(this).parent().html());});if(cat==0){vIcons="div-"+vCatID;$("#"+vIcons).toggle("fast");}
$(".modal").unbind("click");$(".modal").click(function(e){e.preventDefault();openModal(this.href);});}
$("#listing h2").click(function(e){vIcons="div-"+this.id;$("#"+vIcons).toggle("fast");});});}
var addthis_brand="aia worldwide";var addthis_share={url_transforms:{remove:['layout']}}
$(".addthis_button").mouseover(function(){addthis.update('share','url',location.href.replace("/#/","/"));});
