(function(c){c.fn._hover=c.fn.hover;c.fn.hover=function(e,f,d){if(d){this.bind("hoverstart",e)}if(f){this.bind("hoverend",d?d:f)}return !e?this.trigger("hover"):this.bind("hover",d?f:e)};var a=c.event.special.hover={delay:100,speed:100,setup:function(d){d=c.extend({speed:a.speed,delay:a.delay,hovered:0},d||{});c.event.add(this,"mouseenter mouseleave",b,d)},teardown:function(){c.event.remove(this,"mouseenter mouseleave",b)}};function b(f){var e=f.data||f;switch(f.type){case"mouseenter":e.dist2=0;e.event=f;f.type="hoverstart";if(c.event.handle.call(this,f)!==false){e.elem=this;c.event.add(this,"mousemove",b,e);e.timer=setTimeout(d,e.delay)}break;case"mousemove":e.dist2+=Math.pow(f.pageX-e.event.pageX,2)+Math.pow(f.pageY-e.event.pageY,2);e.event=f;break;case"mouseleave":clearTimeout(e.timer);if(e.hovered){f.type="hoverend";c.event.handle.call(this,f);e.hovered--}else{c.event.remove(e.elem,"mousemove",b)}break;default:if(e.dist2<=Math.pow(e.speed*(e.delay/1000),2)){c.event.remove(e.elem,"mousemove",b);e.hovered++;e.event.type="hover";if(c.event.handle.call(e.elem,e.event)===false){e.hovered--}}else{e.timer=setTimeout(d,e.delay)}e.dist2=0;break}function d(){b(e)}}})(jQuery);$(document).ready(function(){(function(){var e=$("#main-menu");var d=$("> .opened",e);var c=$("> .opened > ul",e);var b=$("> .opened > a:first",e);e.removeClass("no-js");var g=$("<h2/>",{html:b.html()});b.replaceWith(g);var a=$(".opened > ul > li.selected",e);$("<span/>",{"class":"selected",html:a.children("a").html()}).insertAfter(g);$.event.special.hover.delay=50;$.event.special.hover.speed=25;d.hover(function(){c.addClass("drop-shadow").slideDown("fast")},function(){c.slideUp("fast").removeClass("drop-shadow")});var f=$("> li",e).not(".opened");f.hover(function(){var h=$("ul",this);$(this).addClass("drop-shadow");h.addClass("drop-shadow").slideDown("fast")},function(){var h=$("ul",this);h.slideUp("fast").removeClass("drop-shadow");$(this).removeClass("drop-shadow")})})();(function(){var a=$("#contact");$("#contact").click(function(){bodyelem=$.browser.safari?$("body"):$("html");bodyelem.animate({scrollTop:0},500);$("#contact-form").slideDown("fast");a.addClass("dim");return false});$("#contact-form input[name=close]").live("click",function(){$("#contact-form").slideUp("fast");a.removeClass("dim");return false});$("a.contact-link").click(function(){a.click();return false})})()});
