jQuery.fn.styleCode=function(){return this.each(function(){var b=jQuery(this).find(".entry pre");b.data("isStyled")!=true&&b.wrap('<div class="codebg"><div class="codetop"></div></div>').data("isStyled",true)})};jQuery.fn.collapse=function(){return this.each(function(){jQuery(this).stop().animate({opacity:0,width:0,marginRight:0,padding:0},350)})};jQuery.fn.expand=function(b){return this.each(function(){jQuery(this).stop().animate({opacity:1,width:b,marginRight:"18px",padding:"0 1px"},350)})};
$(function(){function b(){$("#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 e(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();e(a);f=setTimeout(i,j)}function k(a){a=a.toLowerCase();a=="everything"?$("#thumbnails li").expand(l):$("#thumbnails li").not("."+a).collapse().end().filter("."+a).expand(l)}var m=[];$.preLoadImages=function(){for(var a=arguments.length;a--;){var d=document.createElement("img");d.src=arguments[a];m.push(d)}};$.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();b()});$("#sprofile").click(function(a){a.preventDefault();$("html,body").animate({scrollTop:0},550);b()});$("#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=$("#feature ul.markers");var h=$("#focusarea").children().length,j=7E3,f=setTimeout(i,j);$("#focusnext, #focusprev").click(function(a){a.preventDefault();clearTimeout(f);a=2*$(this).hasClass("nextslide")+$markers.find("a.active").parent().index();
e(a)});$markers.delegate("a","click",function(a){a.preventDefault();clearTimeout(f);e($(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(),c=window.location.hash;if(c!=""){c=c.split("/");k(c[1]);$("#filter").find(".active").removeClass("active").end().find(".f"+c[1].toLowerCase()).addClass("active")}$("#content").styleCode();$("div.tag-video").click(function(){$(this).find("span.date").fadeOut("slow")});var n=$("#content").children().length-1,g=$("#content").children().length-1;$("#loadmoreposts").click(function(a){a.preventDefault();
$.ajax({method:"get",url:"../wp-content/themes/ta/getarticles.php",data:"posts="+n+"&offset="+g,beforeSend:function(){},complete:function(){},success:function(d){g+=$("#content").append(d).styleCode().find(".moreposts:last").slideDown(600).find(".categoryicon").delay(600).fadeIn("fast").end().children().length;g>=totalPosts&&$("#loadmoreposts").fadeOut("fast");navigator.platform=="iPad"&&$("#content .post.tag-video").hide().filter(".tag-youtube").show()}})});navigator.platform=="iPad"&&$("#content .post.tag-video").hide().filter(".tag-youtube").show()});
