function trimNumber(){var a=$("#phone").val();$("#phone").val(a.replace(/ /g,""));}function MM_findObj(f,e){var c,b,a;if(!e){e=document;}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c);}if(!(a=e[f])&&e.all){a=e.all[f];}for(b=0;!a&&b<e.forms.length;b++){a=e.forms[b][f];}for(b=0;!a&&e.layers&&b<e.layers.length;b++){a=MM_findObj(f,e.layers[b].document);}if(!a&&e.getElementById){a=e.getElementById(f);}return a;}function MM_validateForm(){var c,a,j,f,d,b,g,h="",e=MM_validateForm.arguments;for(c=0;c<(e.length-2);c+=3){f=e[c+2];val=MM_findObj(e[c]);if(val){j=val.name;if((val=val.value)!=""){if(f.indexOf("isEmail")!=-1){filter=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w{2,}$/;a=(filter.test(val))?1:-1;if(a<1||a==(val.length-1)){h+="- "+j+" must contain an e-mail address.\n";}}else{if(f!="R"){d=parseFloat(val);if(isNaN(val)){h+="- "+j+" must contain a number.\n";}if(f.indexOf("inRange")!=-1){a=f.indexOf(":");b=f.substring(8,a);g=f.substring(a+1);if(d<b||g<d){h+="- "+j+" must contain a number between "+b+" and "+g+".\n";}}}}}else{if(f.charAt(0)=="R"){h+="- "+j+" is required.\n";}}}}if(h){alert("The following error(s) occurred:\n"+h);}document.MM_returnValue=(h=="");}function hijackContact(){$("#frmEmail").submit(function(){if(document.MM_returnValue){var a=$(this).attr("action");try{$("#frmEmail").prepend('<div class="loader"></div>');$("#standard").val(0);$("#contact-response").load(a,{name:$("#name").val(),email:$("#email").val(),phone:$("#phone").val(),message:$("#message").val(),recaptcha_challenge_field:$("#recaptcha_challenge_field").val(),recaptcha_response_field:$("#recaptcha_response_field").val()},function(){$(".loader").remove();});return false;}catch(b){return true;}}});}function portfolio(){var e=700,d=0,a='<h3>our work</h3>\n<ul class="portfolio-thumbs">\n',c=(!$.support.opacity)?0:20;function b(g){$("ul.portfolio-thumbs li a:not(#"+g.attr("id")+") img").fadeTo(e,0.5);g.children("img").fadeTo(e,1);var f="#"+g.attr("id").replace("pt","pf");$("#portfolio-items").animate({top:(-($(f).position().top)+c)},e);}$(".portfolio-item").each(function(k){d=($(this).height()>d)?$(this).height():d;var f=$(this).attr("id").replace("pf","pt"),h=((k+1)%5==0)?' class="line-end"':"",l=$(this).find("img").attr("src"),j=$(this).find("h2").text(),g=$(this).find("ul.small-bullet").html();l=l.substring(l.lastIndexOf("/")+1,l.lastIndexOf("."));a+="<li"+h+">\n";a+='<a id="'+f+'">\n';a+='<img src="/blog/wp-content/themes/web.0/images/portfolio/thumbs/'+l+'-thumb.png" />\n';a+='<span class="portfolio-thumb-popout-outer">\n<span class="portfolio-thumb-popout-inner">\n';a+="<h3>"+j+"</h3>\n";a+='<ul class="small-bullet">\n'+g+"\n</ul>\n";a+="</span>\n</span>\n</a>\n";a+="</li>\n";});a+="</ul>\n";$(".portfolio-item").height(d).css("position","relative");$(".portfolio-links").append('<li class="portfolio-prev"><a>previous item</a></li><li class="portfolio-next"><a>next item</a></li>').css({position:"absolute",bottom:0});$(".portfolio-item:last .portfolio-next").hide();$("#header-content").append('<div class="portfolio-top-mask"></div><div class="portfolio-bottom-mask"></div>').height(d).css("overflow","hidden");$("#portfolio-items").removeClass("invisible");$("#content").prepend(a);$("ul.portfolio-thumbs li a:gt(0) img").fadeTo(0,0.5);$(".portfolio-prev a").click(function(){b($("#"+$(this).parents(".portfolio-item").prev().attr("id").replace("pf","pt")));});$(".portfolio-next a").click(function(){b($("#"+$(this).parents(".portfolio-item").next().attr("id").replace("pf","pt")));});$("ul.portfolio-thumbs li a").click(function(){b($(this));});Shadowbox.init({handleOversize:"drag"});if(location.hash!=""){b($(location.hash.replace("pi","pt")));}}function showcase(){var a="#tsfe,#sct-tsfe",d=600,f,b=true;function c(j){var i=j.attr("id").replace("showcase-",""),k="#"+i+",#sct-"+i,g,h,m,l;if(a!=k){g=j.position().left;h=j.width();$("#showcase-pointer").animate({left:Math.floor(g+(h/2))},d);if(!$.support.opacity){m=a.split(",");l=k.split(",");$(".homepage-showcase-mask").fadeIn(d/3,function(){$(m[1]).hide();$(l[1]).show();$(this).fadeOut(d/3,function(){a=k;});});$(m[0]).fadeOut(d);$(l[0]).fadeIn(d);}else{$(a).fadeOut(d);$(k).fadeIn(d,function(){a=k;});}}}function e(){var h=a.substring(1,a.indexOf(",")),g=($("#"+h).next().length>0)?$("#showcase-"+h).next():$("#showcase-menu li:first");c(g);}$("#header-content").append('<div id="showcase-pointer"></div>\n<ul id="showcase-menu">\n<li id="showcase-tsfe">themes, skins & front-ends</li>\n<li id="showcase-sh">sharepoint</li>\n<li id="showcase-ma">magento</li>\n<li id="showcase-cwd">custom web development</li>\n</ul>');if(!$.support.opacity){$("#header-content-right").append('<div class="homepage-showcase-mask"></div>');}$("#showcase-menu li").click(function(){clearInterval(f);b=false;c($(this));});$("#header-content").hover(function(){clearInterval(f);},function(){if(b){f=setInterval(e,10000);}});f=setInterval(e,10000);}function blogpage(){$(".archive-left-arrow,.archive-right-arrow").click(function(){var b=$(this).attr("href"),a=new Date();a=a.getYear()+1900;b=b.substring(0,b.length-1);b=b.substring(b.lastIndexOf("/")+1);if(Number(b)==Number(a)){$(".archive-right-arrow").addClass("hidden");}else{$(".archive-right-arrow").removeClass("hidden");}$(".archive-year").text(b);$(".archive-calendar-holder ul li a").each(function(){$(this).attr({title:$(this).attr("title").replace(reqYear,b),href:$(this).attr("href").replace(reqYear,b)});$(this).removeClass("has-posts").next(".archive-popout").remove();if(archivePosts[$(this).attr("title")]){$(this).addClass("has-posts").after('<div class="archive-popout">'+archivePosts[$(this).attr("title")]+" post(s).</div>");}});$(".archive-left-arrow").attr("href",$(".archive-left-arrow").attr("href").replace(Number(reqYear)-1,Number(b)-1));$(".archive-right-arrow").attr("href",$(".archive-right-arrow").attr("href").replace(Number(reqYear)+1,Number(b)+1));reqYear=b;return false;});}$(document).ready(function(){$("#header-menu li a").before('<div class="menu-item-bg">').hover(function(){$(this).prev("div").fadeIn(400);},function(){$(this).prev("div").fadeOut(400);});if($("body.site-home").length>0){showcase();}if($("body.portfolio").length>0){portfolio();}if($("body.blog-page").length>0){blogpage();}if($("body.contact").length>0){hijackContact();}$("a").each(function(){if($(this).attr("href")){$(this).attr("href",$(this).attr("href").replace("#pt","#pi"));}});});var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-9580968-1']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();
