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