$(function(){function g(){$("#profile a").parent().parent().addClass("profileactive");$("#fullscreen").css("display","block").animate({opacity:0.5},200);$("#profileview").slideDown(550,function(){$(this).find(".closeprofile").fadeIn(200)});$("#header").animate({marginTop:"320px"},550)}function d(a){if(a<1)a=h;else if(a>h)a=1;$("#focusarea").find("li:visible").fadeOut("slow").end().find("li:nth-child("+a+")").fadeIn("slow");$markers.find("a.active").removeClass("active").end().find("li:nth-child("+
a+") a").addClass("active")}function i(){var a=2+$markers.find("a.active").parent().index();d(a);e=setTimeout(i,j)}function k(a){a=a.toLowerCase();a=="everything"?$("#thumbnails li").stop().animate({opacity:1,width:l,marginRight:"18px",padding:"0 1px"},350):$("#thumbnails li").not("."+a).stop().animate({opacity:0,width:0,marginRight:0,padding:0},350).end().filter("."+a).stop().animate({opacity:1,width:l,marginRight:"18px",padding:"0 1px"},350)}function m(){return navigator.platform=="iPad"}var n=
[];$.preLoadImages=function(){for(var a=arguments.length;a--;){var c=document.createElement("img");c.src=arguments[a];n.push(c)}};$.preLoadImages("wp-content/themes/ta/images/earth.jpg","wp-content/themes/ta/images/photo.jpg");$("#contact a").mouseenter(function(){$("#contactinfo").text($(this).text()).fadeIn("fast");$(this).stop().parent().stop().animate({paddingTop:"7px"},150).end().animate({opacity:1},100)}).mouseleave(function(){$(this).stop().parent().stop().animate({paddingTop:"10px"},150).end().animate({opacity:0.5},
100)});$("#contact").mouseleave(function(){$("#contactinfo").fadeOut("fast")});$("#fullscreen").css("opacity",0);$("#profile a").click(function(a){a.preventDefault();g()});$("#sprofile").click(function(a){a.preventDefault();$("html,body").animate({scrollTop:0},550);g()});$("#fullscreen, #profileview .closeprofile").click(function(a){a.preventDefault();$("#menu").removeClass("profileactive");$("#fullscreen").delay(200).fadeOut("slow");$("#profileview").slideUp(550).find(".closeprofile").fadeOut(200);
$("#header").animate({marginTop:"0px"},550)});$("#focusarea").find("li").hide().end().find("li:first").show();$markers=$("#main_image ul.markers");var h=$("#focusarea").children().length,j=7E3,e=setTimeout(i,j);$("#focusnext, #focusprev").click(function(a){a.preventDefault();clearTimeout(e);a=2*$(this).hasClass("nextslide")+$markers.find("a.active").parent().index();d(a)});$markers.delegate("a","click",function(a){a.preventDefault();clearTimeout(e);d($(this).parent().index()+1)});$("#thumbnails li").mouseenter(function(){$(this).find("img").stop().animate({opacity:0.8},
300).end().find(".viewcasestudy").fadeIn("fast")}).mouseleave(function(){$(this).find("img").stop().animate({opacity:1},150).end().find(".viewcasestudy").fadeOut("fast")});$("#filter a").click(function(a){a.preventDefault();$(this).parent().parent().find("li a").removeClass("active").end().end().end().addClass("active");window.location.hash="/"+$(this).text().replace(" ","-");k($(this).text().replace(" ","-"))});var l=$("#thumbnails li:first").width(),b=window.location.hash;if(b!=""){b=b.split("/");
k(b[1]);$("#filter").find(".active").removeClass("active").end().find(".f"+b[1].toLowerCase()).addClass("active")}$("#content .entry pre").wrap('<div class="codebg"><div class="codetop"></div></div>');$("div.tag-video").click(function(){$(this).find("span.date").fadeOut("slow")});var o=$("#content").children().length-1,f=$("#content").children().length-1;$("#loadmoreposts").click(function(a){a.preventDefault();$.ajax({method:"get",url:"../wp-content/themes/ta/getarticles.php",data:"posts="+o+"&offset="+
f,beforeSend:function(){},complete:function(){},success:function(c){f+=$("#content").append(c).find(".moreposts:last").slideDown(600).find(".categoryicon").delay(600).fadeIn("fast").end().children().length;f>=totalPosts&&$("#loadmoreposts").fadeOut("fast")}})});m()&&$("#content .post.tag-video").hide()});
