$(document).ready(function(){$('.fadeZero').each(function(){fadeImg($(this),0,1,0,200,200)});$('#projectInfoContainer').each(function(){var $this=$(this);showInfo($this)});$('.mailSyd').click(function(){$(this).attr('href','mailto:info@theprojectfactory.com?subject=The Project Factory Sydney Office Website Enquiry')});$('.mailLon').click(function(){$(this).attr('href','mailto:info@theprojectfactory.com?subject=The Project Factory London Office Website Enquiry')});getImgCount('.projectImgHolder');var facAc=false;var entAc=true;$('.factual').click(function(){if(!facAc){$('#entertainment').fadeTo(0,0);$('#entertainment').hide(0);$('#factual').delay(100).show(0);$('#factual').delay(100).fadeTo(250,1);$('a.factual').css("background","url(images/homeNavFactualActive.jpg) top center no-repeat");$('a.entertainment').css("background","url(images/homeNavEntertainment.png) top center no-repeat");facAc=true;entAc=false}});$('.entertainment').click(function(){if(!entAc){$('#factual').hide(0);$('#factual').fadeTo(0,0);$('#entertainment').delay(100).show(0);$('#entertainment').delay(100).fadeTo(250,1);$('a.entertainment').css("background","url(images/homeNavEntertainmentActive.jpg) top center no-repeat");$('a.factual').css("background","url(images/homeNavFactual.png) top center no-repeat");facAc=false;entAc=true}});$('.peopleContainer').each(function(){showPeopleContent($(this))})});function showPeopleContent(div){div.bind('mouseenter',function(){div.find('.peopleContent').delay(200).css({height:'auto'});div.find('.peopleContent').stop().slideDown(200)});div.bind('mouseleave',function(){div.find('.peopleContent').stop().slideUp(200)})}function fadeImg(elem,startVal,fadeVal,startTime,inTime,outTime){elem.stop().fadeTo(startTime,startVal);elem.bind('mouseenter',function(){$(this).stop().fadeTo(inTime,fadeVal)});elem.bind('mouseleave',function(){$(this).stop().fadeTo(outTime,startVal)})}function showInfo(elem){elem.bind('mouseenter',function(){$('#projectInfoContent').delay(200).css({height:'auto'});$('#projectInfoContent').stop().slideDown(200)});elem.bind('mouseleave',function(){$('#projectInfoContent').stop().slideUp(200)})}function fadeOut(div){$(div).fadeTo(0,0)}function fadeContent(div){$(div).fadeTo(500,1)}var toggleState=0;function readToggle(){var state=new Array("[-] Hide Info","[+] Show Info");$('#projectInfoContent').slideToggle(200);$('#projectShowHide a').text(state[toggleState]);toggleState==0?toggleState++:toggleState=0}var readMoreState=0;function readMoreLink(){var state=new Array("featuredProjectReadLess.png","featuredProjectReadMore.png");var alt=new Array("Read Less","Read More");$('#featuredProjectContent').slideToggle(250);$('img.readMoreLess').attr({src:"../images/"+state[readMoreState],alt:alt[readMoreState]});readMoreState==0?readMoreState++:readMoreState=0}function getImgCount(div){var imgLastNum=0;$(div).each(function(i){imgLastNum++});$('#imgCounter').text('1 of '+imgLastNum)}var imgPcount=0;function imgSlider(id,div,speed,dir){$('#projectInfoContent').slideUp(200);var imgLastNum;var imgBoxWidth=0;var imgTotalWidth=new Array();$(div).each(function(i){var $imgBox=$(this);imgTotalWidth[i]=imgBoxWidth;imgBoxWidth+=$imgBox.width()});$(id).width(imgBoxWidth);imgLastNum=(imgTotalWidth.length)-1;if(imgPcount==0&&dir==-1){imgPcount=imgLastNum}else if(imgPcount==imgLastNum&&dir==1){imgPcount=0}else{imgPcount=imgPcount+dir}$(id).animate({marginLeft:'-'+imgTotalWidth[imgPcount]+'px'},speed);$('#imgCounter').text((imgPcount+1)+' of '+(imgLastNum+1));$('.projectImageSummary').text(imgText[imgPcount])}function imgComment(txt){$('.projectImageSummary').text(txt)}function slideProjects(id,div,time,speed,loop,offset){var lastNum;var boxWidth=0;var totalWidth=new Array();var pCount=1;var skip=false;var hov=false;$(div).each(function(i){var $box=$(this);totalWidth[i]=boxWidth;boxWidth+=$box.width()});$(id).width(boxWidth);lastNum=totalWidth.length;$(document).everyTime(time,function(z){$(div).live({mouseover:function(){hov=true;skip=true},mouseout:function(){hov=false;skip=false}});if(!hov&&skip)skip=false;if(pCount==(lastNum-offset)&&!hov){pCount=1;skip=true;$(id).animate({marginLeft:'0px'},loop)}if(!skip){$(id).animate({marginLeft:'-'+totalWidth[pCount]+'px'},speed);pCount++}},1000)}
