var timerCount=0;var imageArray=new Array();var marginAmount=1000;var intervalID;var aboutOpen=false;var signupOpen=false;var playing=true;var animating=false;var imgPath="";var btnFunc="mouseover";var aniSpeed=1200;function client(a,e,b,c,d){this.client=a;this.campaign=e;this.dev=b;this.url=c;this.image=d}var portfolioArr=new Array(new client("Rare London","Re-Brand of Rare Fashion","Branding / Brand Guidelines / Marketing / Garment Labelling<br /><br />","","Rare.jpg"),new client("The Jockey Club","Social Media Promotion","Facebook Pages / Youtube / Twitter<br />&copy;RacingFotos.com<br />","www.facebook.com/TheJockeyClub1750","JockeyClub.jpg"),new client("Fashion156","Re-Brand and New Website Portal","Branding / Digital Planning + Strategy / Website / Online Shop / E-Marketing<br />","www.fashion156.com","F156.jpg"),new client("CBI North West","Annual Dinner with the BBC","Event Branding / Marketing Literature / Interactive Sting / Event Graphics / Print<br />","www.youtube.com/loafcreative#p/a/u/0/dA3m-a9yi6w","cbi.jpg"),new client("Allied London / Spinningfields Manchester",'Launch Of Luxury Destination "The Avenue"',"Advertising Campaign / Dynamic Cms Website / Digital Strategy / Emarketing / <br />Photography Direction / Print","www.theavenuemanchester.com","AvenueWebsite.jpg"),new client("Allied London / Spinningfields Manchester",'Launch Of Luxury Destination "The Avenue"',"Advertising Campaign / Dynamic Cms Website / Digital Strategy / Emarketing / <br />Photography Direction / Print","www.theavenuemanchester.com","AvenueXmasCampaign.jpg"),new client("England 2018 World Cup Bid Team","Worldwide Digital Content Production","Interactive Screensavers / Facebook Competitions / Flash Animation / Downloadable Content Design / Flash Banners / Website Content<br />","","LaptopOnChair.jpg"),new client("Milky Tea","Website Design & Build","Flash Website / Bespoke Flash Cms / Blog<br /><br />","www.milkytea.com","MilkyTea.jpg"),new client("Look 2011 Photography Festival","Festival Launch And Advertising","Branding / Exhibition Material / Dynamic Cms Website / Interactive Sting<br />","www.look2011.co.uk","Look2011Website.jpg"),new client("Perspex","Euroshop Exhibition Literature","Brochure Design In 2 Languages / Marketing & Promotional Literature / Copy Writing / <br />Photography Direction<br />","","Perspex.jpg"),new client("Allied London / Spinningfields Manchester",'Launch Of Luxury Destination "The Avenue"',"Advertising Campaign / Dynamic Cms Website / Digital Strategy / Emarketing / <br />Photography Direction / Print","www.theavenuemanchester.com","AvenuePhotoshoot.jpg"),new client("The Engine Rooms Venue","Branding And Marketing","Branding / Marketing Material / Wall Graphics / Photography<br /><br />","","EngineRooms.jpg"),new client("Sakinsu","Brand Creation & Launch","Name Origination / Branding / Photography / Interior Design / Interior Graphics / Marketing Literature / Signage / Website + Emarketing / Print","","Sakinsu.jpg"),new client("Wigan Leisure & Culture Trust",'"Sense Of Place" Poetry Project',"Design + Print<br /><br /><br />","","SenseOfPlace.jpg"));var totalImages=portfolioArr.length;function isiPhone(){return((navigator.platform.indexOf("iPhone")!=-1)||(navigator.platform.indexOf("iPod")!=-1))}function isPhone4(){return(window.devicePixelRatio>=2)}function init(){if(isiPhone()){btnFunc="click";updateOrientation(false)}else{setScreenSize()}$("#ie").hide();$(".logo_light").hide();$(".logo_dark").hide();$("#projectCopy").css("bottom","-"+($("#projectCopy").outerHeight()+40)+"px");$(".logo_dark").fadeIn();$("#aboutTab").css("left","-"+$("#aboutTab").outerWidth()+"px");$("#imageNav").css("right","-25px");$("#signup").css({top:"-"+$("#signup").outerHeight()+"px"});$.supersized({slides:[{image:""}]});startLoading();$("#about").css({left:-$("#about").width()+"px",width:"100px"});$("#aboutTab").bind(btnFunc,function(){if(!aboutOpen){openAbout()}else{closeAbout()}aboutOpen=!aboutOpen});$(".openSignup").click(function(){openSignup();signupOpen=!signupOpen})}function startLoading(){$("#supersized").append('<img src="portfolio_images/'+imgPath+portfolioArr[0].image+'" />');$("#supersized img").load(function(){setText();var a=$(document).height()+"px";imageArray.push($(this));$(this).css("margin-top",a);$("#preloader").detach();$("#supersized").css("margin-top","0px");$("#ie").delay(800).fadeIn(0,function(){$(".logo_light").fadeIn(0);$(".logo_dark").fadeOut(0);$("#imageNav").delay(300).animate({right:"0px"},"slow");if(!isiPhone()){$("#menu").fadeIn(0);$("#projectCopy").delay(500).animate({bottom:"0px"},aniSpeed,"easeInOutQuint")}$("#aboutTab").delay(300).animate({left:"0px"},"slow",function(){if(document.location.hash.slice(1)=="newsletter"){openSignup();signupOpen=true}})});$(this).addClass("active").delay(100).animate({"margin-top":"0px"},aniSpeed,"easeInOutQuint",function(){loadAllImages()})})}function setScreenSize(){var a=screen.width;var b=Array(2560,1920,1280,800);if(a>=b[0]){imgPath="2560x1600/"}else{if(a>=[1]&&a<b[0]){imgPath="1920x1200/"}else{if(a>=b[2]&&a<b[1]){imgPath="1280x800/"}else{if(a>=b[3]&&a<b[2]){imgPath="800x600/"}}}}}function updateOrientation(a){var b="iphone/";if(isPhone4()){b="iphone4/"}switch(window.orientation){case 0:imgPath=b+"portrait/";break;case -90:imgPath=b+"landscape/";break;case 90:imgPath=b+"landscape/";break;case 180:imgPath=b+"portrait/";break}if(a){clearInterval(intervalID);imageArray=[];timerCount=0;playing=true;animating=false;$("#supersized img").each(function(){$(this).remove()});startLoading()}}function openAbout(){if(playing){pauseImages($("#pauseBtn"))}$("#about").css({left:-$(this).width()+"px",width:"100%"}).animate({left:"0px"},1300,"easeInOutQuint");$("#projectCopy").animate({bottom:"-"+($("#projectCopy").outerHeight())+"px"},1200,"easeInOutQuint");$("#imageNav").animate({right:"-"+$("#imageNav").outerWidth()+"px"});$(".logo_dark").delay(500).fadeIn(0);$(".logo_light, #loaflogo2").delay(500).fadeOut(0);$("#aboutTab").animate({color:"#ffffff",backgroundColor:"#000000",left:"-"+$(this).width()+"px"},function(){$(this).html("PORTFOLIO").css({left:"auto",right:"-"+$(this).outerWidth()+"px"});if(isiPhone()){$(this).css("margin-top","90px")}$(this).delay(800).animate({right:"0px"})})}function closeAbout(){pauseImages($("#pauseBtn"));$("#about").animate({left:"-"+$(this).width()+"px"},aniSpeed,"easeInOutQuint",function(){$(this).css({left:-$(this).width()+"px",width:"100px"})});$(".logo_dark").delay(500).fadeOut(0);$(".logo_light, #loaflogo2").delay(500).fadeIn(0);$("#aboutTab").animate({color:"#000000",backgroundColor:"#FFEF00",right:"-"+$(this).width()+"px"},function(){$(this).html("US").css({right:"auto",left:"-"+$(this).outerWidth()+"px"});if(isiPhone()){$(this).css("margin-top","-18px")}$(this).delay(800).animate({left:"0px"});$("#imageNav").animate({right:"0px"});$("#projectCopy").delay(800).animate({bottom:"0px"},1200,"easeInOutQuint")})}function openSignup(){if(!signupOpen){$("#signup").animate({top:"0px"})}else{$("#signup").animate({top:"-"+$("#signup").outerHeight()+"px"})}}function loadAllImages(){var a=1;while(a<=totalImages-1){$("#supersized").append('<img src="portfolio_images/'+imgPath+portfolioArr[a].image+'" />');imageArray.push($("#supersized img:last-child"));$("#supersized img:last-child").detach();a++}startImages()}function setText(){$("#projectCopy").find(".client").html(portfolioArr[timerCount].client);$("#projectCopy").find(".campaign").html(portfolioArr[timerCount].campaign);$("#projectCopy").find(".dev").html(portfolioArr[timerCount].dev);if(portfolioArr[timerCount].url!=""){$("#projectCopy").find("a").html(portfolioArr[timerCount].url);$("#projectCopy").find("a").attr("href","http://"+portfolioArr[timerCount].url)}else{$("#projectCopy").find("a").html("")}}function moveSlide(b,c){var a=$("#supersized .active").height();if(!b){timerCount++}if(timerCount>totalImages-1){timerCount=0}animating=true;if(c=="down"){if(timerCount==totalImages){$("#supersized").append($(imageArray[0]))}else{$("#supersized").append($(imageArray[timerCount]))}$("supersized").call_resize();$("#supersized .active").animate({"margin-top":"-="+a+"px"},aniSpeed,"easeInOutQuint",function(){$(this).css("margin-top","0px").removeClass("active").detach();$("#supersized img:nth-child(1)").addClass("active");animating=false;setText()})}else{$("#supersized").prepend($(imageArray[timerCount]));$("supersized").call_resize();$(imageArray[timerCount]).css("margin-top","-"+a+"px").animate({"margin-top":"0px"},aniSpeed,"easeInOutQuint",function(){$("#supersized .active").removeClass("active").detach();$(this).addClass("active");animating=false;setText()})}if(b&&playing){intervalID=setInterval("moveSlide(false, 'down')",6500)}}function shiftImages(a){if(animating){return}clearInterval(intervalID);if(a=="down"){timerCount++;moveSlide(true,a)}else{timerCount--;if(timerCount<0){timerCount=0}else{moveSlide(true,a)}}}function pauseImages(a){if(playing){clearInterval(intervalID);$(a).find("img").attr("src","/imgs/arrow_play.png")}else{intervalID=setInterval("moveSlide(false, 'down')",6500);$(a).find("img").attr("src","/imgs/arrow_pause.png")}playing=!playing}function startImages(){intervalID=setInterval("moveSlide(false, 'down')",6000)}function submitform(a){$(a).submit()}function clearme(a){a.value=""}function fillme(a,b){if(a.value==""){a.value=b}};
