;(function($){var container=null;var allLIs='',containerStr='';var element=this;var _bgStretcherPause=false;var _bgStretcherAction=false;var _bgStretcherTm=null;var random_line=new Array();var random_temp=new Array();var r_image=0;var swf_mode=false;var img_options=new Array();$.fn.bgStretcher=function(settings){if($('.bgstretcher-page').length||$('.bgstretcher-area').length){if(typeof(console)!=='undefined'&&console!=null)console.log('More than one bgStretcher');return false;}
settings=$.extend({},$.fn.bgStretcher.defaults,settings);$.fn.bgStretcher.settings=settings;function _build(body_content){if(!settings.images.length){return;}
_genHtml(body_content);containerStr='#'+settings.imageContainer;container=$(containerStr);allLIs='#'+settings.imageContainer+' LI';$(allLIs).hide().css({'z-index':1,overflow:'hidden'});if(!container.length){return;}
$(window).resize(function(){_resize(body_content)});_resize(body_content);var stratElement=0;if(settings.transitionEffect=='simpleSlide'){if(settings.sequenceMode=='random'){if(typeof(console)!=='undefined'&&console!=null){console.log('Effect \'simpleSlide\' don\'t be to use with mode random.');console.log('Mode was automaticly set in normal.');}}
$(allLIs).css({'float':'left',position:'static'});$(allLIs).show();if($.fn.bgStretcher.settings.slideDirection=='NW'||$.fn.bgStretcher.settings.slideDirection=='NE'){$.fn.bgStretcher.settings.slideDirection='N';}
if($.fn.bgStretcher.settings.slideDirection=='SW'||$.fn.bgStretcher.settings.slideDirection=='SE'){$.fn.bgStretcher.settings.slideDirection='S';}
if($.fn.bgStretcher.settings.slideDirection=='S'||$.fn.bgStretcher.settings.slideDirection=='E'){settings.sequenceMode='back';$(allLIs).removeClass('bgs-current');$(allLIs).eq($(allLIs).length-$.fn.bgStretcher.settings.startElementIndex-1).addClass('bgs-current');if($.fn.bgStretcher.settings.slideDirection=='E'){l=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).width()*(-1);t=0;}else{t=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).height()*(-1);l=0;}
$(containerStr+' UL').css({left:l+'px',top:t+'px'});}else{settings.sequenceMode='normal';if($.fn.bgStretcher.settings.startElementIndex!=0){if($.fn.bgStretcher.settings.slideDirection=='N'){t=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).height()*(-1);l=0;}else{l=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).width()*(-1);t=0;console.log(l);}
$(containerStr+' UL').css({left:l+'px',top:t+'px'});}}}
if($(settings.buttonNext).length||$(settings.buttonPrev).length||$(settings.pagination).length){if(settings.sequenceMode=='random'){if(typeof(console)!=='undefined'&&console!=null){console.log('Don\'t use random mode width prev-button, next-button and pagination.');}}else{if($(settings.buttonPrev).length){$(settings.buttonPrev).addClass('bgStretcherNav bgStretcherNavPrev');$(settings.buttonPrev).click(function(){$.fn.bgStretcher.buttonSlide('prev');});}
if($(settings.buttonNext).length){$(settings.buttonNext).addClass('bgStretcherNav bgStretcherNavNext');$(settings.buttonNext).click(function(){$.fn.bgStretcher.buttonSlide('next');});}
if($(settings.pagination).length){$.fn.bgStretcher.pagination();}}}
if(settings.sequenceMode=='random'){var i=Math.floor(Math.random()*$(allLIs).length);$.fn.bgStretcher.buildRandom(i);if(settings.transitionEffect!='simpleSlide'){$.fn.bgStretcher.settings.startElementIndex=i;}
stratElement=i;}else{if($.fn.bgStretcher.settings.startElementIndex>($(allLIs).length-1))$.fn.bgStretcher.settings.startElementIndex=0;stratElement=$.fn.bgStretcher.settings.startElementIndex;if(settings.transitionEffect=='simpleSlide'){if($.fn.bgStretcher.settings.slideDirection=='S'||$.fn.bgStretcher.settings.slideDirection=='E'){stratElement=$(allLIs).length-1-$.fn.bgStretcher.settings.startElementIndex;}}}
$(allLIs).eq(stratElement).show().addClass('bgs-current');$.fn.bgStretcher.loadImg($(allLIs).eq(stratElement));if(settings.slideShow&&$(allLIs).length>1){_bgStretcherTm=setTimeout('$.fn.bgStretcher.slideShow(\''+$.fn.bgStretcher.settings.sequenceMode+'\', -1)',settings.nextSlideDelay);}};function _resize(body_content){var winW=0;var winH=0;var contH=0;var contW=0;if($('BODY').hasClass('bgStretcher-container')){winW=$(window).width()-250;winH=$(window).height();if(($.browser.msie)&&(parseInt(jQuery.browser.version)==6)){$(window).scroll(function(){$('#'+settings.imageContainer).css('top',$(window).scrollTop());});}}else{$('.bgstretcher').css('position','absolute').css('top','0px');winW=body_content.width()-250;winH=body_content.height();}
var imgW=0,imgH=0;var leftSpace=0;if(settings.maxWidth!='auto'){if(winW>settings.maxWidth){leftSpace=(winW-settings.maxWidth)/2;contW=settings.maxWidth;}else contW=winW;}else contW=winW;if(settings.maxHeight!='auto'){if(winH>settings.maxHeight){contH=settings.maxHeight;}else contH=winH;}else contH=winH;container.width(contW);container.height(contH);if(!settings.resizeProportionally){imgW=contH;imgH=contH;}else{var initW=settings.imageWidth,initH=settings.imageHeight;var ratio=initH/initW;imgW=contW;imgH=Math.round(contW*ratio);if(imgH<contH){imgH=contH;imgW=Math.round(imgH/ratio);}}
var mar_left=0;var mar_top=0;var anchor_arr;if($.fn.bgStretcher.settings.anchoring!='left top'){anchor_arr=($.fn.bgStretcher.settings.anchoring).split(' ');if(anchor_arr[0]=='right'){mar_left=(winW-contW);}else{if(anchor_arr[0]=='center')mar_left=Math.round((winW-contW)/2);}
if(anchor_arr[1]=='bottom'){mar_top=(winH-contH);}else{if(anchor_arr[1]=='center'){mar_top=Math.round((winH-contH)/2);}}
container.css('marginLeft',mar_left+'px').css('marginTop',mar_top+'px');}
mar_left=0;mar_top=0;if($.fn.bgStretcher.settings.anchoringImg!='left top'){anchor_arr=($.fn.bgStretcher.settings.anchoringImg).split(' ');if(anchor_arr[0]=='right'){mar_left=(contW-imgW);}else{if(anchor_arr[0]=='center')mar_left=Math.round((contW-imgW)/2);}
if(anchor_arr[1]=='bottom'){mar_top=(contH-imgH);}else{if(anchor_arr[1]=='center'){mar_top=Math.round((contH-imgH)/2);}}}
img_options['mar_left']=mar_left;img_options['mar_top']=mar_top;if(container.find('LI:first').hasClass('swf-mode')){var path_swf=container.find('LI:first').html();container.find('LI:first').html('<div id="bgstretcher-flash">&nbsp;</div>');var header=new SWFObject('flash/stars.swf','flash-obj',contW,contH,'9');header.addParam('wmode','transparent');header.write('bgstretcher-flash');};img_options['imgW']=imgW;img_options['imgH']=imgH;if(!settings.resizeAnimate){container.children('UL').children('LI.img-loaded').find('IMG').css({'marginLeft':img_options["mar_left"]+'px','marginTop':img_options["mar_top"]+'px'});container.children('UL').children('LI.img-loaded').find('IMG').css({'width':img_options["imgW"]+'px','height':img_options["imgH"]+'px'});}else{container.children('UL').children('LI.img-loaded').find('IMG').animate({'marginLeft':img_options["mar_left"]+'px','marginTop':img_options["mar_top"]+'px'},'normal');container.children('UL').children('LI.img-loaded').find('IMG').animate({'width':img_options["imgW"]+'px','height':img_options["imgH"]+'px'},'normal');}
$(allLIs).width(container.width()).height(container.height());if($.fn.bgStretcher.settings.transitionEffect=='simpleSlide'){if($.fn.bgStretcher.settings.slideDirection=='W'||$.fn.bgStretcher.settings.slideDirection=='E'){container.children('UL').width(container.width()*$(allLIs).length).height(container.height());if($(containerStr+' LI').index($(containerStr+' LI.bgs-current'))!=-1){l=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*container.width()*(-1);container.children('UL').css({left:l+'px'});}}else{container.children('UL').height(container.height()*$(allLIs).length).width(container.width());if($(containerStr+' LI').index($(containerStr+' LI.bgs-current'))!=-1){t=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).height()*(-1);container.children('UL').css({top:t+'px'});}}}};function _genHtml(body_content){var code='';var cur_bgstretcher;body_content.each(function(){$(this).wrapInner('<div class="bgstretcher-page" />').wrapInner('<div class="bgstretcher-area" />');code='<div id="'+settings.imageContainer+'" class="bgstretcher"><ul>';if(settings.images.length){var ext=settings.images[0].split('.');ext=ext[ext.length-1];if(ext!='swf'){var ind=0;for(i=0;i<settings.images.length;i++){if(settings.transitionEffect=='simpleSlide'&&settings.sequenceMode=='back')
ind=settings.images.length-1-i;else ind=i;if($.fn.bgStretcher.settings.preloadImg){code+='<li><span class="image-path">'+settings.images[ind]+'</span></li>';}else{code+='<li class="img-loaded"><img src="'+settings.images[ind]+'" alt="" /></li>';}}}else{code+='<li class="swf-mode">'+settings.images[0]+'</li>';}}
code+='</ul></div>';cur_bgstretcher=$(this).children('.bgstretcher-area');$(code).prependTo(cur_bgstretcher);cur_bgstretcher.css({position:'relative'});cur_bgstretcher.children('.bgstretcher-page').css({'position':'relative','z-index':3});});};this.addClass('bgStretcher-container');_build(this);};$.fn.bgStretcher.loadImg=function(obj){if(obj.hasClass('img-loaded'))return true;obj.find('SPAN.image-path').each(function(){var imgsrc=$(this).html();var imgalt='';var parent=$(this).parent();var img=new Image();$(img).load(function(){$(this).hide();parent.prepend(this);$(this).fadeIn('100');}).error(function(){}).attr('src',imgsrc).attr('alt',imgalt);$(img).css({'marginLeft':img_options["mar_left"]+'px','marginTop':img_options["mar_top"]+'px'});$(img).css({'width':img_options["imgW"]+'px','height':img_options["imgH"]+'px'});});obj.addClass('img-loaded');return true;}
$.fn.bgStretcher.play=function(){_bgStretcherPause=false;$.fn.bgStretcher._clearTimeout();$.fn.bgStretcher.slideShow($.fn.bgStretcher.settings.sequenceMode,-1);};$.fn.bgStretcher._clearTimeout=function(){if(_bgStretcherTm!=null){clearTimeout(_bgStretcherTm);_bgStretcherTm=null;}}
$.fn.bgStretcher.pause=function(){_bgStretcherPause=true;$.fn.bgStretcher._clearTimeout();};$.fn.bgStretcher.sliderDestroy=function(){var cont=$('.bgstretcher-page').html();$('.bgStretcher-container').html('').html(cont).removeClass('bgStretcher-container');$.fn.bgStretcher._clearTimeout();_bgStretcherPause=false;}
$.fn.bgStretcher.slideShow=function(sequence_mode,index_next){_bgStretcherAction=true;if($(allLIs).length<2)return true;var current=$(containerStr+' LI.bgs-current');var next;if(index_next==-1){switch(sequence_mode){case'back':next=current.prev();if(!next.length){next=$(containerStr+' LI:last');}
break;case'random':if(r_image==$(containerStr+' LI').length){$.fn.bgStretcher.buildRandom(random_line[$(containerStr+' LI').length-1]);r_image=0;}
next=$(containerStr+' LI').eq(random_line[r_image]);r_image++;break;default:next=current.next();if(!next.length){next=$(containerStr+' LI:first');}}}else{next=$(containerStr+' LI').eq(index_next);}
$(containerStr+' LI').removeClass('bgs-current');$.fn.bgStretcher.loadImg(next);next.addClass('bgs-current');switch($.fn.bgStretcher.settings.transitionEffect){case'fade':$.fn.bgStretcher.effectFade(current,next);break;case'simpleSlide':$.fn.bgStretcher.simpleSlide();break;case'superSlide':$.fn.bgStretcher.superSlide(current,next,sequence_mode);break;default:$.fn.bgStretcher.effectNone(current,next);}
if($($.fn.bgStretcher.settings.pagination).find('LI').length){$($.fn.bgStretcher.settings.pagination).find('LI.showPage').removeClass('showPage');$($.fn.bgStretcher.settings.pagination).find('LI').eq($(containerStr+' LI').index($(containerStr+' LI.bgs-current'))).addClass('showPage');}
if($.fn.bgStretcher.settings.callbackfunction){if(typeof $.fn.bgStretcher.settings.callbackfunction=='function')
$.fn.bgStretcher.settings.callbackfunction.call();}
if(!_bgStretcherPause){_bgStretcherTm=setTimeout('$.fn.bgStretcher.slideShow(\''+$.fn.bgStretcher.settings.sequenceMode+'\', -1)',$.fn.bgStretcher.settings.nextSlideDelay);}};$.fn.bgStretcher.effectNone=function(current,next){next.show();current.hide();_bgStretcherAction=false;};$.fn.bgStretcher.effectFade=function(current,next){next.fadeIn($.fn.bgStretcher.settings.slideShowSpeed);current.fadeOut($.fn.bgStretcher.settings.slideShowSpeed,function(){_bgStretcherAction=false;});};$.fn.bgStretcher.simpleSlide=function(){var t,l;switch($.fn.bgStretcher.settings.slideDirection){case'N':case'S':t=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).height()*(-1);l=0;break;default:l=$(containerStr+' LI').index($(containerStr+' LI.bgs-current'))*$(containerStr).width()*(-1);t=0;}
$(containerStr+' UL').animate({left:l+'px',top:t+'px'},$.fn.bgStretcher.settings.slideShowSpeed,function(){_bgStretcherAction=false;});};$.fn.bgStretcher.superSlide=function(current,next,sequence_mode){var t,l;switch($.fn.bgStretcher.settings.slideDirection){case'S':t=$(containerStr).height();l=0;break;case'E':t=0;l=$(containerStr).width();break;case'W':t=0;l=$(containerStr).width()*(-1);break;case'NW':t=$(containerStr).height()*(-1);l=$(containerStr).width()*(-1);break;case'NE':t=$(containerStr).height()*(-1);l=$(containerStr).width();break;case'SW':t=$(containerStr).height();l=$(containerStr).width()*(-1);break;case'SE':t=$(containerStr).height();l=$(containerStr).width();break;default:t=$(containerStr).height()*(-1);l=0;}
if(sequence_mode=='back'){next.css({'z-index':2,top:t+'px',left:l+'px'});next.show();next.animate({left:'0px',top:'0px'},$.fn.bgStretcher.settings.slideShowSpeed,function(){current.hide();$(this).css({'z-index':1});_bgStretcherAction=false;});}else{current.css('z-index',2);next.show();current.animate({left:l+'px',top:t+'px'},$.fn.bgStretcher.settings.slideShowSpeed,function(){$(this).hide().css({'z-index':1,top:'0px',left:'0px'});_bgStretcherAction=false;});}};$.fn.bgStretcher.buildRandom=function(el_not){var l=$(allLIs).length;var i,j,rt;for(i=0;i<l;i++){random_line[i]=i;random_temp[i]=Math.random()*l;}
for(i=0;i<l;i++){for(j=0;j<(l-i-1);j++){if(random_temp[j]>random_temp[j+1]){rt=random_temp[j];random_temp[j]=random_temp[j+1];random_temp[j+1]=rt;rt=random_line[j];random_line[j]=random_line[j+1];random_line[j+1]=rt;}}}
if(random_line[0]==el_not){rt=random_line[0];random_line[0]=random_line[l-1];random_line[l-1]=rt;}};$.fn.bgStretcher.buttonSlide=function(button_point){if(_bgStretcherAction||($(allLIs).length<2))return false;var mode='';if(button_point=='prev'){mode='back';if($.fn.bgStretcher.settings.sequenceMode=='back')mode='normal';}else{mode=$.fn.bgStretcher.settings.sequenceMode;}
$(allLIs).stop(true,true);$.fn.bgStretcher._clearTimeout();$.fn.bgStretcher.slideShow(mode,-1);return false;};$.fn.bgStretcher.pagination=function(){var l=$(allLIs).length;var output='';var i=0;if(l>0){output+='<ul>';for(i=0;i<l;i++){output+='<li><a href="javascript:;">'+(i+1)+'</a></li>';}
output+='</ul>';$($.fn.bgStretcher.settings.pagination).html(output);$($.fn.bgStretcher.settings.pagination).find('LI:first').addClass('showPage');$($.fn.bgStretcher.settings.pagination).find('A').click(function(){if($(this).parent().hasClass('showPage'))return false;$(allLIs).stop(true,true);$.fn.bgStretcher._clearTimeout();$.fn.bgStretcher.slideShow($.fn.bgStretcher.settings.sequenceMode,$($.fn.bgStretcher.settings.pagination).find('A').index($(this)));return false;});}
return false;}
$.fn.bgStretcher.defaults={imageContainer:'bgstretcher',resizeProportionally:true,resizeAnimate:false,images:[],imageWidth:1024,imageHeight:768,maxWidth:'auto',maxHeight:'auto',nextSlideDelay:3000,slideShowSpeed:'normal',slideShow:true,transitionEffect:'fade',slideDirection:'N',sequenceMode:'normal',buttonPrev:'',buttonNext:'',pagination:'',anchoring:'left top',anchoringImg:'left top',preloadImg:false,startElementIndex:0,callbackfunction:null};$.fn.bgStretcher.settings={};})(jQuery);;
/* 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($){var types=['DOMMouseScroll','mousewheel'];$.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var i=types.length;i;){this.addEventListener(types[--i],handler,false);}}else{this.onmousewheel=handler;}},teardown:function(){if(this.removeEventListener){for(var i=types.length;i;){this.removeEventListener(types[--i],handler,false);}}else{this.onmousewheel=null;}}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,returnValue=true,deltaX=0,deltaY=0;event=$.event.fix(orgEvent);event.type="mousewheel";if(event.wheelDelta){delta=event.wheelDelta/120;}
if(event.detail){delta=-event.detail/3;}
deltaY=delta;if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaY=0;deltaX=-1*delta;}
if(orgEvent.wheelDeltaY!==undefined){deltaY=orgEvent.wheelDeltaY/120;}
if(orgEvent.wheelDeltaX!==undefined){deltaX=-1*orgEvent.wheelDeltaX/120;}
args.unshift(event,delta,deltaX,deltaY);return $.event.handle.apply(this,args);}})(jQuery);;(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('<div class="jspPane" />').css("padding",aI).append(D.children());am=b('<div class="jspContainer" />').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.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" />')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.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" />')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('<div class="jspCorner" />').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(au<az.horizontalDragMinWidth){au=az.horizontalDragMinWidth}}h.width(au+"px");j=l-au;ae(aa)}if(aA){A=Math.ceil(1/q*t);if(A>az.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(A<az.verticalDragMinHeight){A=az.verticalDragMinHeight}}av.height(A+"px");i=t-A;ad(I)}}function al(aK,aM,aJ,s){var aO="before",aL="after",aN;if(aM=="os"){aM=/Mac/.test(navigator.platform)?"after":"split"}if(aM==aO){aL=aM}else{if(aM==aL){aO=aM;aN=aJ;aJ=s;s=aN}}aK[aO](aJ)[aL](s)}function aE(aJ,s,aK){return function(){H(aJ,s,this,aK);this.blur();return false}}function H(aM,aL,aP,aO){aP=b(aP).addClass("jspActive");var aN,aK,aJ=true,s=function(){if(aM!==0){Q.scrollByX(aM*az.arrowButtonSpeed)}if(aL!==0){Q.scrollByY(aL*az.arrowButtonSpeed)}aK=setTimeout(s,aJ?az.initialDelay:az.arrowRepeatFreq);aJ=false};s();aN=aO?"mouseout.jsp":"mouseup.jsp";aO=aO||b("html");aO.bind(aN,function(){aP.removeClass("jspActive");aK&&clearTimeout(aK);aK=null;aO.unbind(aN)})}function p(){w();if(aA){aq.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageY-aP.top-I,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageY-aS.top-A/2,aQ=v*az.scrollPagePercent,aR=i*aQ/(Z-v);if(aN<0){if(I-aR>aT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aR<aT){Q.scrollByY(aQ)}else{V(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}if(aF){G.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageX-aP.left-aa,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageX-aS.left-au/2,aQ=ak*az.scrollPagePercent,aR=j*aQ/(T-ak);if(aN<0){if(aa-aR>aT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aR<aT){Q.scrollByX(aQ)}else{W(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(aq){aq.unbind("mousedown.jsp")}}function ax(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(av){av.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aJ){if(!aA){return}if(s<0){s=0}else{if(s>i){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae)}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(s<aJ||aR){aS=s-az.verticalGutter}else{if(s+aL>aP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aV<aQ||aR){aU=aV-az.horizontalGutter}else{if(aV+aM>aT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return-Y.position().left}function aB(){return-Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return!aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return!aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus"in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus"in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aL,aJ,aK=escape(location.hash);try{aL=b(aK)}catch(s){return}if(aL.length&&Y.find(aK)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(aK,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(aK,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5;return aP==aa&&aO==I}).bind("touchend.jsp",function(aO){s=false}).bind("click.jsp-touchclick",function(aO){if(aN){aN=false;return false}})}function g(){var s=aB(),aJ=aD();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ap.append(Y.children()));ap.scrollTop(s);ap.scrollLeft(aJ)}b.extend(Q,{reinitialise:function(aJ){aJ=b.extend({},az,aJ);at(aJ)},scrollToElement:function(aK,aJ,s){ab(aK,aJ,s)},scrollTo:function(aK,s,aJ){N(aK,aJ);M(s,aJ)},scrollToX:function(aJ,s){N(aJ,s)},scrollToY:function(s,aJ){M(s,aJ)},scrollToPercentX:function(aJ,s){N(aJ*(T-ak),s)},scrollToPercentY:function(aJ,s){M(aJ*(Z-v),s)},scrollBy:function(aJ,s,aK){Q.scrollByX(aJ,aK);Q.scrollByY(s,aK)},scrollByX:function(s,aK){var aJ=aD()+Math[s<0?"floor":"ceil"](s),aL=aJ/(T-ak);W(aL*j,aK)},scrollByY:function(s,aK){var aJ=aB()+Math[s<0?"floor":"ceil"](s),aL=aJ/(Z-v);V(aL*i,aK)},positionDragX:function(s,aJ){W(s,aJ)},positionDragY:function(aJ,s){V(aJ,s)},animate:function(aJ,aM,s,aL){var aK={};aK[aM]=s;aJ.animate(aK,{duration:az.animateDuration,easing:az.animateEase,queue:false,step:aL})},getContentPositionX:function(){return aD()},getContentPositionY:function(){return aB()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aD()/(T-ak)},getPercentScrolledY:function(){return aB()/(Z-v)},getIsScrollableH:function(){return aF},getIsScrollableV:function(){return aA},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:function(){m()},destroy:function(){g()}});at(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.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:c,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($,document,window){var
defaults={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,fastIframe:true,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:false},colorbox='colorbox',prefix='cbox',boxElement=prefix+'Element',event_open=prefix+'_open',event_load=prefix+'_load',event_complete=prefix+'_complete',event_cleanup=prefix+'_cleanup',event_closed=prefix+'_closed',event_purge=prefix+'_purge',isIE=$.browser.msie&&!$.support.opacity,isIE6=isIE&&$.browser.version<7,event_ie6=prefix+'_IE6',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,index,photo,open,active,closing,handler,loadingTimer,publicMethod;function $div(id,cssText,div){div=document.createElement('div');if(id){div.id=prefix+id;}
div.style.cssText=cssText||'';return $(div);}
function setSize(size,dimension){return Math.round((/%/.test(size)?((dimension==='x'?$window.width():$window.height())/100):1)*parseInt(size,10));}
function isImage(url){return settings.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(url);}
function makeSettings(i){settings=$.extend({},$.data(element,colorbox));for(i in settings){if($.isFunction(settings[i])&&i.substring(0,2)!=='on'){settings[i]=settings[i].call(element);}}
settings.rel=settings.rel||element.rel||'nofollow';settings.href=settings.href||$(element).attr('href');settings.title=settings.title||element.title;if(typeof settings.href==="string"){settings.href=$.trim(settings.href);}}
function trigger(event,callback){if(callback){callback.call(element);}
$.event.trigger(event);}
function slideshow(){var
timeOut,className=prefix+"Slideshow_",click="click."+prefix,start,stop,clear;if(settings.slideshow&&$related[1]){start=function(){$slideshow.text(settings.slideshowStop).unbind(click).bind(event_complete,function(){if(index<$related.length-1||settings.loop){timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed);}}).bind(event_load,function(){clearTimeout(timeOut);}).one(click+' '+event_cleanup,stop);$box.removeClass(className+"off").addClass(className+"on");timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed);};stop=function(){clearTimeout(timeOut);$slideshow.text(settings.slideshowStart).unbind([event_complete,event_load,event_cleanup,click].join(' ')).one(click,start);$box.removeClass(className+"on").addClass(className+"off");};if(settings.slideshowAuto){start();}else{stop();}}else{$box.removeClass(className+"off "+className+"on");}}
function launch(target){if(!closing){element=target;makeSettings();$related=$(element);index=0;if(settings.rel!=='nofollow'){$related=$('.'+boxElement).filter(function(){var relRelated=$.data(this,colorbox).rel||this.rel;return(relRelated===settings.rel);});index=$related.index(element);if(index===-1){$related=$related.add(element);index=$related.length-1;}}
if(!open){open=active=true;$box.show();if(settings.returnFocus){try{element.blur();$(element).one(event_closed,function(){try{this.focus();}catch(e){}});}catch(e){}}
$overlay.css({"opacity":+settings.opacity,"cursor":settings.overlayClose?"pointer":"auto"}).show();settings.w=setSize(settings.initialWidth,'x');settings.h=setSize(settings.initialHeight,'y');publicMethod.position();if(isIE6){$window.bind('resize.'+event_ie6+' scroll.'+event_ie6,function(){$overlay.css({width:$window.width(),height:$window.height(),top:$window.scrollTop(),left:$window.scrollLeft()});}).trigger('resize.'+event_ie6);}
trigger(event_open,settings.onOpen);$groupControls.add($title).hide();$close.html(settings.close).show();}
publicMethod.load(true);}}
publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var $this=this;options=options||{};if(!$this[0]){if($this.selector){return $this;}
$this=$('<a/>');options.open=true;}
if(callback){options.onComplete=callback;}
$this.each(function(){$.data(this,colorbox,$.extend({},$.data(this,colorbox)||defaults,options));$(this).addClass(boxElement);});if(($.isFunction(options.open)&&options.open.call($this))||options.open){launch($this[0]);}
return $this;};publicMethod.init=function(){$window=$(window);$box=$div().attr({id:colorbox,'class':isIE?prefix+(isIE6?'IE6':'IE'):''});$overlay=$div("Overlay",isIE6?'position:absolute':'').hide();$wrap=$div("Wrapper");$content=$div("Content").append($loaded=$div("LoadedContent",'width:0; height:0; overflow:hidden'),$loadingOverlay=$div("LoadingOverlay").add($div("LoadingGraphic")),$title=$div("Title"),$current=$div("Current"),$next=$div("Next"),$prev=$div("Previous"),$slideshow=$div("Slideshow").bind(event_open,slideshow),$close=$div("Close"));$wrap.append($div().append($div("TopLeft"),$topBorder=$div("TopCenter"),$div("TopRight")),$div(false,'clear:left').append($leftBorder=$div("MiddleLeft"),$content,$rightBorder=$div("MiddleRight")),$div(false,'clear:left').append($div("BottomLeft"),$bottomBorder=$div("BottomCenter"),$div("BottomRight"))).children().children().css({'float':'left'});$loadingBay=$div(false,'position:absolute; width:9999px; visibility:hidden; display:none');$('body').prepend($overlay,$box.append($wrap,$loadingBay));$content.children().hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');}).addClass('hover');interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);$box.css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();$next.click(function(){publicMethod.next();});$prev.click(function(){publicMethod.prev();});$close.click(function(){publicMethod.close();});$groupControls=$next.add($prev).add($current).add($slideshow);$content.children().removeClass('hover');$overlay.click(function(){if(settings.overlayClose){publicMethod.close();}});$(document).bind('keydown.'+prefix,function(e){var key=e.keyCode;if(open&&settings.escKey&&key===27){e.preventDefault();publicMethod.close();}
if(open&&settings.arrowKey&&$related[1]){if(key===37){e.preventDefault();$prev.click();}else if(key===39){e.preventDefault();$next.click();}}});};publicMethod.remove=function(){$box.add($overlay).remove();$('.'+boxElement).removeData(colorbox).removeClass(boxElement);};publicMethod.position=function(speed,loadedCallback){var top=0,left=0;$window.unbind('resize.'+prefix);$box.hide();if(settings.fixed&&!isIE6){$box.css({position:'fixed'});}else{top=$window.scrollTop();left=$window.scrollLeft();$box.css({position:'absolute'});}
if(settings.right!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.right,'x'),0);}else if(settings.left!==false){left+=setSize(settings.left,'x');}else{left+=Math.round(Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2);}
if(settings.bottom!==false){top+=Math.max(document.documentElement.clientHeight-settings.h-loadedHeight-interfaceHeight-setSize(settings.bottom,'y'),0);}else if(settings.top!==false){top+=setSize(settings.top,'y');}else{top+=Math.round(Math.max(document.documentElement.clientHeight-settings.h-loadedHeight-interfaceHeight,0)/2);}
$box.show();speed=($box.width()===settings.w+loadedWidth&&$box.height()===settings.h+loadedHeight)?0:speed||0;$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(that){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=that.style.width;$loadingOverlay[0].style.height=$loadingOverlay[1].style.height=$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=that.style.height;}
$box.dequeue().animate({width:settings.w+loadedWidth,height:settings.h+loadedHeight,top:top,left:left},{duration:speed,complete:function(){modalDimensions(this);active=false;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(loadedCallback){loadedCallback();}
setTimeout(function(){$window.bind('resize.'+prefix,publicMethod.position);},1);},step:function(){modalDimensions(this);}});};publicMethod.resize=function(options){if(open){options=options||{};if(options.width){settings.w=setSize(options.width,'x')-loadedWidth-interfaceWidth;}
if(options.innerWidth){settings.w=setSize(options.innerWidth,'x');}
$loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,'y')-loadedHeight-interfaceHeight;}
if(options.innerHeight){settings.h=setSize(options.innerHeight,'y');}
if(!options.innerHeight&&!options.height){var $child=$loaded.wrapInner("<div style='overflow:auto'></div>").children();settings.h=$child.height();$child.replaceWith($child.children());}
$loaded.css({height:settings.h});publicMethod.position(settings.transition==="none"?0:settings.speed);}};publicMethod.prep=function(object){if(!open){return;}
var callback,speed=settings.transition==="none"?0:settings.speed;$loaded.remove();$loaded=$div('LoadedContent').append(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw<settings.w?settings.mw:settings.w;return settings.w;}
function getHeight(){settings.h=settings.h||$loaded.height();settings.h=settings.mh&&settings.mh<settings.h?settings.mh:settings.h;return settings.h;}
$loaded.hide().appendTo($loadingBay.show()).css({width:getWidth(),overflow:settings.scrolling?'auto':'hidden'}).css({height:getHeight()}).prependTo($content);$loadingBay.hide();$(photo).css({'float':'none'});if(isIE6){$('select').not($box.find('select')).filter(function(){return this.style.visibility!=='hidden';}).css({'visibility':'hidden'}).one(event_cleanup,function(){this.style.visibility='inherit';});}
callback=function(){var prev,prevSrc,next,nextSrc,total=$related.length,iframe,complete;if(!open){return;}
function removeFilter(){if(isIE){$box[0].style.removeAttribute('filter');}}
complete=function(){clearTimeout(loadingTimer);$loadingOverlay.hide();trigger(event_complete,settings.onComplete);};if(isIE){if(photo){$loaded.fadeIn(100);}}
$title.html(settings.title).add($loaded).show();if(total>1){if(typeof settings.current==="string"){$current.html(settings.current.replace('{current}',index+1).replace('{total}',total)).show();}
$next[(settings.loop||index<total-1)?"show":"hide"]().html(settings.next);$prev[(settings.loop||index)?"show":"hide"]().html(settings.previous);prev=index?$related[index-1]:$related[total-1];next=index<total-1?$related[index+1]:$related[0];if(settings.slideshow){$slideshow.show();}
if(settings.preloading){nextSrc=$.data(next,colorbox).href||next.href;prevSrc=$.data(prev,colorbox).href||prev.href;nextSrc=$.isFunction(nextSrc)?nextSrc.call(next):nextSrc;prevSrc=$.isFunction(prevSrc)?prevSrc.call(prev):prevSrc;if(isImage(nextSrc)){$('<img/>')[0].src=nextSrc;}
if(isImage(prevSrc)){$('<img/>')[0].src=prevSrc;}}}else{$groupControls.hide();}
if(settings.iframe){iframe=$('<iframe/>').addClass(prefix+'Iframe')[0];if(settings.fastIframe){complete();}else{$(iframe).one('load',complete);}
iframe.name=prefix+(+new Date());iframe.src=settings.href;if(!settings.scrolling){iframe.scrolling="no";}
if(isIE){iframe.frameBorder=0;iframe.allowTransparency="true";}
$(iframe).appendTo($loaded).one(event_purge,function(){iframe.src="//about:blank";});}else{complete();}
if(settings.transition==='fade'){$box.fadeTo(speed,1,removeFilter);}else{removeFilter();}};if(settings.transition==='fade'){$box.fadeTo(speed,0,function(){publicMethod.position(0,callback);});}else{publicMethod.position(speed,callback);}};publicMethod.load=function(launched){var href,setResize,prep=publicMethod.prep;active=true;photo=false;element=$related[index];if(!launched){makeSettings();}
trigger(event_purge);trigger(event_load,settings.onLoad);settings.h=settings.height?setSize(settings.height,'y')-loadedHeight-interfaceHeight:settings.innerHeight&&setSize(settings.innerHeight,'y');settings.w=settings.width?setSize(settings.width,'x')-loadedWidth-interfaceWidth:settings.innerWidth&&setSize(settings.innerWidth,'x');settings.mw=settings.w;settings.mh=settings.h;if(settings.maxWidth){settings.mw=setSize(settings.maxWidth,'x')-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw;}
if(settings.maxHeight){settings.mh=setSize(settings.maxHeight,'y')-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh;}
href=settings.href;loadingTimer=setTimeout(function(){$loadingOverlay.show();},100);if(settings.inline){$div().hide().insertBefore($(href)[0]).one(event_purge,function(){$(this).replaceWith($loaded.children());});prep($(href));}else if(settings.iframe){prep(" ");}else if(settings.html){prep(settings.html);}else if(isImage(href)){$(photo=new Image()).addClass(prefix+'Photo').error(function(){settings.title=false;prep($div('Error').text('This image could not be loaded'));}).load(function(){var percent;photo.onload=null;if(settings.scalePhotos){setResize=function(){photo.height-=photo.height*percent;photo.width-=photo.width*percent;};if(settings.mw&&photo.width>settings.mw){percent=(photo.width-settings.mw)/photo.width;setResize();}
if(settings.mh&&photo.height>settings.mh){percent=(photo.height-settings.mh)/photo.height;setResize();}}
if(settings.h){photo.style.marginTop=Math.max(settings.h-photo.height,0)/2+'px';}
if($related[1]&&(index<$related.length-1||settings.loop)){photo.style.cursor='pointer';photo.onclick=function(){publicMethod.next();};}
if(isIE){photo.style.msInterpolationMode='bicubic';}
setTimeout(function(){prep(photo);},1);});setTimeout(function(){photo.src=href;},1);}else if(href){$loadingBay.load(href,settings.data,function(data,status,xhr){prep(status==='error'?$div('Error').text('Request unsuccessful: '+xhr.statusText):$(this).contents());});}};publicMethod.next=function(){if(!active&&$related[1]&&(index<$related.length-1||settings.loop)){index=index<$related.length-1?index+1:0;publicMethod.load();}};publicMethod.prev=function(){if(!active&&$related[1]&&(index||settings.loop)){index=index?index-1:$related.length-1;publicMethod.load();}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup,settings.onCleanup);$window.unbind('.'+prefix+' .'+event_ie6);$overlay.fadeTo(200,0);$box.stop().fadeTo(300,0,function(){$box.add($overlay).css({'opacity':1,cursor:'auto'}).hide();trigger(event_purge);$loaded.remove();setTimeout(function(){closing=false;trigger(event_closed,settings.onClosed);},1);});}};publicMethod.element=function(){return $(element);};publicMethod.settings=defaults;handler=function(e){if(!((e.button!==0&&typeof e.button!=='undefined')||e.ctrlKey||e.shiftKey||e.altKey)){e.preventDefault();launch(this);}};if($.fn.delegate){$(document).delegate('.'+boxElement,'click',handler);}else{$('.'+boxElement).live('click',handler);}
$(publicMethod.init);}(jQuery,document,this));;(function($){$.fn.getTwitter=function(options){$.fn.getTwitter.defaults={userName:null,numTweets:5,loaderText:"Loading tweets...",slideIn:true,slideDuration:750,showHeading:true,headingText:"Latest Tweets",showProfileLink:true,showTimestamp:true,callback:null};var o=$.extend({},$.fn.getTwitter.defaults,options);return this.each(function(){var c=$(this);c.hide().empty().addClass("twitted");if(o.showHeading){c.append("<h2>"+o.headingText+"</h2>");}
var twitterListHTML="<ul id=\"twitter_update_list\"><li></li></ul>";c.append(twitterListHTML);var tl=$("#twitter_update_list");tl.hide();var preLoaderHTML=$("<p class=\"preLoader\">"+o.loaderText+"</p>");c.append(preLoaderHTML);if(o.showProfileLink){var profileLinkHTML="<p class=\"profileLink\"><a href=\"http://twitter.com/"+o.userName+"\">http://twitter.com/"+o.userName+"</a></p>";c.append(profileLinkHTML);}
c.show();$.getScript("http://twitter.com/javascripts/blogger.js",function(){$.getScript("http://twitter.com/statuses/user_timeline/"+o.userName+".json?callback=twitterCallback2&count="+o.numTweets,function(){$(preLoaderHTML).remove();if(!o.showTimestamp){tl.find("li").each(function(){var timestampHTML=$(this).children("a");var timestamp=timestampHTML.html();timestampHTML.remove();$(this).attr("title",timestamp);});}
if(o.slideIn){var tlHeight=tl.data("originalHeight");if(!tlHeight){tlHeight=tl.show().height();tl.data("originalHeight",tlHeight);tl.hide().css({height:0});}
tl.show().animate({height:tlHeight},o.slideDuration);}
else{tl.show();}
tl.find("li:first").addClass("firstTweet");tl.find("li:last").addClass("lastTweet");if($.isFunction(o.callback)){o.callback();}});});});};})(jQuery);;;var js_all=function(){if(content_scroll!="none"){var fromtop=113;var win=$(window);var navbar_width=$('#nav-bar').width();var content=$('#content');var wrapper=$('#content-wrapper');var heading=$('#content-heading');var years=$('#years');var photos_ul=page_id==15?$('#content ul:eq(0)'):'';content.jScrollPane({animateScroll:true});var api=$(content).data('jsp');var isResizing=false;win.bind('resize',function(){if(!isResizing){isResizing=true;if(content_scroll=="small"){wrapper.css({'height':win.height()-fromtop});content.css({'height':wrapper.height()-heading.innerHeight()-years.innerHeight()});}else if(content_scroll=="large"){content.css({'width':1,'height':1});content.css({'width':win.width()-navbar_width,'height':win.height()});if(photos_ul.length>0){var num_photos=$("li",photos_ul).length;var width=win.width()-navbar_width-10-((win.width()-navbar_width-10)%240);if(width-num_photos*240>240)
width=num_photos*240;photos_ul.css({'width':width});}}
isResizing=false;api.reinitialise();}}).trigger('resize');}
$('#twitterfeed').getTwitter({userName:"OliverTurvey",numTweets:1,loaderText:"Loading tweets...",slideIn:false,showHeading:false,headingText:"Latest Tweets",showProfileLink:false,callback:function(){}});};var js_racing_cv=function(){var api=$('#content').data('jsp');$('#years a').click(function(e){e.preventDefault();var $target=$(this).attr('href');api.scrollToY($($target).position().top);});};var js_news=function(){$('li:not(.latest)','#content ul').hover(function(){$(this).stop().addClass('hover').animate({opacity:1},'fast');},function(){$(this).stop().removeClass('hover').animate({opacity:0.6},'fast');if($(this).hasClass('current')){$(this).stop().animate({opacity:1},'fast');}});};var js_photos=function(){$('a','#content ul').hover(function(){$(this).stop().animate({opacity:1},'fast');},function(){$(this).stop().animate({opacity:0.6},'fast');});$('a[rel="photo"]','#content').colorbox();};var js_partners=function(){$('li','#content ul').hover(function(){$(this).stop().addClass('hover').animate({opacity:1},'fast');},function(){$(this).stop().removeClass('hover').animate({opacity:0.6},'fast');});};var js_background=function(){$('#bg').bgStretcher({images:bg_list,imageWidth:890,imageHeight:582,nextSlideDelay:8000,buttonPrev:'#bg-prev',buttonNext:'#bg-next',callbackfunction:bgcallback});function bgcallback(){if(page_id!=6)
return;var index=$('li.bgs-current').index('#bgstretcher li')+1;if(index>=$('#bgstretcher li').length){index=0;}
$('div.current-quote').fadeOut(400,function(){$(this).removeClass('current-quote').addClass('hidden-quote');if(quotes[index].image=="")
$('div.quote-image',this).empty();else
$('div.quote-image',this).html('<img src="'+quotes[index].image.src+'" width="'+quotes[index].image.width+'" height="'+quotes[index].image.height+'" alt="" />');$('span.source',this).html(quotes[index].source);$('span.source-desc',this).html(quotes[index].source_desc);});$('div.hidden-quote').fadeIn(400,function(){$(this).removeClass('hidden-quote').addClass('current-quote');});}
$('#controls a').click(function(e){e.preventDefault();});};
