$(function(){$("ul.jd_menu").jdMenu()});(function(d){function c(e){var f=d.data(d(e).parents().andSelf().filter("ul.jd_menu")[0],"jdMenuSettings");d("> li",e).bind("mouseenter.jdmenu mouseleave.jdmenu",function(g){d(this).toggleClass("jdm_hover");var h=d("> ul",this);if(h.length==1){clearTimeout(this.$jdTimer);var j=(g.type=="mouseenter");var i=(j?b:a);this.$jdTimer=setTimeout(function(){i(h[0],f.onAnimate,f.isVertical)},j?f.showDelay:f.hideDelay)}}).bind("click.jdmenu",function(h){var i=d("> ul",this);if(i.length==1&&(f.disableLinks==true||d(this).hasClass("accessible"))){b(i,f.onAnimate,f.isVertical);return false}if(h.target==this){var j=d("> a",h.target).not(".accessible");if(j.length>0){var g=j[0];if(!g.onclick){window.open(g.href,g.target||"_self")}else{d(g).trigger("click")}}}if(f.disableLinks||(!f.disableLinks&&!d(this).parent().hasClass("jd_menu"))){d(this).parent().jdMenuHide();h.stopPropagation()}}).find("> a").bind("focus.jdmenu blur.jdmenu",function(g){var h=d(this).parents("li:eq(0)");if(g.type=="focus"){h.addClass("jdm_hover")}else{h.removeClass("jdm_hover")}}).filter(".accessible").bind("click.jdmenu",function(g){g.preventDefault()})}function b(h,g,f){var h=d(h);if(h.is(":visible")){return}h.bgiframe();var e=h.parent();h.trigger("jdMenuShow").positionBy({target:e[0],targetPos:(f===true||!e.parent().hasClass("jd_menu")?1:3),elementPos:0,hideAfterPosition:true});if(!h.hasClass("jdm_events")){h.addClass("jdm_events");c(h)}e.addClass("jdm_active").siblings("li").find("> ul:eq(0):visible").each(function(){a(this)});if(g===undefined){h.show()}else{g.apply(h[0],[true])}}function a(f,e){var f=d(f);d(".bgiframe",f).remove();f.filter(":not(.jd_menu)").find("> li > ul:eq(0):visible").each(function(){a(this)}).end();if(e===undefined){f.hide()}else{e.apply(f[0],[false])}f.trigger("jdMenuHide").parents("li:eq(0)").removeClass("jdm_active jdm_hover").end().find("> li").removeClass("jdm_active jdm_hover")}d.fn.jdMenu=function(e){var e=d.extend({showDelay:200,hideDelay:500,disableLinks:true},e);if(!d.isFunction(e.onAnimate)){e.onAnimate=undefined}return this.filter("ul.jd_menu").each(function(){d.data(this,"jdMenuSettings",d.extend({isVertical:d(this).hasClass("jd_menu_vertical")},e));c(this)})};d.fn.jdMenuUnbind=function(){d("ul.jdm_events",this).unbind(".jdmenu").find("> a").unbind(".jdmenu")};d.fn.jdMenuHide=function(){return this.filter("ul").each(function(){a(this)})};d(window).bind("click.jdmenu",function(){d("ul.jd_menu ul:visible").jdMenuHide()})})(jQuery);(function(a){a.fn.bgIframe=a.fn.bgiframe=function(c){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});var d=function(e){return e&&e.constructor==Number?e+"px":e},b='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){if(a("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(b),this.firstChild)}})}return this}})(jQuery);(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+c]:a(this,c.toLowerCase())+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var h=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});var g=this.is(":visible")?this[0]["offset"+c]:a(this,c.toLowerCase())+a(this,"border"+h+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+h)+a(this,"padding"+e);return g+(f.margin?(a(this,"margin"+h)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});function a(c,d){return parseInt(b.curCSS(c.jquery?c[0]:c,d,true))||0}})(jQuery);(function(a){var b=function(d,f,c,e){this.x1=d;this.x2=c;this.y1=f;this.y2=e};b.prototype.contains=function(c){return(this.x1<=c.x1&&c.x2<=this.x2)&&(this.y1<=c.y1&&c.y2<=this.y2)};b.prototype.transform=function(c,d){return new b(this.x1+c,this.y1+d,this.x2+c,this.y2+d)};a.fn.positionBy=function(i){var k=new Date();if(this.length==0){return this}var i=a.extend({target:null,targetPos:null,elementPos:null,x:null,y:null,positions:null,addClass:false,force:false,container:window,hideAfterPosition:false},i);if(i.x!=null){var f=i.x;var g=i.y;var e=0;var j=0}else{var c=a(a(i.target)[0]);var e=c.outerWidth();var j=c.outerHeight();var h=c.offset();var f=h.left;var g=h.top}var d=f+e;var l=g+j;return this.each(function(){var A=a(this);if(!A.is(":visible")){A.css({left:-3000,top:-3000}).show()}var B=A.outerWidth();var z=A.outerHeight();var s=[];var r=[];s[0]=new b(d,g,d+B,g+z);r[0]=[1,7,4];s[1]=new b(d,l-z,d+B,l);r[1]=[0,6,4];s[2]=new b(d,l,d+B,l+z);r[2]=[1,3,10];s[3]=new b(d-B,l,d,l+z);r[3]=[1,6,10];s[4]=new b(f,l,f+B,l+z);r[4]=[1,6,9];s[5]=new b(f-B,l,f,l+z);r[5]=[6,4,9];s[6]=new b(f-B,l-z,f,l);r[6]=[7,1,4];s[7]=new b(f-B,g,f,g+z);r[7]=[6,0,4];s[8]=new b(f-B,g-z,f,g);r[8]=[7,9,4];s[9]=new b(f,g-z,f+B,g);r[9]=[0,7,4];s[10]=new b(d-B,g-z,d,g);r[10]=[0,7,3];s[11]=new b(d,g-z,d+B,g);r[11]=[0,10,3];s[12]=new b(d-B,g,d,g+z);r[12]=[13,7,10];s[13]=new b(d-B,l-z,d,l);r[13]=[12,6,3];s[14]=new b(f,l-z,f+B,l);r[14]=[15,1,4];s[15]=new b(f,g,f+B,g+z);r[15]=[14,0,9];if(i.positions!==null){var x=i.positions[0]}else{if(i.targetPos!=null&&i.elementPos!=null){var x=[];x[0]=[];x[0][0]=15;x[0][1]=7;x[0][2]=8;x[0][3]=9;x[1]=[];x[1][0]=0;x[1][1]=12;x[1][2]=10;x[1][3]=11;x[2]=[];x[2][0]=2;x[2][1]=3;x[2][2]=13;x[2][3]=1;x[3]=[];x[3][0]=4;x[3][1]=5;x[3][2]=6;x[3][3]=14;var x=x[i.targetPos][i.elementPos]}}var q=s[x];var o=x;if(!i.force){$window=a(window);var y=$window.scrollLeft();var w=$window.scrollTop();var m=new b(y,w,y+$window.width(),w+$window.height());var v;if(i.positions){v=i.positions}else{v=[x]}var u=[];while(v.length>0){var n=v.shift();if(u[n]){continue}u[n]=true;if(!m.contains(s[n])){if(i.positions===null){v=jQuery.merge(v,r[n])}}else{q=s[n];break}}}A.parents().each(function(){var C=a(this);if(C.css("position")!="static"){var p=C.offset();q=q.transform(-p.left,-p.top);return false}});var t={left:q.x1,top:q.y1};if(i.hideAfterPosition){t.display="none"}A.css(t);if(i.addClass){A.removeClass("positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 positionBy12 positionBy13 positionBy14 positionBy15").addClass("positionBy"+n)}})}})(jQuery);