$(function(){jQuery.fn.astoriaFBImageGallery=function(a){var a=$.extend({},{path:location.href,speed:2000},a);return this.each(function(){var d=$(this);var c=true;var g=null;var h=null;function i(){$.getJSON(a.path+"/data.js",function(j){g=j;g.current=-1;g.maxWidth=$("#gPics").width();g.maxHeight=$("#gPics").height();f()})}function f(){h=window.setTimeout(function(){g.current=(g.photos[++g.current]?g.current:0);var j=e(g.current);$("#gPics").css({background:"transparent"}).append(j.elem);$("#gPics img:last").imagesLoaded(function(){if(!c){$("#gPics img:first").animate({left:"-=100px",opacity:0},function(){$(this).parent().remove()})}c=false;if(!$('#gInfo div[rel="gID('+j.eID+')"]').length){$("#gInfo > div").animate({left:"-100px",opacity:0},function(){$(this).remove()});$("#gInfo").append(b(j.eID));$('#gInfo div[rel="gID('+j.eID+')"]').animate({left:"0px",opacity:1});var l="";for(var k=1;k<=j.eTotPics;k++){l+='<li class="'+(k==1?"s":"")+'"></li>'}$('#gInfo div[rel="gID('+j.eID+')"] .gDots').html("<ul>"+l+"</ul>")}else{$("#gInfo .gDots li.s").removeClass("s").next().addClass("s")}$(this).animate({left:j.left,opacity:1},f)})},c?0:a.speed)}function e(j){var l=g.photos[j];var k={data:l,width:l.width,height:l.height,top:0,left:0,elem:null,eID:l.event,eTotPics:g.events[l.event].photos};if(k.height>g.maxHeight){k.width=Math.abs((k.width*g.maxHeight)/k.height);k.height=g.maxHeight}if(k.width>g.maxWidth){k.height=Math.abs((k.height*g.maxWidth)/k.width);k.width=g.maxWidth}k.left=Math.abs((g.maxWidth-k.width)/2);k.top=Math.abs((g.maxHeight-k.height)/2);k.elem=$("<a/>").attr({href:l.link,target:"_blank",title:l.name}).append($("<img />").attr({src:l.img,width:k.width,height:k.height}).css({top:k.top,left:k.left+150,opacity:0}));return k}function b(j){var k=g.events[j];var l=$("<div/>").addClass("gGroup").attr({rel:"gID("+j+")"}).css({left:"100px",opacity:0});l.append($("<a/>").attr({title:k.name,href:k.link,target:"_blank"}).addClass("gTitle").text(g.events[j].name));l.append($("<div/>").addClass("gSubTitle").text(g.events[j].description));l.append($("<div/>").addClass("gMore"));l.append($("<div/>").addClass("gDots"));return l}$(document).bind("e4ClearEvents",function(){clearTimeout(h);h=null});i()})}});$(function(){jQuery.fn.astoriaProductGallery=function(a){var a=$.extend({},{next:null,prev:null,content:null,dots:null,maxVisibles:5,prodWidth:154},a);return this.each(function(){var e=null;var d=$(a.dots);var b=$(a.content+" li");function c(h){var g={};g.boxOffset=parseFloat($(a.content+" ul").css("left"));g.leftProducts=Math.abs(g.boxOffset)/a.prodWidth;g.rightProducts=b.length-g.leftProducts-a.maxVisibles;g.moveNextProds=(g.rightProducts>0?"-="+a.prodWidth:"");g.movePrevProds=(g.leftProducts>0?"+="+a.prodWidth:"");if(typeof(h)!="undefined"&&g[h]){return g[h]}return g}var f=c();$(a.next+", "+a.prev).click(function(){var h=this.id.substr(1,1)=="N";var i=c();e=e||a.maxVisibles;if((h&&e<b.length)||(!h&&e>5)){e+=h?1:-1;if(e==b.length){$(a.next).fadeOut()}else{$(a.next).fadeIn()}if(e==a.maxVisibles){$(a.prev).fadeOut()}else{$(a.prev).fadeIn()}$(a.content+" ul").animate({left:h?i.moveNextProds:i.movePrevProds});var g=i.leftProducts+(h?1:-1);d.find("li").removeClass("s").slice(g,g+a.maxVisibles).addClass("s")}});b.each(function(g){$(this).delay(50*g).fadeIn()});if(b.length>a.maxVisibles){$(a.next).fadeIn()}})}});(function(d){var f={put:function(h,g){(g||window).location.hash=this.encoder(h)},get:function(i){var h=((i||window).location.hash).replace(/^#/,"");try{return d.browser.mozilla?h:decodeURIComponent(h)}catch(g){return h}},encoder:encodeURIComponent};var c={id:"__jQuery_history",init:function(){var g='<iframe id="'+this.id+'" style="display:none" src="javascript:false;" />';d("body").prepend(g);return this},_document:function(){return d("#"+this.id)[0].contentWindow.document},put:function(h){var g=this._document();g.open();g.close();f.put(h,g)},get:function(){return f.get(this._document())}};function e(h){h=d.extend({unescape:false},h||{});f.encoder=i(h.unescape);function i(j){if(j===true){return function(k){return k}}if(typeof j=="string"&&(j=g(j.split("")))||typeof j=="function"){return function(k){return j(encodeURIComponent(k))}}return encodeURIComponent}function g(k){var j=new RegExp(d.map(k,encodeURIComponent).join("|"),"ig");return function(l){return l.replace(j,decodeURIComponent)}}}var b={};b.base={callback:undefined,type:undefined,check:function(){},load:function(g){},init:function(h,g){e(g);a.callback=h;a._options=g;a._init()},_init:function(){},_options:{}};b.timer={_appState:undefined,_init:function(){var g=f.get();a._appState=g;a.callback(g);setInterval(a.check,100)},check:function(){var g=f.get();if(g!=a._appState){a._appState=g;a.callback(g)}},load:function(g){if(g!=a._appState){f.put(g);a._appState=g;a.callback(g)}}};b.iframeTimer={_appState:undefined,_init:function(){var g=f.get();a._appState=g;c.init().put(g);a.callback(g);setInterval(a.check,100)},check:function(){var h=c.get(),g=f.get();if(g!=h){if(g==a._appState){a._appState=h;f.put(h);a.callback(h)}else{a._appState=g;c.put(g);a.callback(g)}}},load:function(g){if(g!=a._appState){f.put(g);c.put(g);a._appState=g;a.callback(g)}}};b.hashchangeEvent={_init:function(){a.callback(f.get());d(window).bind("hashchange",a.check)},check:function(){a.callback(f.get())},load:function(g){f.put(g)}};var a=d.extend({},b.base);if(d.browser.msie&&(d.browser.version<8||document.documentMode<8)){a.type="iframeTimer"}else{if("onhashchange" in window){a.type="hashchangeEvent"}else{a.type="timer"}}d.extend(a,b[a.type]);d.history=a})(jQuery);
/*
 * jScrollPane - v2.0.0beta5 - 2010-09-18
 * http://jscrollpane.kelvinluck.com/
 *
 * Copyright (c) 2010 Kelvin Luck
 * Dual licensed under the MIT and GPL licenses.
 */
(function(b,a,c){b.fn.jScrollPane=function(f){function d(C,L){var aw,N=this,V,ah,v,aj,Q,W,y,q,ax,aD,ar,i,H,h,j,X,R,am,U,t,A,an,ac,ak,F,l,ap,av,x,at,aG,g,aC,ag=true,M=true,aF=false,k=false,Z=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aG=C.css("paddingTop")+" "+C.css("paddingRight")+" "+C.css("paddingBottom")+" "+C.css("paddingLeft");g=(parseInt(C.css("paddingLeft"))||0)+(parseInt(C.css("paddingRight"))||0);ao(L);function ao(aJ){var aN,aM,aL,aI,aH,aK;aw=aJ;if(V==c){C.css({overflow:"hidden",padding:0});ah=C.innerWidth()+g;v=C.innerHeight();C.width(ah);V=b('<div class="jspPane" />').wrap(b('<div class="jspContainer" />').css({width:ah+"px",height:v+"px"}));C.wrapInner(V.parent());aj=C.find(">.jspContainer");V=aj.find(">.jspPane");V.css("padding",aG)}else{C.css("width",null);aK=C.outerWidth()+g!=ah||C.outerHeight()!=v;if(aK){ah=C.innerWidth()+g;v=C.innerHeight();aj.css({width:ah+"px",height:v+"px"})}aC=V.innerWidth();if(!aK&&V.outerWidth()==Q&&V.outerHeight()==W){if(aD||ax){V.css("width",aC+"px");C.css("width",(aC+g)+"px")}return}V.css("width",null);C.css("width",(ah)+"px");aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}aN=V.clone().css("position","absolute");aM=b('<div style="width:1px; position: relative;" />').append(aN);b("body").append(aM);Q=Math.max(V.outerWidth(),aN.outerWidth());aM.remove();W=V.outerHeight();y=Q/ah;q=W/v;ax=q>1;aD=y>1;if(!(aD||ax)){C.removeClass("jspScrollable");V.css({top:0,width:aj.width()-g});n();D();O();w();aq();af()}else{C.addClass("jspScrollable");aL=aw.maintainPosition&&(H||X);if(aL){aI=aA();aH=ay()}aE();z();E();if(aL){K(aI);J(aH)}I();ad();al();if(aw.enableKeyboardNavigation){P()}if(aw.clickOnTrack){p()}B();if(aw.hijackInternalLinks){m()}}if(aw.autoReinitialise&&!at){at=setInterval(function(){ao(aw)},aw.autoReinitialiseDelay)}else{if(!aw.autoReinitialise&&at){clearInterval(at)}}C.trigger("jsp-initialised",[aD||ax])}function aE(){if(ax){aj.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));R=aj.find(">.jspVerticalBar");am=R.find(">.jspTrack");ar=am.find(">.jspDrag");if(aw.showArrows){an=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aB(0,-1)).bind("click.jsp",az);ac=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aB(0,1)).bind("click.jsp",az);if(aw.arrowScrollOnHover){an.bind("mouseover.jsp",aB(0,-1,an));ac.bind("mouseover.jsp",aB(0,1,ac))}ai(am,aw.verticalArrowPositions,an,ac)}t=v;aj.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});ar.hover(function(){ar.addClass("jspHover")},function(){ar.removeClass("jspHover")}).bind("mousedown.jsp",function(aH){b("html").bind("dragstart.jsp selectstart.jsp",function(){return false});ar.addClass("jspActive");var s=aH.pageY-ar.position().top;b("html").bind("mousemove.jsp",function(aI){S(aI.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",au);return false});o()}}function o(){am.height(t+"px");H=0;U=aw.verticalGutter+am.outerWidth();V.width(ah-U-g);if(R.position().left==0){V.css("margin-left",U+"px")}}function z(){if(aD){aj.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));ak=aj.find(">.jspHorizontalBar");F=ak.find(">.jspTrack");h=F.find(">.jspDrag");if(aw.showArrows){av=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aB(-1,0)).bind("click.jsp",az);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aB(1,0)).bind("click.jsp",az);if(aw.arrowScrollOnHover){av.bind("mouseover.jsp",aB(-1,0,av));x.bind("mouseover.jsp",aB(1,0,x))}ai(F,aw.horizontalArrowPositions,av,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aH){b("html").bind("dragstart.jsp selectstart.jsp",function(){return false});h.addClass("jspActive");var s=aH.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aI){T(aI.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",au);return false});l=aj.innerWidth();ae()}else{}}function ae(){aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});F.width(l+"px");X=0}function E(){if(aD&&ax){var aH=F.outerHeight(),s=am.outerWidth();t-=aH;b(ak).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ah-=aH;F.parent().append(b('<div class="jspCorner" />').css("width",aH+"px"));o();ae()}if(aD){V.width((aj.outerWidth()-g)+"px")}W=V.outerHeight();q=W/v;if(aD){ap=1/y*l;if(ap>aw.horizontalDragMaxWidth){ap=aw.horizontalDragMaxWidth}else{if(ap<aw.horizontalDragMinWidth){ap=aw.horizontalDragMinWidth}}h.width(ap+"px");j=l-ap;ab(X)}if(ax){A=1/q*t;if(A>aw.verticalDragMaxHeight){A=aw.verticalDragMaxHeight}else{if(A<aw.verticalDragMinHeight){A=aw.verticalDragMinHeight}}ar.height(A+"px");i=t-A;aa(H)}}function ai(aI,aK,aH,s){var aM="before",aJ="after",aL;if(aK=="os"){aK=/Mac/.test(navigator.platform)?"after":"split"}if(aK==aM){aJ=aK}else{if(aK==aJ){aM=aK;aL=aH;aH=s;s=aL}}aI[aM](aH)[aJ](s)}function aB(aH,s,aI){return function(){G(aH,s,this,aI);this.blur();return false}}function G(aJ,aH,aM,aL){aM=b(aM).addClass("jspActive");var aK,s=function(){if(aJ!=0){T(X+aJ*aw.arrowButtonSpeed,false)}if(aH!=0){S(H+aH*aw.arrowButtonSpeed,false)}},aI=setInterval(s,aw.arrowRepeatFreq);s();aK=aL==c?"mouseup.jsp":"mouseout.jsp";aL=aL||b("html");aL.bind(aK,function(){aM.removeClass("jspActive");clearInterval(aI);aL.unbind(aK)})}function p(){w();if(ax){am.bind("mousedown.jsp",function(aJ){if(aJ.originalTarget==c||aJ.originalTarget==aJ.currentTarget){var aI=b(this),s=setInterval(function(){var aK=aI.offset(),aL=aJ.pageY-aK.top;if(H+A<aL){S(H+aw.trackClickSpeed)}else{if(aL<H){S(H-aw.trackClickSpeed)}else{aH()}}},aw.trackClickRepeatFreq),aH=function(){s&&clearInterval(s);s=null;b(document).unbind("mouseup.jsp",aH)};b(document).bind("mouseup.jsp",aH);return false}})}if(aD){F.bind("mousedown.jsp",function(aJ){if(aJ.originalTarget==c||aJ.originalTarget==aJ.currentTarget){var aI=b(this),s=setInterval(function(){var aK=aI.offset(),aL=aJ.pageX-aK.left;if(X+ap<aL){T(X+aw.trackClickSpeed)}else{if(aL<X){T(X-aw.trackClickSpeed)}else{aH()}}},aw.trackClickRepeatFreq),aH=function(){s&&clearInterval(s);s=null;b(document).unbind("mouseup.jsp",aH)};b(document).bind("mouseup.jsp",aH);return false}})}}function w(){F&&F.unbind("mousedown.jsp");am&&am.unbind("mousedown.jsp")}function au(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");ar&&ar.removeClass("jspActive");h&&h.removeClass("jspActive")}function S(s,aH){if(!ax){return}if(s<0){s=0}else{if(s>i){s=i}}if(aH==c){aH=aw.animateScroll}if(aH){N.animate(ar,"top",s,aa)}else{ar.css("top",s);aa(s)}}function aa(aH){if(aH==c){aH=ar.position().top}aj.scrollTop(0);H=aH;var aK=H==0,aI=H==i,aJ=aH/i,s=-aJ*(W-v);if(ag!=aK||aF!=aI){ag=aK;aF=aI;C.trigger("jsp-arrow-change",[ag,aF,M,k])}u(aK,aI);V.css("top",s);C.trigger("jsp-scroll-y",[-s,aK,aI])}function T(aH,s){if(!aD){return}if(aH<0){aH=0}else{if(aH>j){aH=j}}if(s==c){s=aw.animateScroll}if(s){N.animate(h,"left",aH,ab)}else{h.css("left",aH);ab(aH)}}function ab(aH){if(aH==c){aH=h.position().left}aj.scrollTop(0);X=aH;var aK=X==0,aJ=X==j,aI=aH/j,s=-aI*(Q-ah);if(M!=aK||k!=aJ){M=aK;k=aJ;C.trigger("jsp-arrow-change",[ag,aF,M,k])}r(aK,aJ);V.css("left",s);C.trigger("jsp-scroll-x",[-s,aK,aJ])}function u(aH,s){if(aw.showArrows){an[aH?"addClass":"removeClass"]("jspDisabled");ac[s?"addClass":"removeClass"]("jspDisabled")}}function r(aH,s){if(aw.showArrows){av[aH?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function J(s,aH){var aI=s/(W-v);S(aI*i,aH)}function K(aH,s){var aI=aH/(Q-ah);T(aI*j,s)}function Y(aP,aN,aH){var aL,aJ,s=0,aI,aM,aO;try{aL=b(aP)}catch(aK){return}aJ=aL.outerHeight();aj.scrollTop(0);while(!aL.is(".jspPane")){s+=aL.position().top;aL=aL.offsetParent();if(/^body|html$/i.test(aL[0].nodeName)){return}}aI=ay();aM=aI+v;if(s<aI||aN){aO=s-aw.verticalGutter}else{if(s+aJ>aM){aO=s-v+aJ+aw.verticalGutter}}if(aO){J(aO,aH)}}function aA(){return -V.position().left}function ay(){return -V.position().top}function ad(){aj.unbind(Z).bind(Z,function(aK,aL,aJ,aH){var aI=X,s=H;T(X+aJ*aw.mouseWheelSpeed,false);S(H-aH*aw.mouseWheelSpeed,false);return aI==X&&s==H})}function n(){aj.unbind(Z)}function al(){aq();var s={x:0,y:0};aj.bind("simpletouchstart.jsp",function(aH){s.x=aH.pageX;s.y=aH.pageY}).bind("simpletouchmove.jsp",function(aJ){var aI=X,aH=H,aK,aL;if(ar&&ar[0]===aJ.target){aK=(s.y-aJ.pageY)*-1}else{if(h&&h[0]===aJ.target){aL=(s.x-aJ.pageX)*-1}else{aK=s.y-aJ.pageY;aL=s.x-aJ.pageX}}if(aL!==c){T(X+aL,false)}if(aK!==c){S(H+aK,false)}s.x=aJ.pageX;s.y=aJ.pageY;return aI==X&&aH==H})}function aq(){aj.unbind("simpletouchstart.jsp simpletouchend.jsp simpletouchmove.jsp")}function az(){return false}function I(){V.unbind("focusin.jsp").bind("focusin.jsp",function(s){if(s.target===V[0]){return}Y(s.target,false)})}function D(){V.unbind("focusin.jsp")}function P(){var aH,s;C.attr("tabindex",0).unbind("keydown.jsp").bind("keydown.jsp",function(aL){if(aL.target.form&&!b.expr.filters.button(aL.target)){return}var aJ=X,aI=H,aK=aH?2:16;switch(aL.keyCode){case 40:S(H+aK,false);break;case 38:S(H-aK,false);break;case 34:case 32:J(ay()+Math.max(32,v)-16);break;case 33:J(ay()-v+16);break;case 35:J(W-v);break;case 36:J(0);break;case 39:T(X+aK,false);break;case 37:T(X-aK,false);break}if(!(aJ==X&&aI==H)){aH=true;clearTimeout(s);s=setTimeout(function(){aH=false},260);return false}});if(aw.hideFocus){C.css("outline","none");if("hideFocus" in aj[0]){C.attr("hideFocus",true)}}else{C.css("outline","");if("hideFocus" in aj[0]){C.attr("hideFocus",false)}}C.bind("mousedown.jspPreventFocus",function(){C.bind("focus.jspPreventFocus",function(){C.blur()});setTimeout(function(){C.unbind("focus.jspPreventFocus")},1)})}function O(){C.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp").unbind("focus.jspPreventFocus").bind("mousedown.jspPreventFocus",function(){})}function B(){if(location.hash&&location.hash.length>1){var aI,aH;try{aI=b(location.hash)}catch(s){return}if(aI.length&&V.find(aI)){if(aj.scrollTop()==0){aH=setInterval(function(){if(aj.scrollTop()>0){Y(location.hash,true);b(document).scrollTop(aj.position().top);clearInterval(aH)}},50)}else{Y(location.hash,true);b(document).scrollTop(aj.position().top)}}}}function af(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){af();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aH;if(s.length>1){aH=s[1];if(aH.length>0&&V.find("#"+aH).length>0){Y("#"+aH,true);return false}}})}b.extend(N,{reinitialise:function(aH){aH=b.extend({},aH,aw);ao(aH)},scrollToElement:function(aI,aH,s){Y(aI,aH,s)},scrollTo:function(aI,s,aH){K(aI,aH);J(s,aH)},scrollToX:function(aH,s){K(aH,s)},scrollToY:function(s,aH){J(s,aH)},scrollBy:function(aH,s,aI){N.scrollByX(aH,aI);N.scrollByY(s,aI)},scrollByX:function(s,aI){var aH=aA()+s,aJ=aH/(Q-ah);T(aJ*j,aI)},scrollByY:function(s,aI){var aH=ay()+s,aJ=aH/(W-v);S(aJ*i,aI)},animate:function(aH,aK,s,aJ){var aI={};aI[aK]=s;aH.animate(aI,{duration:aw.animateDuration,ease:aw.animateEase,queue:false,step:aJ})},getContentPositionX:function(){return aA()},getContentPositionY:function(){return ay()},getIsScrollableH:function(){return aD},getIsScrollableV:function(){return ax},getContentPane:function(){return V},scrollToBottom:function(s){S(i,s)},hijackInternalLinks:function(){m()}})}f=b.extend({},b.fn.jScrollPane.defaults,f);var e;this.each(function(){var g=b(this),h=g.data("jsp");if(h){h.reinitialise(f)}else{h=new d(g,f);g.data("jsp",h)}e=e?e.add(g):g});return e};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:10,arrowButtonSpeed:10,arrowRepeatFreq:100,arrowScrollOnHover:false,trackClickSpeed:30,trackClickRepeatFreq:100,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false}})(jQuery,this);
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(i){var g=i||window.event,f=[].slice.call(arguments,1),j=0,h=true,e=0,d=0;i=c.event.fix(g);i.type="mousewheel";if(i.wheelDelta){j=i.wheelDelta/120}if(i.detail){j=-i.detail/3}d=j;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){d=0;e=-1*j}if(g.wheelDeltaY!==undefined){d=g.wheelDeltaY/120}if(g.wheelDeltaX!==undefined){e=-1*g.wheelDeltaX/120}f.unshift(i,j,e,d);return c.event.handle.apply(this,f)}})(jQuery);(function(a){a.each(["touchstart","touchend","touchmove"],function(c,b){if(!document.addEventListener){return}var d;document.addEventListener(b,function(f){if(f.touches&&f.touches.length>1){d=true;setTimeout(function(){d=false},9)}},true);a.event.special["simple"+b]={setup:function(){a(this).bind(b,a.event.special["simple"+b].handler);return true},teardown:function(){a(this).unbind(".touchdrag");return true},handler:function(f,h){if(d||!f.originalEvent||!f.originalEvent.touches||f.originalEvent.touches.length!==1){return}var g=f.originalEvent.touches.item(0);g.type="simple"+b;g.preventDefault=function(){f.preventDefault()};return a.event.handle.apply(this,[g,h])}}})})(jQuery);(function(c){var b={pos:[-260,-260]},d=3,h=document,g=h.documentElement,e=h.body,a,i;function f(){if(this===b.elem){b.pos=[-260,-260];b.elem=false;d=3}}c.event.special.mwheelIntent={setup:function(){var j=c(this).bind("mousewheel",c.event.special.mwheelIntent.handler);if(this!==h&&this!==g&&this!==e){j.bind("mouseleave",f)}j=null;return true},teardown:function(){c(this).unbind("mousewheel",c.event.special.mwheelIntent.handler).unbind("mouseleave",f);return true},handler:function(j,k){var l=[j.clientX,j.clientY];if(this===b.elem||Math.abs(b.pos[0]-l[0])>d||Math.abs(b.pos[1]-l[1])>d){b.elem=this;b.pos=l;d=250;clearTimeout(i);i=setTimeout(function(){d=10},200);clearTimeout(a);a=setTimeout(function(){d=3},1500);j=c.extend({},j,{type:"mwheelIntent"});return c.event.handle.apply(this,arguments)}}};c.fn.extend({mwheelIntent:function(j){return j?this.bind("mwheelIntent",j):this.trigger("mwheelIntent")},unmwheelIntent:function(j){return this.unbind("mwheelIntent",j)}});c(function(){e=h.body;c(h).bind("mwheelIntent.mwheelIntentDefault",c.noop)})})(jQuery);var cCurrentRE=new RegExp("^"+location.protocol+"\\/\\/"+location.host.replace(".",".")+".*(?:html|\\/)$","i");var _gaq=_gaq||[];$(function(){var b=false;var a=true;$.history.init(function(c){if(a){a=false;return false}$("#a").load(c+"?music=off #a > *",function(){_gaq.push(["_trackPageview",c]);b=false;$.history.cacheCurrentPage=$.history.cache[c];jQuery.fn.e4ClearEvents();jQuery.fn.e4Reflash();pageIsReady()})},{unescape:"/"});$.history.cache={};$.history.cacheCurrentPage=location.href;$("a").live("click",function(){if(!this.onclick&&this.href.match(cCurrentRE)){if($.history.cacheCurrentPage==this.href){return false}if(!b){b=true;var c=new RegExp("^http:\\/\\/[^\\/]+(.*)$");var d=this.href.match(c);$.history.cache[d[1]]=this.href;$.history.load(d[1])}return false}});pageIsReady()});function pageIsReady(){$("#pText").jScrollPane({hideFocus:true});$("#pNext").astoriaProductGallery({next:"#pNext",prev:"#pPrev",content:"#pContent",dots:"#pDots"});$("#body.bGalleryFacebook").astoriaFBImageGallery({path:$.history.cacheCurrentPage})};
