function loadSection(section){var pageCode="";switch(section){case'home':pageCode='Hm';break;case'portfolio':pageCode='Pt';break;case'photos':pageCode='Ph';break;case'extras':pageCode='Ext';break;case'info':pageCode='Info';break;default:break;};$('#topNav'+pageCode+'Link').parent("li").addClass("active");$('#topNav'+pageCode+'Link').children("div").addClass("topNavImgOn");}
function showTweets(user,count){var listItem=0;$("#latest_tweet").hide();function encodeURL(tweet){var exp=/(https?:\/\/)([\S]+)/gi
tweet=tweet.replace(exp,"<a href=\'$1$2\'>$2</a>");return tweet;}
function replaceLinkContent(cleanLink){cleanLink=cleanLink.replace(/[<]/g,"");cleanLink=cleanLink.replace(/[>]/g,"");return cleanLink;}
$.getJSON("http://twitter.com/statuses/user_timeline.json?screen_name="+user+"&callback=?&count="+count,function(data){$.each(data,function(i,item){var tweet=item.text;var tweet_wLinks=encodeURL(tweet);var cleanLink="";$("#latest_tweet").append("<li id='tweet_"+listItem+"'>"+tweet_wLinks+"</li>");cleanLink=$("li#tweet_"+listItem+"'").find("a").attr("href");if(cleanLink){cleanLink=replaceLinkContent(cleanLink);$("li#tweet_"+listItem+"'").find("a").text(cleanLink);$("li#tweet_"+listItem+"'").find("a").attr("href",cleanLink);}
if(listItem==0){$("#static_tweet").hide();$("#latest_tweet").show();}
listItem++;});});}
var slide=2;var slideWidth='908';var maxSlides=17;var slideshowMode=true;var loopCount=0;var maxLoops=3;var speed=200;var interval;function goToSlide(slide){var currentLocation=(slide-1);$(".slideContent").animate({marginLeft:-(slideWidth*currentLocation)},speed);$('.slideBtnHolder').children('.slideBtn').removeClass('slideBtnActive');$('#slideBtn'+slide).addClass('slideBtnActive');}
function playSlideshow(){if(slide<=maxSlides&&loopCount<=maxLoops){goToSlide(slide);slide++}
else if(loopCount<maxLoops){$(".slideContent").animate({marginLeft:0},speed);$('.slideBtnHolder').children('.slideBtn').removeClass('slideBtnActive');$('#slideBtn1').addClass('slideBtnActive');slide=2;loopCount++;}
else{loopCount=0;stopSlideshow();}}
function initSlideshow(){interval=setInterval('playSlideshow(slide)',5000);$('.mediaBtn.play').animate({marginTop:-500},0);$('.mediaBtn.pause').animate({marginTop:105},0);}
function stopSlideshow(){clearInterval(interval);$('.mediaBtn.pause').animate({marginTop:-500},0);$('.mediaBtn.play').animate({marginTop:105},0);}
$(document).ready(function(){$('.toggle').live('click',function(){$(this).parents('.pHolder').toggleClass('expandedP');});$(".simpleBtn.toggleBtn").click(function(){if($(this).html()=="More")
{$(this).html("Less");$(this).parents('div.toggleBlock').children('p.hidden').show();}
else{$(this).html("More");$(this).parents('div.toggleBlock').children('p.hidden').hide();}});$('.mainImg, .subImg, .featuredImg').live('mousedown',function(){$(this).animate({marginTop:"+=3"},0);});$('.mainImg, .subImg, .featuredImg').live('mouseup',function(){$(this).animate({marginTop:"-=3"},0);});$('.btn, a').live('mousedown',function(){$(this).animate({marginTop:"+=1"},0);});$('.btn, a').live('mouseup',function(){$(this).animate({marginTop:"-=1"},0);});});
