(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 Z=A(this);if(!Z.is(":visible")){Z.css({left:-3000,top:-3000}).show()}var a=Z.outerWidth();var Y=Z.outerHeight();var R=[];var Q=[];R[0]=new B(D,G,D+a,G+Y);Q[0]=[1,7,4];R[1]=new B(D,L-Y,D+a,L);Q[1]=[0,6,4];R[2]=new B(D,L,D+a,L+Y);Q[2]=[1,3,10];R[3]=new B(D-a,L,D,L+Y);Q[3]=[1,6,10];R[4]=new B(F,L,F+a,L+Y);Q[4]=[1,6,9];R[5]=new B(F-a,L,F,L+Y);Q[5]=[6,4,9];R[6]=new B(F-a,L-Y,F,L);Q[6]=[7,1,4];R[7]=new B(F-a,G,F,G+Y);Q[7]=[6,0,4];R[8]=new B(F-a,G-Y,F,G);Q[8]=[7,9,4];R[9]=new B(F,G-Y,F+a,G);Q[9]=[0,7,4];R[10]=new B(D-a,G-Y,D,G);Q[10]=[0,7,3];R[11]=new B(D,G-Y,D+a,G);Q[11]=[0,10,3];R[12]=new B(D-a,G,D,G+Y);Q[12]=[13,7,10];R[13]=new B(D-a,L-Y,D,L);Q[13]=[12,6,3];R[14]=new B(F,L-Y,F+a,L);Q[14]=[15,1,4];R[15]=new B(F,G,F+a,G+Y);Q[15]=[14,0,9];if(I.positions!==null){var W=I.positions[0]}else{if(I.targetPos!=null&&I.elementPos!=null){var W=[];W[0]=[];W[0][0]=15;W[0][1]=7;W[0][2]=8;W[0][3]=9;W[1]=[];W[1][0]=0;W[1][1]=12;W[1][2]=10;W[1][3]=11;W[2]=[];W[2][0]=2;W[2][1]=3;W[2][2]=13;W[2][3]=1;W[3]=[];W[3][0]=4;W[3][1]=5;W[3][2]=6;W[3][3]=14;var W=W[I.targetPos][I.elementPos]}}var P=R[W];var O=W;if(!I.force){$window=A(window);var X=$window.scrollLeft();var V=$window.scrollTop();var M=new B(X,V,X+$window.width(),V+$window.height());var U;if(I.positions){U=I.positions}else{U=[W]}var T=[];while(U.length>0){var N=U.shift();if(T[N]){continue}T[N]=true;if(!M.contains(R[N])){if(I.positions===null){U=jQuery.merge(U,Q[N])}}else{P=R[N];break}}}Z.parents().each(function(){var c=A(this);if(c.css("position")!="static"){var b=c.offset();P=P.transform(-b.left,-b.top);return false}});var S={left:P.x1,top:P.y1};if(I.hideAfterPosition){S.display="none"}Z.css(S);if(I.addClass){Z.removeClass("positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 positionBy12 positionBy13 positionBy14 positionBy15").addClass("positionBy"+N)}})}})(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);jQuery.fn.height=function(){if(this.get(0)==window){return self.innerHeight||jQuery.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}if(this.get(0)==document){return Math.max(document.body.scrollHeight,document.body.offsetHeight)}return this.css("height",arguments[0])};jQuery.fn.width=function(){if(this.get(0)==window){return self.innerWidth||jQuery.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}if(this.get(0)==document){return Math.max(document.body.scrollWidth,document.body.offsetWidth)}return this.css("width",arguments[0])};jQuery.fn.innerHeight=function(){return this.get(0)==window||this.get(0)==document?this.height():this.get(0).offsetHeight-parseInt(this.css("borderTop")||0)-parseInt(this.css("borderBottom")||0)};jQuery.fn.innerWidth=function(){return this.get(0)==window||this.get(0)==document?this.width():this.get(0).offsetWidth-parseInt(this.css("borderLeft")||0)-parseInt(this.css("borderRight")||0)};jQuery.fn.outerHeight=function(){return this.get(0)==window||this.get(0)==document?this.height():this.get(0).offsetHeight};jQuery.fn.outerWidth=function(){return this.get(0)==window||this.get(0)==document?this.width():this.get(0).offsetWidth};jQuery.fn.scrollLeft=function(){if(this.get(0)==window||this.get(0)==document){return self.pageXOffset||jQuery.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this.get(0).scrollLeft};jQuery.fn.scrollTop=function(){if(this.get(0)==window||this.get(0)==document){return self.pageYOffset||jQuery.boxModel&&document.documentElement.scrollTop||document.body.scrollTop}return this.get(0).scrollTop};jQuery.fn.offset=function(E){if(!this[0]){throw"jQuery.fn.offset requires an element."}E=(E)?jQuery(E)[0]:null;var G=0,F=0,A=this[0],H=this[0],B=0,I=0;do{if(H.tagName=="BODY"||H.tagName=="HTML"){if((jQuery.browser.safari||jQuery.browser.msie)&&jQuery.css(H,"position")!="absolute"){G+=parseInt(jQuery.css(H,"marginLeft"))||0;F+=parseInt(jQuery.css(H,"marginTop"))||0}break}G+=H.offsetLeft||0;F+=H.offsetTop||0;if(jQuery.browser.mozilla||jQuery.browser.msie){G+=parseInt(jQuery.css(H,"borderLeftWidth"))||0;F+=parseInt(jQuery.css(H,"borderTopWidth"))||0}if(jQuery.browser.mozilla&&jQuery.css(H,"overflow")=="hidden"){G+=parseInt(jQuery.css(H,"borderLeftWidth"))||0;F+=parseInt(jQuery.css(H,"borderTopWidth"))||0}var D=H.offsetParent;do{B+=H.scrollLeft||0;I+=H.scrollTop||0;H=H.parentNode}while(H!=D)}while(H);if(E){var C=jQuery(E).offset();G=G-C.left;F=F-C.top;B=B-C.scrollLeft;I=I-C.scrollTop}if(jQuery.browser.safari||jQuery.browser.opera){G+=parseInt(jQuery.css(A,"borderLeftWidth"))||0;F+=parseInt(jQuery.css(A,"borderTopWidth"))||0}return{top:F-I,left:G-B,width:A.offsetWidth,height:A.offsetHeight,borderTop:parseInt(jQuery.css(A,"borderTopWidth"))||0,borderLeft:parseInt(jQuery.css(A,"borderLeftWidth"))||0,marginTop:parseInt(jQuery.css(A,"marginTopWidth"))||0,marginLeft:parseInt(jQuery.css(A,"marginLeftWidth"))||0,scrollTop:I,scrollLeft:B,pageYOffset:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,pageXOffset:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0}};$(function(){$("div.jd_news_scroll").jdNewsScroll()});(function(B){var C=[];B.fn.jdNewsScroll=function(D){D=B.extend({},arguments.callee.defaults,D);B(this).each(function(){this.$settings=D;this.$pause=false;this.$counter=(Math.floor(Math.random()*10)*10);B(this).hover(function(){B(this).jdNewsScrollPause(true)},function(){B(this).jdNewsScrollPause(false)});B("> ul",this).bind("mouseover",function(E){if(B(E.target).is("li")){B(E.target).addClass("hover")}}).bind("mouseout",function(E){if(B(E.target).is("li")){B(E.target).removeClass("hover")}});C.push(this)});return this};B.fn.jdNewsScroll.defaults={delay:60,step:2};B.fn.jdNewsScrollPause=function(D){return this.each(function(){this.$pause=D})};setInterval(A,85);function A(){for(var E=0;E<C.length;E++){var F=C[E];if(F&&!F.$pause){if(F.$counter==0){var D=B("> ul",F)[0];if(!F.$steps){F.$steps=B("> li:last-child",D).outerHeight();F.$step=0}if((F.$steps+F.$step)<=0){F.$counter=F.$settings.delay;F.$steps=false;B(D).css("top","0").find("> li:last-child").after(B("> li:first-child",D));B("> *",D).not("li").remove()}else{F.$step-=F.$settings.step;if(-F.$step>F.$steps){F.$step=-F.$steps}D.style.top=F.$step+"px"}}else{F.$counter--}}}}})(jQuery);$(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:false},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);
