Cufon.set("fontFamily","ColaborateLight");Cufon.replace("h2, #main h3, h4, h5, h6, #slogan, .label",{hover:true});Cufon.set("fontFamily","Colaborate-Medium");Cufon.replace("#main_home h3",{hover:true});jQuery(document).ready(function(){jQuery("#menu").bd_menu();jQuery("#options_wrapper").bd_options_menu();if(jQuery("#project_details").length==0){jQuery(".big_gallery").bd_gallery({photos:".item",thumbs:".gallery_navigation a",buttonNext:".gallery_button_next",buttonPrev:".gallery_button_prev",buttonPlayPause:".button_play_pause",easing:"easeInOutQuad",speedIn:400,speedOut:600});jQuery(".small_gallery").bd_gallery({photos:".item",thumbs:".gallery_navigation a",buttonNext:".gallery_button_next",buttonPrev:".gallery_button_prev",buttonPlayPause:".button_play_pause",easing:"easeInOutQuad",speedIn:400,speedOut:600})}jQuery("#project_details").bd_gallery({photos:".project",thumbs:"#grid div.box_one_third .small_shadow",buttonNext:"#portfolio_navigation .next",buttonPrev:"#portfolio_navigation .prev",buttonClose:".button_close",autoStart:false,toogle:true});jQuery(".twitter_list").bd_twitter({user:"boodbe",count:4});jQuery("#grid").bd_portfolio();jQuery("#categories_dropdown").bd_dropdown();jQuery("input:text, input:password, textarea").bd_input();jQuery("#contact_form").bd_form();jQuery("body").bd_improvements()});(function(a){a.fn.bd_menu=function(b){var d={autoPosition:false,limitValue:"wrapper",easing:"easeOutQuint",speedIn:400,speedOut:100};var c=a.extend({},d,b);return this.each(function(){var h=a(this);var e=a(">ul",this);var g=e.find("ul").parent();var f=(c.limitValue=="document")?a(window).width():960;g.each(function(){var o=a(this);var n=a(this).find("ul:first");var m=a("ul",o);a("ul ul",h).css({display:"none",paddingTop:"0px"}).find("li:first").css({marginTop:"15px"});a("ul ul ul",h).find("li:first").css({marginTop:"5px"});function k(q,p){q.dimensions={w:q.offsetWidth,h:q.offsetHeight,subulw:p.outerWidth(),subulh:p.outerHeight()};return q.dimensions}function l(p){p.css({visibility:"visible"}).slideDown(c.speedIn)}function j(p,q){p.slideUp(c.speedIn,function(){p.hide()});setTimeout(function(){q.stop().animate({borderBottomWidth:"5px"},c.speedIn+100,"easeInOutSine")},100)}o.click(function(){var p=a(this).find("ul:first");p.hide()});o.hoverIntent(function(){closeOptionsMenu();k(this,n);if(a(this).find("current")){a(this).stop().animate({borderBottomWidth:"0px"},1,"easeInOutSine")}var q=a(this).find("ul:first");var p=a(this).offset();if(o.parents("ul").length==1){m.css({visibility:"hidden"});this.firstLevel=true;n.css({top:30+"px"})}else{this.firstLevel=false;n.css({top:-5+"px"})}if(this.firstLevel){var r=0}else{var r=this.dimensions.w}if((p.left+r+this.dimensions.subulw)>f&&!this.firstLevel){r=-(this.dimensions.w)}if(c.autoPosition==true){q.css({left:r+"px"})}l(q)},function(){var p=a(this).find("ul:first");j(p,a(this))})})})}})(jQuery);function closeOptionsMenu(){jQuery("#options_wrapper div").filter(":visible").stop().slideUp(400,function(){jQuery("#options_wrapper").hide()})}(function(a){a.fn.bd_options_menu=function(b){var d={controls:"#options_menu li",easing:"easeOutExpo",speedIn:400,speedOut:100};var c=a.extend({},d,b);return this.each(function(){var g=a(this);var e=a(c.controls);var h=a("div",g);var f=null;g.hide();e.each(function(j){a(this).hoverIntent(function(){f=h.filter(":eq("+j+")");if(f.css("display")=="none"){if(g.css("display")=="none"){g.show();h.filter(":visible").slideUp(0);f.slideDown(c.speedIn)}else{h.filter(":visible").slideUp(c.speedOut,function(){f.slideDown(c.speedIn)})}f.bind("mouseleave",function(){closeOptionsMenu()})}},function(){})})})}})(jQuery);function closeProjects(){jQuery("#project_details .project").filter(":visible").fadeOut(400);jQuery("#portfolio_navigation").fadeOut(200);jQuery("#project_details").animate({height:"0px"},400,"easeInOutQuad");jQuery(".breadcrumb").animate({paddingTop:"70px"},400,"easeInOutQuad")}(function(a){a.fn.bd_portfolio=function(b){var d={easing:"easeInOutQuad",speedIn:400,speedOut:200};var c=a.extend({},d,b);return this.each(function(){var e=a(this);if(a("body").find(".portfolio_big_gallery").length>0){a("#project_details .project").each(function(f){a("#p"+(f+1)+" .big_gallery").bd_gallery({photos:".item",thumbs:"#gn"+(f+1)+" a",buttonNext:"#gbn"+(f+1),buttonPrev:"#gbp"+(f+1),buttonPlayPause:"#pp"+(f+1),autoStart:false,speedIn:400,speedOut:600})})}if(a("body").find(".portfolio_small_gallery").length>0){a("#project_details .project").each(function(f){a("#p"+(f+1)+" .small_gallery").bd_gallery({photos:".item",thumbs:"#gn"+(f+1)+" a",buttonNext:"#gbn"+(f+1),buttonPrev:"#gbp"+(f+1),buttonPlayPause:"#pp"+(f+1),autoStart:false,speedIn:400,speedOut:600})})}a(".box_one_third",e).css("background-image","url('/html/images/skin/play_icon.png')");a(".small_shadow",e).find("img").hover(function(){a(this).stop().animate({opacity:0.3},400,"easeInOutQuad")},function(){a(this).stop().animate({opacity:1},400,"easeInOutQuad")})})}})(jQuery);(function(a){a.fn.bd_gallery=function(b){var d={photos:"",thumbs:"",buttonNext:"",buttonPrev:"",buttonPlayPause:"",buttonClose:"",autoStart:true,firstClick:true,toogle:false,timer:7000,easing:"",speedIn:400,speedOut:200};var c=a.extend({},d,b);return this.each(function(){var p=a(this);var o=a(c.photos,p);var g=a(c.thumbs);var e=o.length;var k=[];var s="";var m=0;var n="";function t(u){if(u){var v=u}else{var v=0}n=setInterval(function(){j(v,"next")},c.timer)}function j(v,u){var w=v;if(u=="next"||u==undefined){if(w<(g.length-1)){w++}else{w=0}}else{if(w>0){w--}else{w=(g.length-1)}}g.filter(":eq("+w+")").trigger("click",[true])}function l(v,w,z,u){var y=(u.width()/2)-(z.width()/2);var x=(u.height()/2)-(v.height()/2);v.css("margin-top",x);w.css("margin-top",x);z.css("margin-left",y)}function r(u){for(i=0;i<g.length;i++){g.filter(":eq("+i+")").removeClass("current")}u.addClass("current")}if(c.autoStart==true){s="play";a(c.buttonPlayPause+" img").attr("src","/html/images/skin/button_pause.png")}else{s="pause"}if(a("body").find("#project_details").length>0){g.css("cursor","pointer")}g.each(function(u){k[u]=o.filter(":eq("+u+")").find(".movie").html();a(this).click(function(){var z=o.filter(":eq("+u+")");var y=o.filter(":eq("+u+")").find(".movie").length;var v=z.height();this.id=u;m=this.id;if(n){clearInterval(n)}if(y==0&&s=="play"&&e>1){t(this.id)}if(z.css("display")=="none"){if(o.filter(":visible").find(".movie")){o.find(".movie").empty()}if(y>0){z.find(".movie").html(k[this.id])}o.filter(":visible").fadeOut(c.speedOut,c.easing);z.fadeIn(c.speedIn,c.easing);if(a("#project_details").length>0){var w=z.find(".item").length;var x=(15*w)+80;z.find(".gallery_navigation").css("width",x);if(a("body").find(".portfolio_big_gallery").length>0){l(z.find(".gallery_button_next"),z.find(".gallery_button_prev"),z.find(".gallery_navigation"),z.find(".big_gallery"))}if(a("body").find(".portfolio_small_gallery").length>0){l(z.find(".gallery_button_next"),z.find(".gallery_button_prev"),z.find(".gallery_navigation"),z.find(".small_gallery"))}}}if(c.toogle==true){p.show().animate({height:v},c.speedIn,c.easing,function(){a("#portfolio_navigation").slideDown(c.speedIn)});a("html:not(:animated),body:not(:animated)").animate({scrollTop:0},c.speedIn,c.easing);a(".breadcrumb").animate({paddingTop:"0px"},c.speedIn,c.easing)}r(a(this));return false})});if(e>1){var f=(15*e)+80;p.find(".gallery_navigation").css("width",f);var h=(p.width()/2)-(p.find(".gallery_navigation").width()/2);var q=(p.height()/2)-(a(c.buttonNext).height()/2);p.find(".gallery_navigation").show().css("margin-left",h);a(c.buttonPlayPause,a(this)).click(function(){if(s=="play"){s="pause";clearInterval(n);a("img",a(this)).attr("src","/html/images/skin/button_play.png")}else{s="play";j(m,"next");a("img",a(this)).attr("src","/html/images/skin/button_pause.png")}});a(c.buttonNext).show().css("margin-top",q).click(function(){j(m,"next")});a(c.buttonPrev).show().css("margin-top",q).click(function(){j(m,"prev")})}else{p.find(".gallery_navigation").hide()}a(c.buttonClose,o).click(function(){closeProjects()});if(c.firstClick){setTimeout(function(){g.filter(":eq(0)").trigger("click",[true])},500)}})}})(jQuery);(function(a){a.fn.bd_dropdown=function(b){var d={menu:".dropdown",button:".dropdown_button",easing:"easeOutQuad",speedIn:400,speedOut:400};var c=a.extend({},d,b);return this.each(function(){var g=a(this);var e=a(c.menu);var f=a(c.button);e.hide();g.hoverIntent(function(){e.animate({height:"show"},c.speedIn,c.easing);f.find("img").attr("src","/html/images/skin/button_close_categories.png")},function(){e.animate({height:"hide"},c.speedIn,c.easing);f.find("img").attr("src","/html/images/skin/button_open_categories.png")})})}})(jQuery);(function(a){a.fn.bd_input=function(){return this.each(function(){var d=a(this);var b=d.val();function c(){var f=d.val();if(b==f){d.val("")}}function e(){var f=d.val();if(f==""){d.val(b)}}d.focus(function(){c()});d.blur(function(){e()})})}})(jQuery);(function(a){a.fn.bd_form=function(b){var d={php:"/html/sendMail.php",text:"Your message has been sent. Thanks.",response:"#response",submit:"#submit",timer:4000,easing:"",speedIn:400,speedOut:400};var c=a.extend({},d,b);return this.each(function(){var h=a(this);var e=a(c.response);var j=a(c.submit);function g(k){j.fadeOut(5,function(){e.css("opacity",0);e.show().stop().animate({opacity:1},c.speedIn,c.easing,function(){interval=setInterval(f,k)})})}function f(){clearInterval(interval);e.stop().animate({opacity:0},c.speedIn,c.easing,function(){e.hide();j.fadeIn(400)})}h.submit(function(){a.ajax({type:"POST",url:c.php,data:a(this).serialize(),success:function(k){e.ajaxComplete(function(){if(k=="ok"){if(a("#contacts").length>0){a("#name",h).val("");a("#email",h).val("");a("#message",h).text("")}else{a("#name",h).val("Name");a("#email",h).val("Email");a("#message",h).text("Message")}a(this).html("<p>"+c.text+"</p>");g(c.timer*2)}else{a(this).html(k);g(c.timer)}})}});return false})})}})(jQuery);(function(a){a.fn.bd_twitter=function(b){var e={user:"boodbe",count:1};var c=a.extend({},e,b);String.prototype.linkify=function(){return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/,function(f){return f.link(f)})};function d(h){var g=h.split(" ");h=g[1]+" "+g[2]+", "+g[5]+" "+g[3];var f=Date.parse(h);var k=(arguments.length>1)?arguments[1]:new Date();var l=parseInt((k.getTime()-f)/1000);l=l+(k.getTimezoneOffset()*60);var j="";if(l<60){j="à um minuto"}else{if(l<120){j="à poucos minutos"}else{if(l<(45*60)){j=(parseInt(l/60)).toString()+" minutes ago"}else{if(l<(90*60)){j="an hour ago"}else{if(l<(24*60*60)){j=""+(parseInt(l/3600)).toString()+" hours ago"}else{if(l<(48*60*60)){j="1 day ago"}else{j=(parseInt(l/86400)).toString()+" days ago"}}}}}}return j}return this.each(function(){var f=a(this);a.getJSON("http://twitter.com/status/user_timeline/"+c.user+".json?count="+c.count+"&callback=?",function(g){f.find("li").remove();a.each(g,function(h,j){f.append("<li>"+j.text.linkify()+"<small>"+d(j.created_at)+"</small></li>")})})})}})(jQuery);(function(a){a.fn.bd_improvements=function(b){var d={easing:"easeOutQuint",speedIn:"fast",speedOut:"fast"};var c=a.extend({},d,b);return this.each(function(){var e=a(this);if(a("body").find("a[rel^='prettyPhoto']").length>1){a("a[rel^='prettyPhoto']").prettyPhoto({default_width:820,default_height:500,opacity:0.8,theme:"light_square"})}})}})(jQuery);(function(a){a.fn.hoverIntent=function(l,k){var m={sensitivity:7,interval:100,timeout:200};m=a.extend(m,k?{over:l,out:k}:l);var o,n,h,d;var e=function(f){o=f.pageX;n=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-o)+Math.abs(d-n))<m.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return m.over.apply(f,[g])}else{h=o;d=n;f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}};var j=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return m.out.apply(f,[g])};var b=function(r){var q=(r.type=="mouseover"?r.fromElement:r.toElement)||r.relatedTarget;while(q&&q!=this){try{q=q.parentNode}catch(r){q=this}}if(q==this){return false}var g=jQuery.extend({},r);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(r.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){j(g,f)},m.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);
