window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){arguments.callee=arguments.callee.caller;console.log(Array.prototype.slice.call(arguments))}};(function(e){function h(){}for(var g="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),f;f=g.pop();){e[f]=e[f]||h}})(window.console=window.console||{});jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a
}});
/*!
 * jQuery Tools v1.2.5 - The missing UI library for the Web
 * 
 * scrollable/scrollable.js
 * scrollable/scrollable.autoscroll.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(g){g.tools=g.tools||{version:"v1.2.5"},g.tools.scrollable={conf:{activeClass:"active",circular:!1,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:!0,mousewheel:!1,next:".next",prev:".prev",speed:400,vertical:!1,touch:!0,wheelSpeed:0}};function f(k,e){var m=parseInt(k.css(e),10);if(m){return m}var l=k[0].currentStyle;return l&&l.width&&parseInt(l.width,10)}function j(a,k){var e=g(k);return e.length<2?e:a.parent().find(k)}var i;function h(x,w){var v=this,u=x.add(v),t=x.children(),s=0,r=w.vertical;i||(i=v),t.length>1&&(t=g(w.items,x)),g.extend(v,{getConf:function(){return w},getIndex:function(){return s},getSize:function(){return v.getItems().size()},getNaviButtons:function(){return d.add(c)},getRoot:function(){return x},getItemWrap:function(){return t},getItems:function(){return t.children(w.item).not("."+w.clonedClass)},move:function(k,e){return v.seekTo(s+k,e)},next:function(b){return v.move(1,b)},prev:function(b){return v.move(-1,b)},begin:function(b){return v.seekTo(0,b)},end:function(b){return v.seekTo(v.getSize()-1,b)},focus:function(){i=v;return v},addItem:function(e){e=g(e),w.circular?(t.children("."+w.clonedClass+":last").before(e),t.children("."+w.clonedClass+":first").replaceWith(e.clone().addClass(w.clonedClass))):t.append(e),u.trigger("onAddItem",[e]);return v},seekTo:function(o,B,z){o.jquery||(o*=1);if(w.circular&&o===0&&s==-1&&B!==0){return v}if(!w.circular&&o<0||o>v.getSize()||o<-1){return v}var y=o;o.jquery?o=v.getItems().index(o):y=v.getItems().eq(o);var e=g.Event("onBeforeSeek");if(!z){u.trigger(e,[o,B]);if(e.isDefaultPrevented()||!y.length){return v}}var A=r?{top:-y.position().top}:{left:-y.position().left};s=o,i=v,B===undefined&&(B=w.speed),t.animate(A,B,w.easing,z||function(){u.trigger("onSeek",[o])});return v}}),g.each(["onBeforeSeek","onSeek","onAddItem"],function(e,k){g.isFunction(w[k])&&g(v).bind(k,w[k]),v[k]=function(l){l&&g(v).bind(k,l);return v}});if(w.circular){var q=v.getItems().slice(-1).clone().prependTo(t),p=v.getItems().eq(1).clone().appendTo(t);q.add(p).addClass(w.clonedClass),v.onBeforeSeek(function(k,e,l){if(!k.isDefaultPrevented()){if(e==-1){v.seekTo(q,l,function(){v.end(0)});return k.preventDefault()}e==v.getSize()&&v.seekTo(p,l,function(){v.begin(0)})}}),v.seekTo(0,0,function(){})}var d=j(x,w.prev).click(function(){v.prev()}),c=j(x,w.next).click(function(){v.next()});!w.circular&&v.getSize()>1&&(v.onBeforeSeek(function(k,e){setTimeout(function(){k.isDefaultPrevented()||(d.toggleClass(w.disabledClass,e<=0),c.toggleClass(w.disabledClass,e>=v.getSize()-1))},1)}),w.initialIndex||d.addClass(w.disabledClass)),w.mousewheel&&g.fn.mousewheel&&x.mousewheel(function(k,e){if(w.mousewheel){v.move(e<0?1:-1,w.wheelSpeed||50);return !1}});if(w.touch){var a={};t[0].ontouchstart=function(k){var e=k.touches[0];a.x=e.clientX,a.y=e.clientY},t[0].ontouchmove=function(k){if(k.touches.length==1&&!t.is(":animated")){var e=k.touches[0],m=a.x-e.clientX,l=a.y-e.clientY;v[r&&l>0||!r&&m>0?"next":"prev"](),k.preventDefault()}}}w.keyboard&&g(document).bind("keydown.scrollable",function(e){if(w.keyboard&&!e.altKey&&!e.ctrlKey&&!g(e.target).is(":input")){if(w.keyboard!="static"&&i!=v){return}var k=e.keyCode;if(r&&(k==38||k==40)){v.move(k==38?-1:1);return e.preventDefault()}if(!r&&(k==37||k==39)){v.move(k==37?-1:1);return e.preventDefault()}}}),w.initialIndex&&v.seekTo(w.initialIndex,0,function(){})}g.fn.scrollable=function(a){var d=this.data("scrollable");if(d){return d}a=g.extend({},g.tools.scrollable.conf,a),this.each(function(){d=new h(g(this),a),g(this).data("scrollable",d)});return a.api?d:this}})(jQuery);(function(d){var c=d.tools.scrollable;c.autoscroll={conf:{autoplay:!0,interval:3000,autopause:!0}},d.fn.autoscroll=function(f){typeof f=="number"&&(f={interval:f});
var b=d.extend({},c.autoscroll.conf,f),a;this.each(function(){var e=d(this).data("scrollable");e&&(a=e);var h,g=!0;e.play=function(){h||(g=!1,h=setInterval(function(){e.next()},b.interval))},e.pause=function(){h=clearInterval(h)},e.stop=function(){e.pause(),g=!0},b.autopause&&e.getRoot().add(e.getNaviButtons()).hover(e.pause,e.play),b.autoplay&&e.play()});return b.api?a:this}})(jQuery);(function(d,e,f){d.fn.jScrollPane=function(a){function b(bs,bc){var bj,ba=this,a2,bF,aL,bD,a7,a1,s,aP,bY,bT,br,aX,bi,aY,aW,bP,a6,bz,a3,aN,bx,by,bK,bC,bm,aU,bt,bl,aJ,bp,bQ,a0,bf,bG=true,bb=true,bR=false,aV=false,bA=bs.clone(false,false).empty(),bN=d.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";bQ=bs.css("paddingTop")+" "+bs.css("paddingRight")+" "+bs.css("paddingBottom")+" "+bs.css("paddingLeft");a0=(parseInt(bs.css("paddingLeft"),10)||0)+(parseInt(bs.css("paddingRight"),10)||0);function bv(h){var m,k,l,o,g,i,j=false,n=false;bj=h;if(a2===f){g=bs.scrollTop();i=bs.scrollLeft();bs.css({overflow:"hidden",padding:0});bF=bs.innerWidth()+a0;aL=bs.innerHeight();bs.width(bF);a2=d('<div class="jspPane" />').css("padding",bQ).append(bs.children());bD=d('<div class="jspContainer" />').css({width:bF+"px",height:aL+"px"}).append(a2).appendTo(bs)}else{bs.css("width","");j=bj.stickToBottom&&bg();n=bj.stickToRight&&bw();o=bs.innerWidth()+a0!=bF||bs.outerHeight()!=aL;if(o){bF=bs.innerWidth()+a0;aL=bs.innerHeight();bD.css({width:bF+"px",height:aL+"px"})}if(!o&&bf==a7&&a2.outerHeight()==a1){bs.width(bF);return}bf=a7;a2.css("width","");bs.width(bF);bD.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}a2.css("overflow","auto");if(h.contentWidth){a7=h.contentWidth}else{a7=a2[0].scrollWidth}a1=a2[0].scrollHeight;a2.css("overflow","");s=a7/bF;aP=a1/aL;bY=aP>1;bT=s>1;if(!(bT||bY)){bs.removeClass("jspScrollable");a2.css({top:0,width:bD.width()-a0});aS();bq();a9();aK();bH()}else{bs.addClass("jspScrollable");m=bj.maintainPosition&&(bi||bP);if(m){k=bV();l=bX()}bS();c();bo();if(m){bd(n?(a7-bF):k,false);be(j?(a1-aL):l,false)}bh();bJ();bB();if(bj.enableKeyboardNavigation){a8()}if(bj.clickOnTrack){aQ()}bu();if(bj.hijackInternalLinks){aT()}}if(bj.autoReinitialise&&!bp){bp=setInterval(function(){bv(bj)},bj.autoReinitialiseDelay)}else{if(!bj.autoReinitialise&&bp){clearInterval(bp)}}g&&bs.scrollTop(0)&&be(g,false);i&&bs.scrollLeft(0)&&bd(i,false);bs.trigger("jsp-initialised",[bT||bY])}function bS(){if(bY){bD.append(d('<div class="jspVerticalBar" />').append(d('<div class="jspCap jspCapTop" />'),d('<div class="jspTrack" />').append(d('<div class="jspDrag" />').append(d('<div class="jspDragTop" />'),d('<div class="jspDragBottom" />'))),d('<div class="jspCap jspCapBottom" />')));a6=bD.find(">.jspVerticalBar");bz=a6.find(">.jspTrack");br=bz.find(">.jspDrag");if(bj.showArrows){by=d('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",bU(0,-1)).bind("click.jsp",bW);bK=d('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",bU(0,1)).bind("click.jsp",bW);if(bj.arrowScrollOnHover){by.bind("mouseover.jsp",bU(0,-1,by));bK.bind("mouseover.jsp",bU(0,1,bK))}bE(bz,bj.verticalArrowPositions,by,bK)}aN=aL;bD.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){aN-=d(this).outerHeight()});br.hover(function(){br.addClass("jspHover")},function(){br.removeClass("jspHover")}).bind("mousedown.jsp",function(h){d("html").bind("dragstart.jsp selectstart.jsp",bW);br.addClass("jspActive");var g=h.pageY-br.position().top;d("html").bind("mousemove.jsp",function(i){a5(i.pageY-g,false)}).bind("mouseup.jsp mouseleave.jsp",bn);return false});aR()}}function aR(){bz.height(aN+"px");bi=0;a3=bj.verticalGutter+bz.outerWidth();a2.width(bF-a3-a0);try{if(a6.position().left===0){a2.css("margin-left",a3+"px")}}catch(g){}}function c(){if(bT){bD.append(d('<div class="jspHorizontalBar" />').append(d('<div class="jspCap jspCapLeft" />'),d('<div class="jspTrack" />').append(d('<div class="jspDrag" />').append(d('<div class="jspDragLeft" />'),d('<div class="jspDragRight" />'))),d('<div class="jspCap jspCapRight" />')));
bC=bD.find(">.jspHorizontalBar");bm=bC.find(">.jspTrack");aY=bm.find(">.jspDrag");if(bj.showArrows){bl=d('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",bU(-1,0)).bind("click.jsp",bW);aJ=d('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",bU(1,0)).bind("click.jsp",bW);if(bj.arrowScrollOnHover){bl.bind("mouseover.jsp",bU(-1,0,bl));aJ.bind("mouseover.jsp",bU(1,0,aJ))}bE(bm,bj.horizontalArrowPositions,bl,aJ)}aY.hover(function(){aY.addClass("jspHover")},function(){aY.removeClass("jspHover")}).bind("mousedown.jsp",function(h){d("html").bind("dragstart.jsp selectstart.jsp",bW);aY.addClass("jspActive");var g=h.pageX-aY.position().left;d("html").bind("mousemove.jsp",function(i){a4(i.pageX-g,false)}).bind("mouseup.jsp mouseleave.jsp",bn);return false});aU=bD.innerWidth();bI()}}function bI(){bD.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){aU-=d(this).outerWidth()});bm.width(aU+"px");bP=0}function bo(){if(bT&&bY){var h=bm.outerHeight(),g=bz.outerWidth();aN-=h;d(bC).find(">.jspCap:visible,>.jspArrow").each(function(){aU+=d(this).outerWidth()});aU-=g;aL-=g;bF-=h;bm.parent().append(d('<div class="jspCorner" />').css("width",h+"px"));aR();bI()}if(bT){a2.width((bD.outerWidth()-a0)+"px")}a1=a2.outerHeight();aP=a1/aL;if(bT){bt=Math.ceil(1/s*aU);if(bt>bj.horizontalDragMaxWidth){bt=bj.horizontalDragMaxWidth}else{if(bt<bj.horizontalDragMinWidth){bt=bj.horizontalDragMinWidth}}aY.width(bt+"px");aW=aU-bt;bL(bP)}if(bY){bx=Math.ceil(1/aP*aN);if(bx>bj.verticalDragMaxHeight){bx=bj.verticalDragMaxHeight}else{if(bx<bj.verticalDragMinHeight){bx=bj.verticalDragMinHeight}}br.height(bx+"px");aX=aN-bx;bM(bi)}}function bE(l,j,m,i){var g="before",k="after",h;if(j=="os"){j=/Mac/.test(navigator.platform)?"after":"split"}if(j==g){k=j}else{if(j==k){g=j;h=m;m=i;i=h}}l[g](m)[k](i)}function bU(i,g,h){return function(){bk(i,g,this,h);this.blur();return false}}function bk(k,l,g,h){g=d(g).addClass("jspActive");var j,m,n=true,i=function(){if(k!==0){ba.scrollByX(k*bj.arrowButtonSpeed)}if(l!==0){ba.scrollByY(l*bj.arrowButtonSpeed)}m=setTimeout(i,n?bj.initialDelay:bj.arrowRepeatFreq);n=false};i();j=h?"mouseout.jsp":"mouseup.jsp";h=h||d("html");h.bind(j,function(){g.removeClass("jspActive");m&&clearTimeout(m);m=null;h.unbind(j)})}function aQ(){aK();if(bY){bz.bind("mousedown.jsp",function(h){if(h.originalTarget===f||h.originalTarget==h.currentTarget){var k=d(this),g=k.offset(),j=h.pageY-g.top-bi,m,n=true,i=function(){var o=k.offset(),r=h.pageY-o.top-bx/2,q=aL*bj.scrollPagePercent,p=aX*q/(a1-aL);if(j<0){if(bi-p>r){ba.scrollByY(-q)}else{a5(r)}}else{if(j>0){if(bi+p<r){ba.scrollByY(q)}else{a5(r)}}else{l();return}}m=setTimeout(i,n?bj.initialDelay:bj.trackClickRepeatFreq);n=false},l=function(){m&&clearTimeout(m);m=null;d(document).unbind("mouseup.jsp",l)};i();d(document).bind("mouseup.jsp",l);return false}})}if(bT){bm.bind("mousedown.jsp",function(h){if(h.originalTarget===f||h.originalTarget==h.currentTarget){var k=d(this),g=k.offset(),j=h.pageX-g.left-bP,m,n=true,i=function(){var o=k.offset(),r=h.pageX-o.left-bt/2,q=bF*bj.scrollPagePercent,p=aW*q/(a7-bF);if(j<0){if(bP-p>r){ba.scrollByX(-q)}else{a4(r)}}else{if(j>0){if(bP+p<r){ba.scrollByX(q)}else{a4(r)}}else{l();return}}m=setTimeout(i,n?bj.initialDelay:bj.trackClickRepeatFreq);n=false},l=function(){m&&clearTimeout(m);m=null;d(document).unbind("mouseup.jsp",l)};i();d(document).bind("mouseup.jsp",l);return false}})}}function aK(){if(bm){bm.unbind("mousedown.jsp")}if(bz){bz.unbind("mousedown.jsp")}}function bn(){d("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(br){br.removeClass("jspActive")}if(aY){aY.removeClass("jspActive")}}function a5(g,h){if(!bY){return}if(g<0){g=0}else{if(g>aX){g=aX}}if(h===f){h=bj.animateScroll}if(h){ba.animate(br,"top",g,bM)}else{br.css("top",g);bM(g)}}function bM(k){if(k===f){k=br.position().top}bD.scrollTop(0);bi=k;var h=bi===0,j=bi==aX,i=k/aX,g=-i*(a1-aL);if(bG!=h||bR!=j){bG=h;bR=j;bs.trigger("jsp-arrow-change",[bG,bR,bb,aV])
}aM(h,j);a2.css("top",g);bs.trigger("jsp-scroll-y",[-g,h,j]).trigger("scroll")}function a4(h,g){if(!bT){return}if(h<0){h=0}else{if(h>aW){h=aW}}if(g===f){g=bj.animateScroll}if(g){ba.animate(aY,"left",h,bL)}else{aY.css("left",h);bL(h)}}function bL(k){if(k===f){k=aY.position().left}bD.scrollTop(0);bP=k;var h=bP===0,i=bP==aW,j=k/aW,g=-j*(a7-bF);if(bb!=h||aV!=i){bb=h;aV=i;bs.trigger("jsp-arrow-change",[bG,bR,bb,aV])}aO(h,i);a2.css("left",g);bs.trigger("jsp-scroll-x",[-g,h,i]).trigger("scroll")}function aM(h,g){if(bj.showArrows){by[h?"addClass":"removeClass"]("jspDisabled");bK[g?"addClass":"removeClass"]("jspDisabled")}}function aO(h,g){if(bj.showArrows){bl[h?"addClass":"removeClass"]("jspDisabled");aJ[g?"addClass":"removeClass"]("jspDisabled")}}function be(g,i){var h=g/(a1-aL);a5(h*aX,i)}function bd(i,g){var h=i/(a7-bF);a4(h*aW,g)}function bO(h,m,u){var p,t,r,v=0,i=0,g,n,o,k,l,j;try{p=d(h)}catch(q){return}t=p.outerHeight();r=p.outerWidth();bD.scrollTop(0);bD.scrollLeft(0);while(!p.is(".jspPane")){v+=p.position().top;i+=p.position().left;p=p.offsetParent();if(/^body|html$/i.test(p[0].nodeName)){return}}g=bX();o=g+aL;if(v<g||m){l=v-bj.verticalGutter}else{if(v+t>o){l=v-aL+t+bj.verticalGutter}}if(l){be(l,u)}n=bV();k=n+bF;if(i<n||m){j=i-bj.horizontalGutter}else{if(i+r>k){j=i-bF+r+bj.horizontalGutter}}if(j){bd(j,u)}}function bV(){return -a2.position().left}function bX(){return -a2.position().top}function bg(){var g=a1-aL;return(g>20)&&(g-bX()<10)}function bw(){var g=a7-bF;return(g>20)&&(g-bV()<10)}function bJ(){bD.unbind(bN).bind(bN,function(i,h,j,l){var k=bP,g=bi;ba.scrollBy(j*bj.mouseWheelSpeed,-l*bj.mouseWheelSpeed,false);return k==bP&&g==bi})}function aS(){bD.unbind(bN)}function bW(){return false}function bh(){a2.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(g){bO(g.target,false)})}function bq(){a2.find(":input,a").unbind("focus.jsp")}function a8(){var g,j,h=[];bT&&h.push(bC[0]);bY&&h.push(a6[0]);a2.focus(function(){bs.focus()});bs.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(k){if(k.target!==this&&!(h.length&&d(k.target).closest(h).length)){return}var l=bP,m=bi;switch(k.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:g=k.keyCode;i();break;case 35:be(a1-aL);g=null;break;case 36:be(0);g=null;break}j=k.keyCode==g&&l!=bP||m!=bi;return !j}).bind("keypress.jsp",function(k){if(k.keyCode==g){i()}return !j});if(bj.hideFocus){bs.css("outline","none");if("hideFocus" in bD[0]){bs.attr("hideFocus",true)}}else{bs.css("outline","");if("hideFocus" in bD[0]){bs.attr("hideFocus",false)}}function i(){var k=bP,l=bi;switch(g){case 40:ba.scrollByY(bj.keyboardSpeed,false);break;case 38:ba.scrollByY(-bj.keyboardSpeed,false);break;case 34:case 32:ba.scrollByY(aL*bj.scrollPagePercent,false);break;case 33:ba.scrollByY(-aL*bj.scrollPagePercent,false);break;case 39:ba.scrollByX(bj.keyboardSpeed,false);break;case 37:ba.scrollByX(-bj.keyboardSpeed,false);break}j=k!=bP||l!=bi;return j}}function a9(){bs.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function bu(){if(location.hash&&location.hash.length>1){var h,j,i=escape(location.hash);try{h=d(i)}catch(g){return}if(h.length&&a2.find(i)){if(bD.scrollTop()===0){j=setInterval(function(){if(bD.scrollTop()>0){bO(i,true);d(document).scrollTop(bD.position().top);clearInterval(j)}},50)}else{bO(i,true);d(document).scrollTop(bD.position().top)}}}}function bH(){d("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function aT(){bH();d("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var g=this.href.split("#"),h;if(g.length>1){h=g[1];if(h.length>0&&a2.find("#"+h).length>0){bO("#"+h,true);return false}}})}function bB(){var k,l,i,j,h,g=false;bD.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(n){var m=n.originalEvent.touches[0];k=bV();l=bX();i=m.pageX;j=m.pageY;h=false;g=true}).bind("touchmove.jsp",function(m){if(!g){return}var n=m.originalEvent.touches[0],o=bP,p=bi;
ba.scrollTo(k+i-n.pageX,l+j-n.pageY);h=h||Math.abs(i-n.pageX)>5||Math.abs(j-n.pageY)>5;return o==bP&&p==bi}).bind("touchend.jsp",function(m){g=false}).bind("click.jsp-touchclick",function(m){if(h){h=false;return false}})}function aZ(){var g=bX(),h=bV();bs.removeClass("jspScrollable").unbind(".jsp");bs.replaceWith(bA.append(a2.children()));bA.scrollTop(g);bA.scrollLeft(h)}d.extend(ba,{reinitialise:function(g){g=d.extend({},bj,g);bv(g)},scrollToElement:function(h,i,g){bO(h,i,g)},scrollTo:function(h,g,i){bd(h,i);be(g,i)},scrollToX:function(h,g){bd(h,g)},scrollToY:function(g,h){be(g,h)},scrollToPercentX:function(h,g){bd(h*(a7-bF),g)},scrollToPercentY:function(h,g){be(h*(a1-aL),g)},scrollBy:function(i,g,h){ba.scrollByX(i,h);ba.scrollByY(g,h)},scrollByX:function(g,i){var j=bV()+Math[g<0?"floor":"ceil"](g),h=j/(a7-bF);a4(h*aW,i)},scrollByY:function(g,i){var j=bX()+Math[g<0?"floor":"ceil"](g),h=j/(a1-aL);a5(h*aX,i)},positionDragX:function(g,h){a4(g,h)},positionDragY:function(h,g){a5(h,g)},animate:function(k,h,g,i){var j={};j[h]=g;k.animate(j,{duration:bj.animateDuration,ease:bj.animateEase,queue:false,step:i})},getContentPositionX:function(){return bV()},getContentPositionY:function(){return bX()},getContentWidth:function(){return a7},getContentHeight:function(){return a1},getPercentScrolledX:function(){return bV()/(a7-bF)},getPercentScrolledY:function(){return bX()/(a1-aL)},getIsScrollableH:function(){return bT},getIsScrollableV:function(){return bY},getContentPane:function(){return a2},scrollToBottom:function(g){a5(aX,g)},hijackInternalLinks:function(){aT()},destroy:function(){aZ()}});bv(bc)}a=d.extend({},d.fn.jScrollPane.defaults,a);d.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){a[this]=a[this]||a.speed});return this.each(function(){var h=d(this),c=h.data("jsp");if(c){c.reinitialise(a)}else{c=new b(h,a);h.data("jsp",c)}})};d.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:f,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);(function(j,o,r){var q="hashchange",l=document,n,m=j.event.special,k=l.documentMode,p="on"+q in o&&(k===r||k>7);function s(a){a=a||location.href;return"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}j.fn[q]=function(a){return a?this.bind(q,a):this.trigger(q)};j.fn[q].delay=50;m[q]=j.extend(m[q],{setup:function(){if(p){return false}j(n.start)},teardown:function(){if(p){return false}j(n.stop)}});n=(function(){var d={},e,a=s(),c=function(h){return h},b=c,f=c;d.start=function(){e||g()};d.stop=function(){e&&clearTimeout(e);e=r};function g(){var h=s(),i=f(a);if(h!==a){b(a=h,i);j(o).trigger(q)}else{if(i!==a){location.href=location.href.replace(/#.*/,"")+i}}e=setTimeout(g,j.fn[q].delay)}j.browser.msie&&!p&&(function(){var i,h;d.start=function(){if(!i){h=j.fn[q].src;h=h&&h+s();i=j('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){h||b(s());g()}).attr("src",h||"javascript:0").insertAfter("body")[0].contentWindow;l.onpropertychange=function(){try{if(event.propertyName==="title"){i.document.title=l.title}}catch(t){}}}};d.stop=c;f=function(){return s(i.location.href)};b=function(w,z){var x=i.document,y=j.fn[q].domain;if(w!==z){x.title=l.title;x.open();y&&x.write('<script>document.domain="'+y+'"<\/script>');x.close();i.location.hash=w}}})();return d})()})(jQuery,this);var ANIMATE_STYLE="SlideUp";$(document).ready(function(){var b;$("#main_nav > ul > li > a").live("hover",function(p){if(p.type=="mouseover"||p.type=="mouseenter"){if(b){clearTimeout(b)}if($(this).siblings("ul").length>0){$(this).parent().addClass("hover")}else{$("#main_nav .hover").removeClass("hover")}}if(p.type=="mouseout"||p.type=="mouseleave"){if($(this).siblings("ul").length>0){var o=$(this);b=setTimeout(function(){$("#main_nav .hover").removeClass("hover")},500)}}});$("#main_nav li ul li > a").live("hover",function(o){if(b){clearTimeout(b)}if(o.type=="mouseover"||o.type=="mouseenter"){}if(o.type=="mouseout"||o.type=="mouseleave"){b=setTimeout(function(){$("#main_nav .hover").removeClass("hover")},500)}});$("#main_nav li > a,footer li > a").live("click",function(o){if($(this).siblings("ul").length>0){return false}else{$(this).parent().addClass("active");return n(o)}});$(".news_snippet_container a,#our_work_container ul a,nav#blog_nav a,#sitemapContainer a,.news_prev,.news_next,.home_tell_me_more,#home_news_container a, #home_spotlight div a").live("click",n);$("#ow_prev a,#ow_next a").live("click",function(o){n(o,undefined,"Fade")});$(".floating_pulldown div.content").live("click",function(){if(parseInt($(this).css("top"))>0){$(this).animate({top:"-115px"},{duration:500,easing:"easeOutBounce"})}else{$(this).animate({top:"1px"},{duration:500,easing:"easeOutBounce"})}});$("#printMap").live("click",function(){window.open("/printMap.php")});var e=0.25;var j=0.5;var h=500;$("a.filter").live("click",function(p){p.preventDefault();var o=$(this).text();$(".filter").removeClass("active");$(this).addClass("active");$("a.hideFilter").removeClass("hidden");if($("#our_work_container li").length>0){$("#our_work_container li").each(function(){if($(this).data("filter")==o){$(this).removeClass("filtered")}else{$(this).animate({opacity:e},h,function(){$(this).addClass("filtered");if($(".ie7,.ie8").length==0){$(this).css("opacity","")}})}})}return false});$("a.hideFilter").live("click",function(){$(this).addClass("hidden");$(".filter").removeClass("active");$("#our_work_container li").stop().css({opacity:e}).removeClass("filtered").animate({opacity:"1.0"},h)});$("#our_work_container li").live("hover",function(o){if(o.type=="mouseover"||o.type=="mouseenter"){if(!$(this).hasClass("filtered")){$(this).find(".thumbTitle").animate({bottom:"0px"},h);var p=$(this).index();$("#our_work_container li").each(function(){if(!$(this).hasClass("filtered")){if($(this).index()!=p){$(this).stop().animate({opacity:j},h,function(){$(this).addClass("fade");if($(".ie7,.ie8").length==0){$(this).css("opacity","")}})}}})}}if(o.type=="mouseout"||o.type=="mouseleave"){var p=$(this).index();if(!$(this).hasClass("filtered")){$(this).find(".thumbTitle").animate({bottom:"-40px"},h);$("#our_work_container li").each(function(){if(!$(this).hasClass("filtered")){if($(this).index()!=p){$(this).stop().css({opacity:j}).removeClass("fade").animate({opacity:"1.0"},h)}}})}}});$(".ow_sm_img").live("hover",function(o){if(o.type=="mouseover"||o.type=="mouseenter"){$(this).append('<div class="ow_max_button"></div>')}if(o.type=="mouseout"||o.type=="mouseleave"){$(this).find(".ow_max_button").remove()}});$(".ow_sm_img").live("click",function(o){var p=$("#ow_img_container .ow_sm_img").index(this);$(".ow_lrg_img").eq(p).show();$("#ow_img_container > div").animate({left:"-490px"},500)});$(".ow_lrg_img").live("click",function(o){$this=$(this);$("#ow_img_container > div").animate({left:"0px"},500,function(){$this.hide()})});$(".ow_lrg_img").live("hover",function(o){if(o.type=="mouseover"||o.type=="mouseenter"){$(this).append('<div class="ow_close_button"></div>')}if(o.type=="mouseout"||o.type=="mouseleave"){$(this).find(".ow_close_button").remove()}});$("div#more_our_work").live("click",function(o){n(o,"/our_work.php")});$("#ow_prev").live("hover",function(p){if(p.type=="mouseover"||p.type=="mouseenter"){var o=$(this).find("#ow_prev_text").width();$(this).css("width",(o+62)+"px");$(this).find("#ow_prev_centre").css("width",(o+42)+"px")
}if(p.type=="mouseout"||p.type=="mouseleave"){$(this).css("width",(52)+"px");$(this).find("#ow_prev_centre").css("width",(32)+"px")}});$("#ow_next").live("hover",function(p){if(p.type=="mouseover"||p.type=="mouseenter"){var o=$(this).find("#ow_next_text").width();$(this).css("width",(o+62)+"px");$(this).find("#ow_next_centre").css("width",(o+42)+"px")}if(p.type=="mouseout"||p.type=="mouseleave"){$(this).css("width",(52)+"px");$(this).find("#ow_next_centre").css("width",(32)+"px")}});$(".levelExpand").live("click",function(){if($(this).hasClass("active")){$(this).removeClass("active").html('<a href="javascript:void()">+&nbsp;</a>');$(this).parent().find(".level2").hide(300)}else{$(this).addClass("active").html('<a href="javascript:void()">&ndash;&nbsp;&nbsp;</a>');$(this).parent().find(".level2").show(300)}});$("#MoreVideos a").live("click",function(){var o=$("#frameYouTubeVideos");o.attr("src","/YouTube.php?count=all");o.attr("scrolling","yes");$(this).css("visibility","hidden")});var a=false;$(window).hashchange(function(){if(!a){d()}a=false});function d(){var o=window.location.href.substr(window.location.href.lastIndexOf("/")+1).toString();if(location.hash!=""){o=location.hash}if(o.indexOf("!")!=-1){var o=window.location.href.substr(window.location.href.lastIndexOf("!")+1).toString();if(o!=window.location.pathname){if(ANIMATE_STYLE=="Fade"){$("#main,footer").fadeOut(1)}else{$("#main,footer").css({top:-1500})}k(o);return}}}d();function n(q,r,o){if($(".ie7").length==0){var s="#";if(r==undefined){var p;if(!q){var q=window.event}if(q.target){p=q.target}else{if(q.srcElement){p=q.srcElement}}if(p.nodeType==3){p=p.parentNode}s=$(p).attr("href");if(s==undefined){s=$(p).parents("a").eq(0).attr("href")}}else{s=r}if((s!="javascript:void()")&&(s.indexOf("http://")!==0)){q.preventDefault();if(o==undefined){o=ANIMATE_STYLE}if(o=="Fade"){$("#main,footer").fadeOut(250)}else{$("#main,footer").animate({top:-($("#main").height()+$("footer").height())},500)}a=true;location="#!"+s;k(s,o);_gaq.push(["_trackPageview",s]);return false}}}function k(p,o){g();$.ajax(p,{success:function(q){var r=setInterval(function(){if(!$("#main").is(":animated")){clearInterval(r);var s;var t;scriptStart=q.search(/AJAXrequired/i);if(scriptStart!=-1){scriptStart=q.indexOf(">",scriptStart);scriptStart++;s=q.substr(scriptStart,q.length-scriptStart);scriptEnd=s.search(/\<\/script>/i);s=s.substr(0,scriptEnd);t=$("#main_inner",q).html();t+='<script data-test="true">'+s+"<\/script>"}else{t=$("#main_inner",q).html()}i();$("#main_inner").children().detach();$("#main_inner").html(t);if($.browser.safari){bodyelem=$("body")}else{bodyelem=$("html,body")}if(o=="Fade"){bodyelem.scrollTop(0);$("#main,footer").fadeIn(250)}else{$("#main,footer").css({top:-($("#main").height()+$("footer").height())});$("#main,footer").animate({top:"0"},500,function(){bodyelem.scrollTop(0)})}m();Cufon.refresh();c();l()}},10)}})}function g(p){if(p!=null){$(p).addClass("active")}else{var o=window.location.href.substr(window.location.href.lastIndexOf("/")+1).toString();if(window.location.pathname=="/"&&window.location.hash==""){o="index.php"}else{if(window.location.hash==""){if(window.location.href.indexOf("/case-studies/")!=-1){o="/case-studies/"}if((window.location.href.indexOf("/news/")!=-1)||(window.location.href.indexOf("/our_news.php")!=-1)){o="/news/"}}else{if(window.location.hash.indexOf("/case-studies/")!=-1){o="/case-studies/"}if((window.location.hash.indexOf("/news/")!=-1)||(window.location.hash.indexOf("/our_news.php")!=-1)){o="/news/"}}}if(o.indexOf("?")!=-1){o=o.substring(0,o.indexOf("?"))}if(o.indexOf("!")!=-1){var o=window.location.href.substr(window.location.href.lastIndexOf("!")+1).toString()}$("#main_nav ul li ul.active").removeClass("active");$("#main_nav li.active").removeClass("active");$('a[href$="'+o+'"]').parents("li").addClass("active")}}function c(){var p=new Array();$(".client_images img").each(function(s){p[s]=this.src});var r=0;var o=0;var q=$(".clients #logo_reel");q.css("background-image","url("+p[o]+")");
q.css("backgroundPosition","200px 0px");setInterval(function(){if(q.length==0){return}var s=20;var t=parseInt(q.css("backgroundPositionX"));if(isNaN(t)){t=parseInt(q.css("backgroundPosition").split(" ")[0])}var u=t/s;if(u==0){r++;if(r>40){r=0;t-=s}}else{t-=s}if(t<=-s*20){t=0;o++;if(o>=p.length){o=0}q.css("background-image","url("+p[o]+")");q.css("backgroundPosition","200px 0px")}else{t=t+"px";q.css("backgroundPosition",t+" 0px")}},50)}function i(){player=null;if($("#showcase_snippet").length>0){var o=$(".scrollable").data("scrollable");if(o){o.stop()}}}var f;function m(){if($(".employee_photo").length){var G=3000;var v=Math.floor(Math.random()*6);var y=Modernizr.prefixed("transform");var F=Modernizr.prefixed("transition");function p(){clearTimeout(f);if(y!=false){$(".employee_photo").each(function(K){var N=(Math.floor(Math.random()*8)-4)*3;var M="rotate("+N+"deg) scale(0.8)";$(this).css(y,M).data("rotate",N);if(F!==false){transformAlt=y.replace(/([A-Z])/g,function(P,O){return"-"+O.toLowerCase()});transformAlt.replace(/^ms-/,"-ms-");var L=($.browser.safari&&!/chrome/.test(navigator.userAgent.toLowerCase()));if(L){F=false}else{$(this).css(F,transformAlt+" 0.5s ease-in-out")}}})}else{$(".employee_photo").each(function(K){$(this).find("img").animate({height:"192px"},500)})}$(".employee_photo").eq(v).css("z-index",20).addClass("active");D()}function D(){clearTimeout(f);$(".employes_slider_controls .active").removeClass("active");$("#employee_right").addClass("active");var K=$(".employee_photo").index($(".employee_photo.active"));var L=$(".employee_photo.active").css("z-index",K);L.data("rotate",-L.data("rotate"));var M="rotate("+L.data("rotate")+"deg) scale(0.7)";if(y!=false){L.css("z-index",K).removeClass("active").css(y,M)}else{L.css("z-index",K).removeClass("active").find("img").animate({height:"192px"},500)}K++;if(K>6){K=0}L=$(".employee_photo").eq(K);var M="rotate("+0+"deg) scale(1.0)";if(y!=false){L.css("z-index",20).addClass("active").css(y,M)}else{L.css("z-index",20).addClass("active").find("img").animate({height:"243px"},500)}$("#employee_name").html("<strong>"+$(".name").eq(K).html()+"</strong> | "+$(".employee_position").eq(K).html());f=setTimeout(D,G)}function A(){clearTimeout(f);$(".employes_slider_controls .active").removeClass("active");$("#employee_left").addClass("active");var K=$(".employee_photo").index($(".employee_photo.active"));var L=$(".employee_photo.active").css("z-index",K);var M="rotate("+L.data("rotate")+"deg) scale(0.7)";if(y!=false){L.css("z-index",K).removeClass("active").css(y,M)}else{L.css("z-index",K).removeClass("active").find("img").animate({height:"192px"},500)}K--;if(K<0){K=6}L=$(".employee_photo").eq(K);var M="rotate("+0+"deg) scale(1.0)";if(y!=false){L.css("z-index",20).addClass("active").css(y,M)}else{L.css("z-index",20).addClass("active").find("img").animate({height:"243px"},500)}$("#employee_name").text($(".name").eq(K).html()+" | "+$(".employee_position").eq(K).html());f=setTimeout(A,G)}function r(){clearTimeout(f);var K=$(".employee_photo").index($(".employee_photo.active"));var L=$(".employee_photo.active").css("z-index",K);var M="rotate("+L.data("rotate")+"deg) scale(0.7)";if(y!=false){L.css("z-index",K).removeClass("active").css(y,M)}else{L.css("z-index",K).removeClass("active").find("img").animate({height:"192px"},500)}$(this).addClass("active");var K=$(".employee_photo").index($(".employee_photo.active"));L=$(".employee_photo").eq(K);var M="rotate("+0+"deg) scale(1.0)";if(y!=false){L.css("z-index",20).css(y,M)}else{L.css("z-index",20).find("img").animate({height:"243px"},500)}$("#employee_name").text($(".name").eq(K).html()+" | "+$(".employee_position").eq(K).html());f=setTimeout(D,G)}p();$("#employee_left").click(A);$("#employee_right").click(D);$(".employee_photo").live("click",r);$("#employee_pause").click(function(){clearTimeout(f);$(".employes_slider_controls .active").removeClass("active");$("#employee_pause").addClass("active")});$("#employee_shuffle").click(function(){clearTimeout(f);
$("#employee_slider_images > div").fadeOut(500);$.ajax("/who_we_are.php",{cache:false,success:function(K){var L=setInterval(function(){if(!$("#employee_slider_images > div").is(":animated")){clearInterval(L);var M;M=$("#employee_slider_images > div",K).html();$("#employee_slider_images > div").html(M);$("#employee_slider_images > div").fadeIn(500);p()}},100)}})})}if($("#showcase_snippet").length>0){function w(){if($("#showcase_snippet").length>0){var M=z.getItems();var O=M.eq(z.getIndex());var L=O.find("script").text();if(L==""){L=O.find("script").html()}var K=/\btitle=(.*?)\n/i;try{var Q=L.match(K)[1];$("#showcase_title #title").html(Q)}catch(N){}var R=/\bdescription=(.*?)\n/i;try{var P=L.match(R)[1];$("#showcase_title #description").html(P)}catch(N){}$("#showcase_title").children().fadeIn(200)}}$(".scrollable").scrollable({circular:true,onBeforeSeek:function(){if(typeof(stopAnyVideos)=="function"){stopAnyVideos()}$("#showcase_title").children().fadeOut(200)},onSeek:w}).autoscroll({autoplay:false,interval:5000,autopause:false});var z=$(".scrollable").data("scrollable");w();z.play();$(".scrollable .items div").click(function(){z.stop()});$("#showcase_snippet a.next, #showcase_snippet a.prev").hover(function(){z.pause()})}if($(".emailMagic").length>0){$(".emailMagic").each(function(){var K=$(this).text();$(this).attr("href","mailto:"+K+"@brainstorm-uk.com");$(this).text(K+"@brainstorm-uk.com")})}function q(L){var K=(($(window).height()-157)/2)-52+$(window).scrollTop();$("#ow_prev,#ow_next").stop().animate({top:K+"px"},100)}if($(".rolodex_container").length>0){var u=420;var o=15;var E=25;var H=E*2;var t=0;var B=false;$(".rolodex_content .top").html($(".rolodex_content_all li.top").eq(t).html());$(".rolodex_content .bottom").html($(".rolodex_content_all li.bottom").eq(t).html());Cufon.refresh();if(t==0){$("div#roller_up").hide()}$("div#roller_up").click(function(){if(!B){B=true;t--;s("NEXT",function(){B=false;$("div#roller_down").show();if(t==0){$("div#roller_up").hide()}},$(".rolodex_content .top"),$(".rolodex_content .bottom"))}});$("div#roller_down").click(function(K){if(!B){B=true;t++;s("PREV",function(){B=false;$("div#roller_up").show();if((t+1)>=($(".rolodex_content_all li").length/2)){$("div#roller_down").hide()}},$(".rolodex_content .top"),$(".rolodex_content .bottom"))}});function s(P,K,O,L,M){var N;if(isNaN(parseInt($(".rolodex_container").css("backgroundPositionX")))){N=parseInt($(".rolodex_container").css("backgroundPosition").split(" ")[0]);currentPosY=parseInt($(".rolodex_container").css("backgroundPosition").split(" ")[1])}else{N=parseInt($(".rolodex_container").css("backgroundPositionX"));currentPosY=parseInt($(".rolodex_container").css("backgroundPositionY"))}if(P=="NEXT"){if(M!=false){N=0;if(O){O.fadeOut(H)}}else{if(N<-((o-2)*u)){$(".rolodex_content .bottom").html($(".rolodex_content_all li.bottom").eq(t).html());Cufon.replace(".rolodex_content .bottom h3");if(L){L.fadeIn(H)}if(K){K()}return}else{N-=u;if((N<-(((o-8)/2)*u))&&(N>-(((o-8)/2)*u)-u)){$(".rolodex_content .top").html($(".rolodex_content_all li.top").eq(t).html());Cufon.replace(".rolodex_content .top h3");if(O){O.fadeIn(H)}}if(N<-(((o)/2)*u)){if(L){L.fadeOut(H)}}}}}else{if(M!=false){N=-((o-2)*u);if(L){L.fadeOut(H)}}else{if(N<0){N+=u;if(N>-(((o-6)/2)*u)){if(O){O.fadeOut(H)}}if((N>-((o/2)*u))&&(N<-((o/2)*u)+u)){$(".rolodex_content .bottom").html($(".rolodex_content_all li.bottom").eq(t).html());Cufon.replace(".rolodex_content .bottom h3");if(L){L.fadeIn(H)}}}else{$(".rolodex_content .top").html($(".rolodex_content_all li.top").eq(t).html());Cufon.replace(".rolodex_content .top h3");if(O){O.fadeIn(H)}if(K){K()}return}}}$(".rolodex_container").css("backgroundPosition",N+"px "+currentPosY+"px");setTimeout(function(){s(P,K,O,L,false)},E)}}$(window).resize(q).scroll(q);q();if($(".addthis_toolbox").length>0){if(!addthisInit){addthis.init();addthisInit=true}else{window.addthis.ost=0;window.addthis.ready()}}if($(".scroll-pane").length>0){var C=($("#ow_scrollable > div").length)*196;
$("#ow_scrollable").width(C);$(".scroll-pane").jScrollPane({showArrows:true,horizontalDragMaxWidth:40,horizontalDragMinWidth:40,horizontalGutter:20})}if($(".level2").length>0){$(".level1").each(function(){if($(this).children(".level2").length>0){$(this).prepend('<span class="levelExpand"><a href="javascript:void()">+ </a></span>')}else{$(this).prepend("<span>&nbsp;&nbsp;&nbsp;</span>")}})}if($(".YouTubePlayer").length>0){if(typeof(YT)=="undefined"){var J=document.createElement("script");J.src="https://www.youtube.com/player_api";var I=document.getElementsByTagName("script")[0];I.parentNode.insertBefore(J,I)}else{if(player==null){onYouTubePlayerAPIReady()}}}}function l(){if($("#disqus_thread").length>0){if(typeof(DISQUS)!=="undefined"){DISQUS.reset({reload:true,config:function(){this.page.identifier=$("#disqus_thread").data("id");this.page.url=$("#disqus_thread").data("url")}})}}}g();m();c()});var addthisInit=false;var player;function onYouTubePlayerAPIReady(){if(player==null){player=new Array();$(".YouTubePlayer").each(function(a){var c="Player"+a;this.id=c;try{player[a]=new YT.Player(this.id,{height:$(this).data("height"),width:$(this).data("width"),videoId:$(this).data("videoid"),playerVars:{rel:0,wmode:"transparent",modestbranding:1,controls:0,origin:"http://brainstorm-uk.com/"},events:{onReady:function(d){onPlayerReady(d,c)},onStateChange:function(d){onPlayerStateChange(d,c)}}})}catch(b){}})}}function onPlayerReady(b,c){var a=b.target.getVideoEmbedCode();if(document.getElementById("embed-code")){document.getElementById("embed-code").innerHTML=a}}function onPlayerStateChange(b,c){if(b.data==YT.PlayerState.PLAYING){var a=$(".scrollable").data("scrollable");if(a){a.stop()}}}function stopAnyVideos(){try{for(x=0;x<player.length;x++){if(player[x].getPlayerState()==1){player[x].pauseVideo()}}}catch(a){}};
