﻿/* colorbox, corners, mousewheel & scroll */
(function(z){var p="colorbox",n="hover",v=true,O=false,U,l=!z.support.opacity,Q=l&&!window.XMLHttpRequest,T="click.colorbox",w="cbox_open",I="cbox_load",s="cbox_complete",H="cbox_cleanup",m="cbox_closed",L="resize.cbox_resize",E,R,S,d,x,i,b,D,c,M,B,f,q,h,k,J,j,G,r,V,g,e,a,o,y,N,u,K,F,A={transition:"elastic",speed:350,width:O,height:O,innerWidth:O,innerHeight:O,initialWidth:"400",initialHeight:"400",maxWidth:O,maxHeight:O,scalePhotos:v,scrolling:v,inline:O,html:O,iframe:O,photo:O,href:O,title:O,rel:O,opacity:0.9,preloading:v,current:"{current} / {total}",previous:"previous",next:"next",close:"close",open:O,overlayClose:v,slideshow:O,slideshowAuto:v,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",preloadIMG:v};function C(W,X){X=X==="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return(typeof W==="string")?Math.round((W.match(/%/)?(X/100)*parseInt(W,10):parseInt(W,10))):W}function t(W){return N.photo||W.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function P(){for(var W in N){if(typeof(N[W])==="function"){N[W]=N[W].call(o)}}}U=z.fn.colorbox=function(X,W){if(this.length){this.each(function(){var Y=z(this).data(p)?z.extend({},z(this).data(p),X):z.extend({},A,X);z(this).data(p,Y).addClass("cboxelement")})}else{z(this).data(p,z.extend({},A,X))}z(this).unbind(T).bind(T,function(Z){o=this;N=z(o).data(p);P();F=W||O;var Y=N.rel||o.rel;if(Y&&Y!=="nofollow"){c=z(".cboxelement").filter(function(){var aa=z(this).data(p).rel||this.rel;return(aa===Y)});y=c.index(o);if(y<0){c=c.add(o);y=c.length-1}}else{c=z(o);y=0}if(!u){u=v;K=v;z().bind("keydown.cbox_close",function(aa){if(aa.keyCode===27){aa.preventDefault();U.close()}}).bind("keydown.cbox_arrows",function(aa){if(aa.keyCode===37){aa.preventDefault();G.click()}else{if(aa.keyCode===39){aa.preventDefault();j.click()}}});if(N.overlayClose){E.css({cursor:"pointer"}).one("click",U.close)}o.blur();z.event.trigger(w);r.html(N.close);E.css({opacity:N.opacity}).show();N.w=C(N.initialWidth,"x");N.h=C(N.initialHeight,"y");U.position(0);if(Q){M.bind("resize.cboxie6 scroll.cboxie6",function(){E.css({width:M.width(),height:M.height(),top:M.scrollTop(),left:M.scrollLeft()})}).trigger("scroll.cboxie6")}}U.slideshow();U.load();Z.preventDefault()});if(X&&X.open){z(this).triggerHandler(T)}return this};U.init=function(){function W(X){return z('<div id="cbox'+X+'"/>')}M=z(window);R=z('<div id="colorbox"/>');E=W("Overlay").hide();S=W("Wrapper");d=W("Content").append(B=W("LoadedContent").css({width:0,height:0}),f=W("LoadingOverlay"),q=W("LoadingGraphic"),h=W("Title"),k=W("Current"),J=W("Slideshow"),j=W("Next"),G=W("Previous"),r=W("Close"));S.append(z("<div/>").append(W("TopLeft"),x=W("TopCenter"),W("TopRight")),z("<div/>").append(i=W("MiddleLeft"),d,b=W("MiddleRight")),z("<div/>").append(W("BottomLeft"),D=W("BottomCenter"),W("BottomRight"))).children().children().css({"float":"left"});z("body").prepend(E,R.append(S));if(l){R.addClass("cboxIE");if(Q){E.css("position","absolute")}}d.children().addClass(n).mouseover(function(){z(this).addClass(n)}).mouseout(function(){z(this).removeClass(n)}).hide();V=x.height()+D.height()+d.outerHeight(v)-d.height();g=i.width()+b.width()+d.outerWidth(v)-d.width();e=B.outerHeight(v);a=B.outerWidth(v);R.css({"padding-bottom":V,"padding-right":g}).hide();j.click(U.next);G.click(U.prev);r.click(U.close);d.children().removeClass(n)};U.position=function(ab,Y){var aa,X=document.documentElement.clientHeight,Z=Math.max(X-N.h-e-V,0)/2+M.scrollTop(),W=Math.max(document.documentElement.clientWidth-N.w-a-g,0)/2+M.scrollLeft();aa=(R.width()===N.w+a&&R.height()===N.h+e)?0:ab;S[0].style.width=S[0].style.height="9999px";function ac(ad){x[0].style.width=D[0].style.width=d[0].style.width=ad.style.width;q[0].style.height=f[0].style.height=d[0].style.height=i[0].style.height=b[0].style.height=ad.style.height}R.dequeue().animate({width:N.w+a,height:N.h+e,top:Z,left:W},{duration:aa,complete:function(){ac(this);K=O;S[0].style.width=(N.w+a+g)+"px";S[0].style.height=(N.h+e+V)+"px";if(Y){Y()}},step:function(){ac(this)}})};U.resize=function(aa){if(!u){return}var ab,Z,X,ad,ah,W,af,Y=N.transition==="none"?0:N.speed;M.unbind(L);if(!aa){af=setTimeout(function(){var ai=B.wrapInner("<div style='overflow:auto'></div>").children();N.h=ai.height();B.css({height:N.h});ai.replaceWith(ai.children());U.position(Y)},1);return}B.remove();B=z('<div id="cboxLoadedContent"/>').html(aa);function ae(){N.w=N.w||B.width();return N.w}function ac(){N.h=N.h||B.height();return N.h}B.hide().appendTo(E).css({width:ae(),overflow:N.scrolling?"auto":"hidden"}).css({height:ac()}).prependTo(d);z("#cboxPhoto").css({cssFloat:"none"});if(Q){z("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(H,function(){this.style.visibility="inherit"})}function ag(ai){U.position(ai,function(){if(!u){return}if(l){if(W){B.fadeIn(100)}R[0].style.removeAttribute("filter")}d.children().show();if(N.iframe){B.append("<iframe id='cboxIframe'"+(N.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+(N.href||o.href)+"' />")}f.hide();q.hide();J.hide();if(c.length>1){k.html(N.current.replace(/\{current\}/,y+1).replace(/\{total\}/,c.length));j.html(N.next);G.html(N.previous);if(N.slideshow){J.show()}}else{k.hide();j.hide();G.hide()}h.html(N.title||o.title);z.event.trigger(s);if(F){F.call(o)}if(N.transition==="fade"){R.fadeTo(Y,1,function(){if(l){R[0].style.removeAttribute("filter")}})}M.bind(L,function(){U.position(0)})})}if((N.transition==="fade"&&R.fadeTo(Y,0,function(){ag(0)}))||ag(Y)){}if(N.preloading&&c.length>1){Z=y>0?c[y-1]:c[c.length-1];ad=y<c.length-1?c[y+1]:c[0];ah=z(ad).data(p).href||ad.href;X=z(Z).data(p).href||Z.href;if(t(ah)){z("<img />").attr("src",ah)}if(t(X)){z("<img />").attr("src",X)}}};U.load=function(){var X,W,aa,Z=U.resize;K=v;function Y(ad){var ac=z(ad),ae=ac.find("img"),ab=ae.length;(function af(){var ag=new Image();ab=ab-1;if(ab>=0&&N.preloadIMG){ag.onload=af;ag.src=ae[ab].src}else{Z(ac)}}())}o=c[y];N=z(o).data(p);P();z.event.trigger(I);N.h=N.height?C(N.height,"y")-e-V:N.innerHeight?C(N.innerHeight,"y"):O;N.w=N.width?C(N.width,"x")-a-g:N.innerWidth?C(N.innerWidth,"x"):O;N.mw=N.w;N.mh=N.h;if(N.maxWidth){N.mw=C(N.maxWidth,"x")-a-g;N.mw=N.w&&N.w<N.mw?N.w:N.mw}if(N.maxHeight){N.mh=C(N.maxHeight,"y")-e-V;N.mh=N.h&&N.h<N.mh?N.h:N.mh}X=N.href||o.href;f.show();q.show();r.show();if(N.inline){z('<div id="cboxInlineTemp" />').hide().insertBefore(z(X)[0]).bind(I+" "+H,function(){z(this).replaceWith(B.children())});Z(z(X))}else{if(N.iframe){Z(" ")}else{if(N.html){Y(N.html)}else{if(t(X)){W=new Image();W.onload=function(){var ab;W.onload=null;W.id="cboxPhoto";z(W).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(N.scalePhotos){aa=function(){W.height-=W.height*ab;W.width-=W.width*ab};if(N.mw&&W.width>N.mw){ab=(W.width-N.mw)/W.width;aa()}if(N.mh&&W.height>N.mh){ab=(W.height-N.mh)/W.height;aa()}}if(N.h){W.style.marginTop=Math.max(N.h-W.height,0)/2+"px"}Z(W);if(c.length>1){z(W).css({cursor:"pointer"}).click(U.next)}if(l){W.style.msInterpolationMode="bicubic"}};W.src=X}else{z("<div />").load(X,function(ab,ac){if(ac==="success"){Y(this)}else{Z(z("<p>Request unsuccessful.</p>"))}})}}}}};U.next=function(){if(!K){y=y<c.length-1?y+1:0;U.load()}};U.prev=function(){if(!K){y=y>0?y-1:c.length-1;U.load()}};U.slideshow=function(){var X,W,Y="cboxSlideshow_";J.bind(m,function(){J.unbind();clearTimeout(W);R.removeClass(Y+"off "+Y+"on")});function Z(){J.text(N.slideshowStop).bind(s,function(){W=setTimeout(U.next,N.slideshowSpeed)}).bind(I,function(){clearTimeout(W)}).one("click",function(){X();z(this).removeClass(n)});R.removeClass(Y+"off").addClass(Y+"on")}X=function(){clearTimeout(W);J.text(N.slideshowStart).unbind(s+" "+I).one("click",function(){Z();W=setTimeout(U.next,N.slideshowSpeed);z(this).removeClass(n)});R.removeClass(Y+"on").addClass(Y+"off")};if(N.slideshow&&c.length>1){if(N.slideshowAuto){Z()}else{X()}}};U.close=function(){z.event.trigger(H);u=O;z().unbind("keydown.cbox_close keydown.cbox_arrows");M.unbind(L+" resize.cboxie6 scroll.cboxie6");E.css({cursor:"auto"}).fadeOut("fast");R.stop(v,O).fadeOut("fast",function(){B.remove();R.css({opacity:1});d.children().hide();z.event.trigger(m)})};U.element=function(){return o};U.settings=A;z(U.init)}(jQuery));
(function(e){var d=e.browser.mozilla&&/gecko/i.test(navigator.userAgent);var c=e.browser.safari&&e.browser.version>=3;var g=e.browser.msie&&(function(){var j=document.createElement("div");try{j.style.setExpression("width","0+0")}catch(i){return false}return true})();function f(i,j){return parseInt(e.css(i,j))||0}function b(i){var i=parseInt(i).toString(16);return(i.length<2)?"0"+i:i}function h(k){for(;k&&k.nodeName.toLowerCase()!="html";k=k.parentNode){var i=e.css(k,"backgroundColor");if(i=="rgba(0, 0, 0, 0)"){continue}if(i.indexOf("rgb")>=0){var j=i.match(/\d+/g);return"#"+b(j[0])+b(j[1])+b(j[2])}if(i&&i!="transparent"){return i}}return"#ffffff"}function a(l,j,k){switch(l){case"round":return Math.round(k*(1-Math.cos(Math.asin(j/k))));case"cool":return Math.round(k*(1+Math.cos(Math.asin(j/k))));case"sharp":return Math.round(k*(1-Math.cos(Math.acos(j/k))));case"bite":return Math.round(k*(Math.cos(Math.asin((k-j-1)/k))));case"slide":return Math.round(k*(Math.atan2(j,k/j)));case"jut":return Math.round(k*(Math.atan2(k,(k-j-1))));case"curl":return Math.round(k*(Math.atan(j)));case"tear":return Math.round(k*(Math.cos(j)));case"wicked":return Math.round(k*(Math.tan(j)));case"long":return Math.round(k*(Math.sqrt(j)));case"sculpt":return Math.round(k*(Math.log((k-j-1),k)));case"dog":return(j&1)?(j+1):k;case"dog2":return(j&2)?(j+1):k;case"dog3":return(j&3)?(j+1):k;case"fray":return(j%2)*k;case"notch":return k;case"bevel":return j+1}}e.fn.corner=function(i){if(this.length==0){if(!e.isReady&&this.selector){var j=this.selector,k=this.context;e(function(){e(j,k).corner(i)})}return this}return this.each(function(q){var p=e(this);var x=(i||p.attr(e.fn.corner.defaults.metaAttr)||"").toLowerCase();var E=/keep/.test(x);var v=((x.match(/cc:(#[0-9a-f]+)/)||[])[1]);var l=((x.match(/sc:(#[0-9a-f]+)/)||[])[1]);var A=parseInt((x.match(/(\d+)px/)||[])[1])||10;var y=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var n=((x.match(y)||["round"])[0]);var m={T:0,B:1};var t={TL:/top|tl|left/.test(x),TR:/top|tr|right/.test(x),BL:/bottom|bl|left/.test(x),BR:/bottom|br|right/.test(x)};if(!t.TL&&!t.TR&&!t.BL&&!t.BR){t={TL:1,TR:1,BL:1,BR:1}}if(e.fn.corner.defaults.useNative&&n=="round"&&(d||c)&&!v&&!l){if(t.TL){p.css(d?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",A+"px")}if(t.TR){p.css(d?"-moz-border-radius-topright":"-webkit-border-top-right-radius",A+"px")}if(t.BL){p.css(d?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",A+"px")}if(t.BR){p.css(d?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",A+"px")}return}var B=document.createElement("div");B.style.overflow="hidden";B.style.height="1px";B.style.backgroundColor=l||"transparent";B.style.borderStyle="solid";var H={T:parseInt(e.css(this,"paddingTop"))||0,R:parseInt(e.css(this,"paddingRight"))||0,B:parseInt(e.css(this,"paddingBottom"))||0,L:parseInt(e.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!E){this.style.border="none"}B.style.borderColor=v||h(this.parentNode);var z=e.curCSS(this,"height");for(var C in m){var s=m[C];if((s&&(t.BL||t.BR))||(!s&&(t.TL||t.TR))){B.style.borderStyle="none "+(t[C+"R"]?"solid":"none")+" none "+(t[C+"L"]?"solid":"none");var I=document.createElement("div");e(I).addClass("jquery-corner");var u=I.style;s?this.appendChild(I):this.insertBefore(I,this.firstChild);if(s&&z!="auto"){if(e.css(this,"position")=="static"){this.style.position="relative"}u.position="absolute";u.bottom=u.left=u.padding=u.margin="0";if(g){u.setExpression("width","this.parentNode.offsetWidth")}else{u.width="100%"}}else{if(!s&&e.browser.msie){if(e.css(this,"position")=="static"){this.style.position="relative"}u.position="absolute";u.top=u.left=u.right=u.padding=u.margin="0";if(g){var F=f(this,"borderLeftWidth")+f(this,"borderRightWidth");u.setExpression("width","this.parentNode.offsetWidth - "+F+'+ "px"')}else{u.width="100%"}}else{u.position="relative";u.margin=!s?"-"+H.T+"px -"+H.R+"px "+(H.T-A)+"px -"+H.L+"px":(H.B-A)+"px -"+H.R+"px -"+H.B+"px -"+H.L+"px"}}for(var D=0;D<A;D++){var r=Math.max(0,a(n,D,A));var G=B.cloneNode(false);G.style.borderWidth="0 "+(t[C+"R"]?r:0)+"px 0 "+(t[C+"L"]?r:0)+"px";s?I.appendChild(G):I.insertBefore(G,I.firstChild)}}}})};e.fn.uncorner=function(){if(d||c){this.css(d?"-moz-border-radius":"-webkit-border-radius",0)}e("div.jquery-corner",this).remove();return this};e.fn.corner.defaults={useNative:true,metaAttr:"data-corner"}})(jQuery);(function(a){a.event.special.mousewheel={setup:function(){var b=a.event.special.mousewheel.handler;if(a.browser.mozilla){a(this).bind("mousemove.mousewheel",function(c){a.data(this,"mwcursorposdata",{pageX:c.pageX,pageY:c.pageY,clientX:c.clientX,clientY:c.clientY})})}if(this.addEventListener){this.addEventListener((a.browser.mozilla?"DOMMouseScroll":"mousewheel"),b,false)}else{this.onmousewheel=b}},teardown:function(){var b=a.event.special.mousewheel.handler;a(this).unbind("mousemove.mousewheel");if(this.removeEventListener){this.removeEventListener((a.browser.mozilla?"DOMMouseScroll":"mousewheel"),b,false)}else{this.onmousewheel=function(){}}a.removeData(this,"mwcursorposdata")},handler:function(d){var b=Array.prototype.slice.call(arguments,1);d=a.event.fix(d||window.event);a.extend(d,a.data(this,"mwcursorposdata")||{});var e=0,c=true;if(d.wheelDelta){e=d.wheelDelta/120}if(d.detail){e=-d.detail/3}d.data=d.data||{};d.type="mousewheel";b.unshift(e);b.unshift(d);return a.event.handle.apply(this,b)}};a.fn.extend({mousewheel:function(b){return b?this.bind("mousewheel",b):this.trigger("mousewheel")},unmousewheel:function(b){return this.unbind("mousewheel",b)}})})(jQuery);(function(a){a.jScrollPane={active:[]};a.fn.jScrollPane=function(c){c=a.extend({},a.fn.jScrollPane.defaults,c);var b=function(){return false};return this.each(function(){var o=a(this);o.css("overflow","hidden");var y=this;if(a(this).parent().is(".jScrollPaneContainer")){var ac=c.maintainPosition?o.position().top:0;var l=a(this).parent();var E=l.innerWidth();var ad=l.outerHeight();var m=ad;a(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",l).remove();o.css({top:0})}else{var ac=0;this.originalPadding=o.css("paddingTop")+" "+o.css("paddingRight")+" "+o.css("paddingBottom")+" "+o.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(o.css("paddingLeft"))||0)+(parseInt(o.css("paddingRight"))||0);var E=o.innerWidth();var ad=o.innerHeight();var m=ad;o.wrap(a("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:ad+"px",width:E+"px"}));a(document).bind("emchange",function(ae,af,p){o.jScrollPane(c)})}if(c.reinitialiseOnImageLoad){var n=a.data(y,"jScrollPaneImagesToLoad")||a("img",o);var g=[];if(n.length){n.each(function(p,ae){a(this).bind("load",function(){if(a.inArray(p,g)==-1){g.push(ae);n=a.grep(n,function(ag,af){return ag!=ae});a.data(y,"jScrollPaneImagesToLoad",n);c.reinitialiseOnImageLoad=false;o.jScrollPane(c)}}).each(function(af,ag){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var P=this.originalSidePaddingTotal;var M={height:"auto",width:E-c.scrollbarWidth-c.scrollbarMargin-P+"px"};if(c.scrollbarOnLeft){M.paddingLeft=c.scrollbarMargin+c.scrollbarWidth+"px"}else{M.paddingRight=c.scrollbarMargin+"px"}o.css(M);var N=o.outerHeight();var J=ad/N;if(J<0.99){var h=o.parent();h.append(a("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:c.scrollbarWidth+"px"}).append(a("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:c.scrollbarWidth+"px"}).append(a("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:c.scrollbarWidth+"px"}),a("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:c.scrollbarWidth+"px"}))));var Z=a(">.jScrollPaneTrack",h);var q=a(">.jScrollPaneTrack .jScrollPaneDrag",h);if(c.showArrows){var H;var ab;var t;var R;var K=function(){if(R>4||R%4==0){Y(U+ab*C)}R++};var k=function(p){a("html").unbind("mouseup",k);H.removeClass("jScrollActiveArrowButton");clearInterval(t)};var A=function(){a("html").bind("mouseup",k);H.addClass("jScrollActiveArrowButton");R=0;K();t=setInterval(K,100)};h.append(a("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:c.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){H=a(this);ab=-1;A();this.blur();return false}).bind("click",b),a("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:c.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){H=a(this);ab=1;A();this.blur();return false}).bind("click",b));var r=a(">.jScrollArrowUp",h);var j=a(">.jScrollArrowDown",h);if(c.arrowSize){m=ad-c.arrowSize-c.arrowSize;Z.css({height:m+"px",top:c.arrowSize+"px"})}else{var S=r.height();c.arrowSize=S;m=ad-S-j.height();Z.css({height:m+"px",top:S+"px"})}}var W=a(this).css({position:"absolute",overflow:"visible"});var d;var z;var C;var U=0;var w=J*ad/2;var B=function(ae,ag){var af=ag=="X"?"Left":"Top";return ae["page"+ag]||(ae["client"+ag]+(document.documentElement["scroll"+af]||document.body["scroll"+af]))||0};var G=function(){return false};var V=function(){O();d=q.offset(false);d.top-=U;z=m-q[0].offsetHeight;C=2*c.wheelSpeed*z/N};var e=function(p){V();w=B(p,"Y")-U-d.top;a("html").bind("mouseup",u).bind("mousemove",I);if(a.browser.msie){a("html").bind("dragstart",G).bind("selectstart",G)}return false};var u=function(){a("html").unbind("mouseup",u).unbind("mousemove",I);w=J*ad/2;if(a.browser.msie){a("html").unbind("dragstart",G).unbind("selectstart",G)}};var Y=function(ae){ae=ae<0?0:(ae>z?z:ae);U=ae;q.css({top:ae+"px"});var af=ae/z;W.css({top:((ad-N)*af)+"px"});o.trigger("scroll");if(c.showArrows){r[ae==0?"addClass":"removeClass"]("disabled");j[ae==z?"addClass":"removeClass"]("disabled")}};var I=function(p){Y(B(p,"Y")-d.top-w)};var Q=Math.max(Math.min(J*(ad-c.arrowSize*2),c.dragMaxHeight),c.dragMinHeight);q.css({height:Q+"px"}).bind("mousedown",e);var L;var s;var i;var T=function(){if(s>8||s%4==0){Y((U-((U-i)/2)))}s++};var aa=function(){clearInterval(L);a("html").unbind("mouseup",aa).unbind("mousemove",F)};var F=function(p){i=B(p,"Y")-d.top-w};var v=function(p){V();F(p);s=0;a("html").bind("mouseup",aa).bind("mousemove",F);L=setInterval(T,100);T()};Z.bind("mousedown",v);h.bind("mousewheel",function(ae,ag){V();O();var af=U;Y(U-ag*C);var p=af!=U;return !p});var f;var x;function D(){var p=(f-U)/c.animateStep;if(p>1||p<-1){Y(U+p)}else{Y(f);O()}}var O=function(){if(x){clearInterval(x);delete f}};var X=function(af,p){if(typeof af=="string"){$e=a(af,o);if(!$e.length){return}af=$e.offset().top-o.offset().top}h.scrollTop(0);O();var ae=-af/(ad-N)*z;if(p||!c.animateTo){Y(ae)}else{f=ae;x=setInterval(D,c.animateInterval)}};o[0].scrollTo=X;o[0].scrollBy=function(ae){var p=-parseInt(W.css("top"))||0;X(p+ae)};V();X(-ac,true);a("*",this).bind("focus",function(ah){var ag=a(this);var aj=0;while(ag[0]!=o[0]){aj+=ag.position().top;ag=ag.offsetParent()}var p=-parseInt(W.css("top"))||0;var ai=p+ad;var af=aj>p&&aj<ai;if(!af){var ae=aj-c.scrollbarMargin;if(aj>p){ae+=a(this).height()+15+c.scrollbarMargin-ad}X(ae)}});if(location.hash){X(location.hash)}a(document).bind("click",function(ae){$target=a(ae.target);if($target.is("a")){var p=$target.attr("href");if(p.substr(0,1)=="#"){X(p)}}});a.jScrollPane.active.push(o[0])}else{o.css({height:ad+"px",width:E-this.originalSidePaddingTotal+"px",padding:this.originalPadding});o.parent().unbind("mousewheel")}})};a.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};a(window).bind("unload",function(){var c=a.jScrollPane.active;for(var b=0;b<c.length;b++){c[b].scrollTo=c[b].scrollBy=null}})})(jQuery);