eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))
$(document).ready(function(){$(document).pngFix();});;(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$scrollTo.window().scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'y',duration:1};$scrollTo.window=function(){return $($.browser.safari?'body':'html');};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;}
settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)
duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){var elem=this,$elem=$(elem),t=target,toff,attr={},win=$elem.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=both(t);break;}
t=$(t,this);case'object':if(t.is||t.style)
toff=(t=$(t)).offset();}
$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,act=elem[key],Dim=axis=='x'?'Width':'Height',dim=Dim.toLowerCase();if(toff){attr[key]=toff[pos]+(win?0:act-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(t.css('margin'+Pos))||0;attr[key]-=parseInt(t.css('border'+Pos+'Width'))||0;}
attr[key]+=settings.offset[pos]||0;if(settings.over[pos])
attr[key]+=t[dim]()*settings.over[pos];}else
attr[key]=t[pos];if(/^\d+$/.test(attr[key]))
attr[key]=attr[key]<=0?0:Math.min(attr[key],max(Dim));if(!i&&settings.queue){if(act!=attr[key])
animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target);});};function max(Dim){var el=win?$.browser.opera?document.body:document.documentElement:elem;return el['scroll'+Dim]-el['client'+Dim];};});};function both(val){return typeof val=='object'?val:{top:val,left:val};};})(jQuery);;(function($){var URI=location.href.replace(/#.*/,'');var $localScroll=$.localScroll=function(settings){$('body').localScroll(settings);};$localScroll.defaults={duration:1000,axis:'y',event:'click',stop:true};$localScroll.hash=function(settings){settings=$.extend({},$localScroll.defaults,settings);settings.hash=false;if(location.hash)
setTimeout(function(){scroll(0,location,settings);},0);};$.fn.localScroll=function(settings){settings=$.extend({},$localScroll.defaults,settings);return(settings.persistent||settings.lazy)?this.bind(settings.event,function(e){var a=$([e.target,e.target.parentNode]).filter(filter)[0];a&&scroll(e,a,settings);}):this.find('a').filter(filter).bind(settings.event,function(e){scroll(e,this,settings);}).end().end();function filter(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==URI&&(!settings.filter||$(this).is(settings.filter));};};function scroll(e,link,settings){var id=link.hash.slice(1),elem=document.getElementById(id)||document.getElementsByName(id)[0];if(elem){e&&e.preventDefault();var $target=$(settings.target||$.scrollTo.window());if(settings.lock&&$target.is(':animated')||settings.onBefore&&settings.onBefore.call(link,e,elem,$target)===false)return;if(settings.stop)
$target.queue('fx',[]).stop();$target.scrollTo(elem,settings).trigger('notify.serialScroll',[elem]);if(settings.hash)
$target.queue(function(){location=link.hash;});}};})(jQuery);;(function($){var $serialScroll=$.serialScroll=function(settings){$.scrollTo.window().serialScroll(settings);};$serialScroll.defaults={duration:1000,axis:'x',event:'click',start:0,step:1,lock:true,cycle:true,constant:true};$.fn.serialScroll=function(settings){settings=$.extend({},$serialScroll.defaults,settings);var event=settings.event,step=settings.step,lazy=settings.lazy;return this.each(function(){var
context=settings.target?this:document,$pane=$(settings.target||this,context),pane=$pane[0],items=settings.items,active=settings.start,auto=settings.interval,nav=settings.navigation,timer;if(!lazy)
items=getItems();if(settings.force)
jump({},active);$(settings.prev||[],context).bind(event,-step,move);$(settings.next||[],context).bind(event,step,move);if(!pane.ssbound)
$pane.bind('prev.serialScroll',-step,move).bind('next.serialScroll',step,move).bind('goto.serialScroll',jump);if(auto)
$pane.bind('start.serialScroll',function(e){if(!auto){clear();auto=true;next();}}).bind('stop.serialScroll',function(){clear();auto=false;});$pane.bind('notify.serialScroll',function(e,elem){var i=index(elem);if(i>-1)
active=i;});pane.ssbound=true;if(settings.jump)
(lazy?$pane:getItems()).bind(event,function(e){jump(e,index(e.target));});if(nav)
nav=$(nav,context).bind(event,function(e){e.data=Math.round(getItems().length/nav.length)*nav.index(this);jump(e,this);});function move(e){e.data+=active;jump(e,this);};function jump(e,button){if(!isNaN(button)){e.data=button;button=pane;}
var
pos=e.data,n,real=e.type,$items=settings.exclude?getItems().slice(0,-settings.exclude):getItems(),limit=$items.length,elem=$items[pos],duration=settings.duration;if(real)
e.preventDefault();if(auto){clear();timer=setTimeout(next,settings.interval);}
if(!elem){n=pos<0?0:limit-1;if(active!=n)
pos=n;else if(!settings.cycle)
return;else
pos=limit-n-1;elem=$items[pos];}
if(!elem||real&&active==pos||settings.lock&&$pane.is(':animated')||real&&settings.onBefore&&settings.onBefore.call(button,e,elem,$pane,getItems(),pos)===false)return;if(settings.stop)
$pane.queue('fx',[]).stop();if(settings.constant)
duration=Math.abs(duration/step*(active-pos));$pane.scrollTo(elem,duration,settings).trigger('notify.serialScroll',[pos]);};function next(){$pane.trigger('next.serialScroll');};function clear(){clearTimeout(timer);};function getItems(){return $(items,pane);};function index(elem){if(!isNaN(elem))return elem;var $items=getItems(),i;while((i=$items.index(elem))==-1&&elem!=pane)
elem=elem.parentNode;return i;};});};})(jQuery);$(document).ready(function(){var $panels=$('#slider .scrollContainer > div');var $container=$('#slider .scrollContainer');var horizontal=true;if(horizontal){$panels.css({'float':'left','position':'relative'});$container.css('width',$panels[0].offsetWidth*$panels.length)}var $scroll=$('#slider .scroll').css('overflow','hidden');function selectNav(){$(this).parents('ul:first').find('a').removeClass('selected').end().end().addClass('selected')}$('#slider .navigation').find('a').click(selectNav);function trigger(data){var el=$('#slider .navigation').find('a[href$="'+data.id+'"]').get(0);selectNav.call(el)}if(window.location.hash){trigger({id:window.location.hash.substr(1)})}else{$('ul.navigation a:first').click()}var offset=parseInt((horizontal?$container.css('paddingTop'):$container.css('paddingLeft'))||0)*-1;var scrollOptions={target:$scroll,items:$panels,navigation:'.navigation a.theLI',prev:'img.left',next:'img.right',axis:'xy',onAfter:trigger,offset:offset,duration:1200,easing:'easeOutExpo'};$('#slider').serialScroll(scrollOptions);$.localScroll(scrollOptions);scrollOptions.duration=1;$.localScroll.hash(scrollOptions)});function initMenus(){$('ul.menu ul').hide();$.each($('ul.menu'),function(){$('#'+this.id+'.expandfirst ul:first').show()});$('ul.menu li a').click(function(){var checkElement=$(this).next();var parent=this.parentNode.parentNode.id;if($('#'+parent).hasClass('noaccordion')){$(this).next().slideToggle('normal');return false}if((checkElement.is('ul'))&&(checkElement.is(':visible'))){if($('#'+parent).hasClass('collapsible')){$('#'+parent+' ul:visible').slideUp('normal')}return false}if((checkElement.is('ul'))&&(!checkElement.is(':visible'))){$('#'+parent+' ul:visible').slideUp('normal');checkElement.slideDown('normal');return false}})}$(document).ready(function(){initMenus()});(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla)
$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});});if(this.addEventListener)
this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=handler;},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(this.removeEventListener)
this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata');},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});})(jQuery);(function($){$.jScrollPane={active:[]};$.fn.jScrollPane=function(settings)
{settings=$.extend({},$.fn.jScrollPane.defaults,settings);var rf=function(){return false;};return this.each(function()
{var $this=$(this);$this.css('overflow','hidden');var paneEle=this;if($(this).parent().is('.jScrollPaneContainer')){var currentScrollPosition=settings.maintainPosition?$this.position().top:0;var $c=$(this).parent();var paneWidth=$c.innerWidth();var paneHeight=$c.outerHeight();var trackHeight=paneHeight;$('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown',$c).remove();$this.css({'top':0});}else{var currentScrollPosition=0;this.originalPadding=$this.css('paddingTop')+' '+$this.css('paddingRight')+' '+$this.css('paddingBottom')+' '+$this.css('paddingLeft');this.originalSidePaddingTotal=(parseInt($this.css('paddingLeft'))||0)+(parseInt($this.css('paddingRight'))||0);var paneWidth=$this.innerWidth();var paneHeight=$this.innerHeight();var trackHeight=paneHeight;var $container=$('<div></div>').attr({'className':'jScrollPaneContainer'}).css({'height':paneHeight+'px','width':paneWidth+'px'});if(settings.enableKeyboardNavigation){$container.attr('tabindex',settings.tabIndex);}
$this.wrap($container);$(document).bind('emchange',function(e,cur,prev)
{$this.jScrollPane(settings);});}
if(settings.reinitialiseOnImageLoad){var $imagesToLoad=$.data(paneEle,'jScrollPaneImagesToLoad')||$('img',$this);var loadedImages=[];if($imagesToLoad.length){$imagesToLoad.each(function(i,val){$(this).bind('load readystatechange',function(){if($.inArray(i,loadedImages)==-1){loadedImages.push(val);$imagesToLoad=$.grep($imagesToLoad,function(n,i){return n!=val;});$.data(paneEle,'jScrollPaneImagesToLoad',$imagesToLoad);var s2=$.extend(settings,{reinitialiseOnImageLoad:false});$this.jScrollPane(s2);}}).each(function(i,val){if(this.complete||this.complete===undefined){this.src=this.src;}});});};}
var p=this.originalSidePaddingTotal;var realPaneWidth=paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p;var cssToApply={'height':'auto','width':realPaneWidth+'px'}
if(settings.scrollbarOnLeft){cssToApply.paddingLeft=settings.scrollbarMargin+settings.scrollbarWidth+'px';}else{cssToApply.paddingRight=settings.scrollbarMargin+'px';}
$this.css(cssToApply);var contentHeight=$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<.99){var $container=$this.parent();$container.append($('<div></div>').attr({'className':'jScrollPaneTrack'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDrag'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDragTop'}).css({'width':settings.scrollbarWidth+'px'}),$('<div></div>').attr({'className':'jScrollPaneDragBottom'}).css({'width':settings.scrollbarWidth+'px'}))));var $track=$('>.jScrollPaneTrack',$container);var $drag=$('>.jScrollPaneTrack .jScrollPaneDrag',$container);var currentArrowDirection;var currentArrowTimerArr=[];var currentArrowInc;var whileArrowButtonDown=function()
{if(currentArrowInc>4||currentArrowInc%4==0){positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);}
currentArrowInc++;};if(settings.enableKeyboardNavigation){$container.bind('keydown.jscrollpane',function(e)
{switch(e.keyCode){case 38:currentArrowDirection=-1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 40:currentArrowDirection=1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 33:case 34:return false;default:}}).bind('keyup.jscrollpane',function(e)
{if(e.keyCode==38||e.keyCode==40){for(var i=0;i<currentArrowTimerArr.length;i++){clearInterval(currentArrowTimerArr[i]);}
return false;}});}
if(settings.showArrows){var currentArrowButton;var currentArrowInterval;var onArrowMouseUp=function(event)
{$('html').unbind('mouseup',onArrowMouseUp);currentArrowButton.removeClass('jScrollActiveArrowButton');clearInterval(currentArrowInterval);};var onArrowMouseDown=function(){$('html').bind('mouseup',onArrowMouseUp);currentArrowButton.addClass('jScrollActiveArrowButton');currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100);};$container.append($('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowUp','tabindex':-1}).css({'width':settings.scrollbarWidth+'px'}).html('Scroll up').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=-1;onArrowMouseDown();this.blur();return false;}).bind('click',rf),$('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowDown','tabindex':-1}).css({'width':settings.scrollbarWidth+'px'}).html('Scroll down').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false;}).bind('click',rf));var $upArrow=$('>.jScrollArrowUp',$container);var $downArrow=$('>.jScrollArrowDown',$container);if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;$track.css({'height':trackHeight+'px',top:settings.arrowSize+'px'})}else{var topArrowHeight=$upArrow.height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-$downArrow.height();$track.css({'height':trackHeight+'px',top:topArrowHeight+'px'})}}
var $pane=$(this).css({'position':'absolute','overflow':'visible'});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=='X'?'Left':'Top';
return event['page'+c]||(event['client'+c]+(document.documentElement['scroll'+p]||document.body['scroll'+p]))||0;
};var ignoreNativeDrag=function(){return false;};var initDrag=function()
{ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight;};var onStartDrag=function(event)
{initDrag();dragMiddle=getPos(event,'Y')-dragPosition-currentOffset.top;$('html').bind('mouseup',onStopDrag).bind('mousemove',updateScroll);if($.browser.msie){$('html').bind('dragstart',ignoreNativeDrag).bind('selectstart',ignoreNativeDrag);}
return false;};var onStopDrag=function()
{$('html').unbind('mouseup',onStopDrag).unbind('mousemove',updateScroll);dragMiddle=percentInView*paneHeight/2;if($.browser.msie){$('html').unbind('dragstart',ignoreNativeDrag).unbind('selectstart',ignoreNativeDrag);}};var positionDrag=function(destY)
{destY=destY<0?0:(destY>maxY?maxY:destY);dragPosition=destY;$drag.css({'top':destY+'px'});var p=destY/maxY;$this.data('jScrollPanePosition',(paneHeight-contentHeight)*-p);$pane.css({'top':((paneHeight-contentHeight)*p)+'px'});$this.trigger('scroll');if(settings.showArrows){$upArrow[destY==0?'addClass':'removeClass']('disabled');$downArrow[destY==maxY?'addClass':'removeClass']('disabled');}};var updateScroll=function(e)
{positionDrag(getPos(e,'Y')-currentOffset.top-dragMiddle);};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({'height':dragH+'px'}).bind('mousedown',onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function()
{if(trackScrollInc>8||trackScrollInc%4==0){positionDrag((dragPosition-((dragPosition-trackScrollMousePos)/2)));}
trackScrollInc++;};var onStopTrackClick=function()
{clearInterval(trackScrollInterval);$('html').unbind('mouseup',onStopTrackClick).unbind('mousemove',onTrackMouseMove);};var onTrackMouseMove=function(event)
{trackScrollMousePos=getPos(event,'Y')-currentOffset.top-dragMiddle;};var onTrackClick=function(event)
{initDrag();onTrackMouseMove(event);trackScrollInc=0;$('html').bind('mouseup',onStopTrackClick).bind('mousemove',onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll();return false;};$track.bind('mousedown',onTrackClick);$container.bind('mousewheel',function(event,delta){delta=delta||(event.wheelDelta?event.wheelDelta/120:(event.detail)?-event.detail/3:0);initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured;});var _animateToPosition;var _animateToInterval;function animateToPosition()
{var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1){positionDrag(dragPosition+diff);}else{positionDrag(_animateToPosition);ceaseAnimation();}}
var ceaseAnimation=function()
{if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition;}};var scrollTo=function(pos,preventAni)
{if(typeof pos=="string"){$e=$(pos,$this);if(!$e.length)return;pos=$e.offset().top-$this.offset().top;}
$container.scrollTop(0);ceaseAnimation();var maxScroll=contentHeight-paneHeight;pos=pos>maxScroll?maxScroll:pos;$this.data('jScrollPaneMaxScroll',maxScroll);var destDragPosition=pos/maxScroll*maxY;if(preventAni||!settings.animateTo){positionDrag(destDragPosition);}else{_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval);}};$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta)
{var currentPos=-parseInt($pane.css('top'))||0;scrollTo(currentPos+delta);};initDrag();scrollTo(-currentScrollPosition,true);$('*',this).bind('focus',function(event)
{var $e=$(this);var eleTop=0;while($e[0]!=$this[0]){eleTop+=$e.position().top;$e=$e.offsetParent();}
var viewportTop=-parseInt($pane.css('top'))||0;var maxVisibleEleTop=viewportTop+paneHeight;var eleInView=eleTop>viewportTop&&eleTop<maxVisibleEleTop;if(!eleInView){var destPos=eleTop-settings.scrollbarMargin;if(eleTop>viewportTop){destPos+=$(this).height()+15+settings.scrollbarMargin-paneHeight;}
scrollTo(destPos);}})
if(location.hash){setTimeout(function(){scrollTo(location.hash);},$.browser.safari?100:0);}
$(document).bind('click',function(e)
{$target=$(e.target);if($target.is('a')){var h=$target.attr('href');if(h&&h.substr(0,1)=='#'&&h.length>1){setTimeout(function(){scrollTo(h,!settings.animateToInternalLinks);},$.browser.safari?100:0);}}});function onSelectScrollMouseDown(e)
{$(document).bind('mousemove.jScrollPaneDragging',onTextSelectionScrollMouseMove);$(document).bind('mouseup.jScrollPaneDragging',onSelectScrollMouseUp);}
var textDragDistanceAway;var textSelectionInterval;function onTextSelectionInterval()
{direction=textDragDistanceAway<0?-1:1;$this[0].scrollBy(textDragDistanceAway/2);}
function clearTextSelectionInterval()
{if(textSelectionInterval){clearInterval(textSelectionInterval);textSelectionInterval=undefined;}}
function onTextSelectionScrollMouseMove(e)
{var offset=$this.parent().offset().top;var maxOffset=offset+paneHeight;var mouseOffset=getPos(e,'Y');textDragDistanceAway=mouseOffset<offset?mouseOffset-offset:(mouseOffset>maxOffset?mouseOffset-maxOffset:0);if(textDragDistanceAway==0){clearTextSelectionInterval();}else{if(!textSelectionInterval){textSelectionInterval=setInterval(onTextSelectionInterval,100);}}}
function onSelectScrollMouseUp(e)
{$(document).unbind('mousemove.jScrollPaneDragging').unbind('mouseup.jScrollPaneDragging');clearTextSelectionInterval();}
$container.bind('mousedown.jScrollPane',onSelectScrollMouseDown);$.jScrollPane.active.push($this[0]);}else{$this.css({'height':paneHeight+'px','width':paneWidth-this.originalSidePaddingTotal+'px','padding':this.originalPadding});$this[0].scrollTo=$this[0].scrollBy=function(){};$this.parent().unbind('mousewheel').unbind('mousedown.jScrollPane').unbind('keydown.jscrollpane').unbind('keyup.jscrollpane');}})};$.fn.jScrollPaneRemove=function()
{$(this).each(function()
{$this=$(this);var $c=$this.parent();if($c.is('.jScrollPaneContainer')){$this.css({'top':'','height':'','width':'','padding':'','overflow':'','position':''});$c.after($this).remove();}});}
$.fn.jScrollPane.defaults={scrollbarWidth:7,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false,tabIndex:0,enableKeyboardNavigation:true,animateToInternalLinks:false};$(window).bind('unload',function(){var els=$.jScrollPane.active;for(var i=0;i<els.length;i++){els[i].scrollTo=els[i].scrollBy=null;}});})(jQuery);$(document).ready(function(){var sli=$(window).height()-($(".navigation").height()+170);$('.panel, .myJScroll').css("height",sli);var sli=$(window).height()-20;$('#news, #news .myJScroll').css("height",sli);$('.myJScroll').jScrollPane({reinitialiseOnImageLoad:true});});jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});(function($){$.fn.supersized=function(){$.inAnimation=false;$.paused=false;var options=$.extend($.fn.supersized.defaults,$.fn.supersized.options);$(window).bind("load",function(){$('#loading').hide();$('#supersize').fadeIn('fast');$('#container').show();if($('#slideshow .activeslide').length==0)$('#supersize a:first').addClass('activeslide');if(options.slide_captions==1)$('#slidecaption').html($('#supersize .activeslide').find('img').attr('title'));if(options.navigation==0)$('#navigation').hide();if(options.slideshow==1){if(options.slide_counter==1){$('#slidecounter .slidenumber').html(1);$('#slidecounter .totalslides').html($("#supersize > *").size());}
slideshow_interval=setInterval("nextslide()",options.slide_interval);if(options.navigation==1){$('#navigation a').click(function(){$(this).blur();return false;});$('#nextslide').live('click',function(){if($.paused)return false;if($.inAnimation)return false;clearInterval(slideshow_interval);nextslide();slideshow_interval=setInterval(nextslide,options.slide_interval);return false;});$('#prevslide').live('click',function(){if($.paused)return false;if($.inAnimation)return false;clearInterval(slideshow_interval);prevslide();slideshow_interval=setInterval(nextslide,options.slide_interval);return false;});$('#pauseplay').click(function(){if($.inAnimation)return false;var src=($(this).find('img').attr("src")==="images/play.gif")?"images/pause.gif":"images/play.gif";if(src=="images/pause.gif"){$(this).find('img').attr("src","images/play.gif");$.paused=false;slideshow_interval=setInterval(nextslide,options.slide_interval);}else{$(this).find('img').attr("src","images/pause.gif");clearInterval(slideshow_interval);$.paused=true;}
$(this).find('img').attr("src",src);return false;});$('#pauseplay').mouseover(function(){var imagecheck=($(this).find('img').attr("src")==="images/play_dull.gif");if(imagecheck){$(this).find('img').attr("src","images/play.gif");}else{$(this).find('img').attr("src","images/pause.gif");}});$('#pauseplay').mouseout(function(){var imagecheck=($(this).find('img').attr("src")==="images/play.gif");if(imagecheck){$(this).find('img').attr("src","images/play_dull.gif");}else{$(this).find('img').attr("src","images/pause_dull.gif");}
return false;});}}});$(document).ready(function(){$('#supersize').resizenow();});$('#supersize > *').hover(function(){if(options.slideshow==1&&options.pause_hover==1){if(!($.paused)&&options.navigation==1){$('#pauseplay > img').attr("src","images/pause.gif");clearInterval(slideshow_interval);}}
original_title=$(this).find('img').attr("title");if($.inAnimation)return false;else $(this).find('img').attr("title","");},function(){if(options.slideshow==1&&options.pause_hover==1){if(!($.paused)&&options.navigation==1){$('#pauseplay > img').attr("src","images/pause_dull.gif");slideshow_interval=setInterval(nextslide,options.slide_interval);}}
$(this).find('img').attr("title",original_title);});$(window).bind("resize",function(){$('#supersize').resizenow();});$('#supersize').hide();$('#content').hide();};$.fn.resizenow=function(){var options=$.extend($.fn.supersized.defaults,$.fn.supersized.options);return this.each(function(){var ratio=options.startheight/options.startwidth;var imagewidth=$(this).width();var imageheight=$(this).height();var browserwidth=$(window).width();var browserheight=$(window).height();var offset;if((browserheight/browserwidth)>ratio){$(this).height(browserheight);$(this).width(browserheight/ratio);$(this).children().height(browserheight);$(this).children().width(browserheight/ratio);}else{$(this).width(browserwidth);$(this).height(browserwidth*ratio);$(this).children().width(browserwidth);$(this).children().height(browserwidth*ratio);}
if(options.vertical_center==1){$(this).children().css('left',(browserwidth-$(this).width())/2);$(this).children().css('top',(browserheight-$(this).height())/2);}
return false;});};$.fn.supersized.defaults={startwidth:4,startheight:3,vertical_center:1,slideshow:1,navigation:1,transition:1,pause_hover:0,slide_counter:1,slide_captions:1,slide_interval:5000};})(jQuery);

switch_colors = {
  RED: "#D70026",
  BLUE:  "#449BE0",
  DARKBLUE:  "#110540",
  BLACK:  "#000000",
  YELLOW:  "#FAC600",
  ORANGE:  "#FC5703"
}

imgArr=[
    ["images/calvinharris.jpg","Bench/Global Sales Conference - Calvin Harris", switch_colors.BLUE],
    ["images/44.jpg","Umbro - England Away Kit Launch Feat. Kasabian", switch_colors.RED],
    ["images/2.jpg","MySpace - School Invasions", switch_colors.BLACK],
    ["images/3.jpg","Hermes - Secret Dinner", switch_colors.BLUE],
    ["images/4.jpg","Orange - A Bright Day Festival", switch_colors.ORANGE],
    ["images/5.jpg","Underage Festival - London", switch_colors.RED],
    ["images/6.jpg","Umbro - Brand Space Showcase", switch_colors.BLUE],
    ["images/7.jpg","Cool Brands - Cool Live", switch_colors.BLACK],
    ["images/8.jpg","Hammerson - Cabot Circus Launch", switch_colors.BLUE],
    ["images/9.jpg","PZ Cussons - The Soap Box", switch_colors.DARKBLUE],
    ["images/10.jpg","Grosvenor Estates - Liverpool 1", switch_colors.RED],
    ["images/1.jpg","Umbro - Live from City Kit Launch", switch_colors.DARKBLUE],
    ["images/11.jpg","Volkswagen -  Scirocco Launch", switch_colors.RED],
    ["images/12.jpg","The Warehouse Project - Erol Alkan", switch_colors.ORANGE],
    ["images/13.jpg","Umbro - Speciali Brand Experience", switch_colors.RED],
    ["images/14.jpg","Liverpool Culture Company - Capital Of Culture Launch", switch_colors.DARKBLUE],
    ["images/15.jpg","Wates - Annual Conference", switch_colors.BLUE],
    ["images/16.jpg","Liverpool PCT - Million Pound Tanker", switch_colors.ORANGE],
    ["images/17.jpg","Esprit - Flagship Retail Launch", switch_colors.RED],
    ["images/18.jpg","Afflecks Arcade - Re-launch", switch_colors.BLACK],
    ["images/19.jpg","PZ Cussons - The Soap Box", switch_colors.RED],
    ["images/20.jpg","Salford City Council - BBC Proms in the Park", switch_colors.DARKBLUE],
    ["images/21.jpg","Liverpool PCT - Million Pound Tanker", switch_colors.BLACK],
    ["images/22.jpg","The Warehouse Project - Dizzee Rascal", switch_colors.RED],
    ["images/23.jpg","Umbro - Speciali Brand Experience", switch_colors.BLACK],
    ["images/24.jpg","Umbro - MCFC Media Launch", switch_colors.BLUE],
    ["images/25.jpg","USC - UK Final Face of Fashion", switch_colors.BLUE],
    ["images/26.jpg","Umbro - Speciali Brand Experience", switch_colors.RED],
    ["images/27.jpg","Crosby Homes - Clarence Dock Launch", switch_colors.BLUE],
    ["images/28.jpg","Ear to the Ground - MIPIM Party Cannes", switch_colors.ORANGE],
    ["images/29.jpg","PZ Cussons - The Soap Box ", switch_colors.BLUE],
    ["images/30.jpg","Orange - A Bright Day Festival", switch_colors.ORANGE],
    ["images/31.jpg","The North Pole Bar", switch_colors.DARKBLUE],
    ["images/32.jpg","Hammerson - London HQ Launch", switch_colors.RED],
    ["images/33.jpg", "Umbro - Live From City Kit Launch", switch_colors.BLUE],
    ["images/34.jpg", "Urban Splash - Lister Mills Launch", switch_colors.DARKBLUE],
    ["images/35.jpg", "West Properties - Origin Suite Launch", switch_colors.BLUE],
    ["images/36.jpg", "New York Yankees / JD Sports - Big Hitters Contest", switch_colors.RED],
    ["images/37.jpg","Snowbombing - Austria", switch_colors.DARKBLUE],
    ["images/38.jpg","Underage Festival - London", switch_colors.RED],
    ["images/39.jpg","Hammerson - Cabot Circus Launch", switch_colors.RED],
    ["images/40.jpg","Imperial Leather - Soap Box Installation", switch_colors.RED],
    ["images/41.jpg","Hammerson - London HQ Launch", switch_colors.ORANGE],
    ["images/42.jpg","Original Source - Brand Experience", switch_colors.RED],
    ["images/43.jpg","Badly Drawn Boy - Transatlantic Express NYC", switch_colors.BLUE]
];

var i=0;var q = 0;

// Font replacement
// $(function()
// {
//   $("h2, h3").each(function(){
//     // image should be naed with inner text (spaces replaced with underscores)
//     var image_path = "font_replacement/" + 
//       $(this).text()
//       .toLowerCase()
//       .replace(/^\s*|\s*$/g, "") // String whitespace
//       .replace(/(\s| | )+/gi, "_") // Add underscores
//       .replace(/(\W)+/gi, "") // Add underscores
//       +".png";
//       
//       
//     $(this).css({
//       "text-indent": "-5000px",
//       "background": "url("+image_path+") top left no-repeat",
//       "height": $(this).height()*2
//     });
//   });
// });

$('a').live('click', function(){
  q++;
  if(q > 2){
    if($(this).parent().attr("id") != "img_toggle") nextslide();
    q = 0;
  };
});

function format_title(title){
  var split_title = title.split(" - ");
  return "<strong>" + split_title[0] + "</strong> - " + split_title[1];
}
function nextslide(){if($.inAnimation)return false;else $.inAnimation=true;var options=$.extend($.fn.supersized.defaults,$.fn.supersized.options);var currentslide=$('#supersize .activeslide');currentslide.removeClass('activeslide');if(currentslide.length==0)currentslide=$('#supersize a:last');var slidecount=$('#slidecounter .slidenumber').html();i<=(imgArr.length-3)?i++:i=-1;color_switcher(imgArr[i<0?0:i][2]);var nextIm=$("<a>").attr("href","#").appendTo('#supersize');$("<img/>").attr("src",imgArr[i+1][0]).attr("title",imgArr[i+1][1]).appendTo(nextIm);if($('#supersize a').length>3)
{$('#supersize a:first').remove();}
var nextslide=currentslide.next().length?currentslide.next():$('#supersize a:first');var prevslide=nextslide.prev().length?nextslide.prev():$('#supersize a:last');$('.prevslide').removeClass('prevslide');prevslide.addClass('prevslide');if(options.slide_captions==1)$('p#description').html(format_title($(nextslide).find('img').attr('title')));nextslide.hide().addClass('activeslide')
if(options.transition==0){nextslide.show();$.inAnimation=false;}
if(options.transition==1){nextslide.fadeIn(750,function(){$.inAnimation=false;});}
if(options.transition==2){nextslide.show("slide",{direction:"up"},'slow',function(){$.inAnimation=false;});}
if(options.transition==3){nextslide.show("slide",{direction:"right"},'slow',function(){$.inAnimation=false;});}
if(options.transition==4){nextslide.show("slide",{direction:"down"},'slow',function(){$.inAnimation=false;});}
if(options.transition==5){nextslide.show("slide",{direction:"left"},'slow',function(){$.inAnimation=false;});}
$('#supersize').resizenow();}
function prevslide(){if($.inAnimation)return false;else $.inAnimation=true;var options=$.extend($.fn.supersized.defaults,$.fn.supersized.options);var currentslide=$('#supersize .activeslide');currentslide.removeClass('activeslide');if(currentslide.length==0)currentslide=$('#supersize a:first');i>1?i--:i=imgArr.length;color_switcher(imgArr[i>=imgArr.length?0:i][2]);var prevIm=$("<a>").attr("href","#").prependTo('#supersize');$("<img/>").attr("src",imgArr[i-1][0]).attr("title",imgArr[i-1][1]).prependTo(prevIm);if($('#supersize a').length>3)
{$('#supersize a:last').remove();}
var nextslide=currentslide.prev().length?currentslide.prev():$('#supersize a:last');var prevslide=nextslide.next().length?nextslide.next():$('#supersize a:first');$('.prevslide').removeClass('prevslide');prevslide.addClass('prevslide');if(options.slide_captions==1)$('p#description').html(format_title($(nextslide).find('img').attr('title')));nextslide.hide().addClass('activeslide')
if(options.transition==0){nextslide.show();$.inAnimation=false;}
if(options.transition==1){nextslide.fadeIn(750,function(){$.inAnimation=false;});}
if(options.transition==2){nextslide.show("slide",{direction:"down"},'slow',function(){$.inAnimation=false;});}
if(options.transition==3){nextslide.show("slide",{direction:"left"},'slow',function(){$.inAnimation=false;});}
if(options.transition==4){nextslide.show("slide",{direction:"up"},'slow',function(){$.inAnimation=false;});}
if(options.transition==5){nextslide.show("slide",{direction:"right"},'slow',function(){$.inAnimation=false;});}
$('#supersize').resizenow();}



$.fn.supersized.options={startwidth:1024,startheight:768,vertical_center:1,slideshow:1,navigation:1,transition:1,pause_hover:0,slide_counter:1,slide_captions:1,slide_interval:99999999};$('#supersize').supersized();$(function(){
	
	$('#finger').animate({'opacity' : 1}, 5500, function(){$('#finger').animate({'left' : '0'}, 10000, 'easeOutExpo', function(){$('#finger').animate({'opacity' : '1'}, 5500, function(){$('#finger').animate({'opacity' : '0'}, 2400);});});});
	
var textResize=function(){var win=$(window).width();var font_size=win/35+"px";var line_height=win/35+"px";$('#typer h1').css({"font-size":font_size,"line-height":line_height});}
$(window).resize(textResize);$('#enter').live('click',function(){$('#overlay').animate({"marginLeft":"-110%"},1600,"jswing");return false;});$('#ETTG_logo').css('cursor','pointer');var a=360;var l=$('#logo');var logo=$('.logo');var active_logo=$('.active_logo');var LH=$('#LH');var BG=$('#supersize');var n=$('#news_button');var news_button=$('.news_button_LH');var active_news_button=$('.active_news_button');var RH=$('#RH');logo.live('click',function(){active_news_button.fadeOut('slow');RH.animate({right:(-a-55)+"px"},1000,"jswing");LH.animate({left:"-60px"},1200,"easeOutBack");BG.animate({marginLeft:(a/1.15)+"px"},700,"jswing");$(this).addClass("active_logo");$(this).removeClass("logo");});

function switch_active_logo(al)
{
  setTimeout(function(){
    al.addClass("logo").removeClass("active_logo");
  }, 1000);
}
active_logo.live('click',function()
{
  // Assign active_logo to var to access in this context
  var temp_active_logo = $(this);
  LH.animate({left:(-a-55)+"px"},1000,"jswing");
  // Wait until #LH has gone back in to change logo image back
  switch_active_logo(temp_active_logo);
  
  BG.animate({marginLeft:"0"},800,"linear");
});

news_button.live('click',function()
{
  LH.animate({left:(-a-55)+"px"},1000,"jswing");
  switch_active_logo($('.active_logo'));

  active_news_button.fadeIn("slow");
  RH.animate({right:"-60px"},1200,"easeOutBack");
  BG.animate({marginLeft:(-a/1.15)+"px"},700,"jswing");
  return false;
});

active_news_button.live('click',function(){
  RH.animate({right:(-a-55)+"px"},1000,"jswing");
  BG.animate({marginLeft:"0"},700,"jswing");
  $(this).fadeOut("slow");
});
  
  var nextslide=$('#supersize a:first');$("p#description").html(format_title($(nextslide).find('img').attr('title')));reinitialiseScrollPane=function()
{$('#newsJScroll').jScrollPane();}
$('#newsJScroll').load("news/all",'',reinitialiseScrollPane);$("div.news a, .next_article, .prev_article").live('click',function(){var id=$(this).attr("id").split("_");id=id[1];$("#news").fadeOut("slow",function(){$('#newsJScroll').load("news/view/"+id,'',reinitialiseScrollPane);$("#news").fadeIn("slow");});return false;});$("a.return").live('click',function(){$("#news").fadeOut("slow",function(){$('#newsJScroll').load("news/all",'',reinitialiseScrollPane);$("#news").fadeIn("slow");});return false;});$('.sml_img').live('click',function(){var this_src=$(this).attr("src");$('.main_img').css("background","url("+this_src+")");return false;});});

// $(function(){
//   var scrollB = $(".jScrollPaneDrag");
//   $(".jScrollPaneDrag").live('mouseup',function(){
//     var pagination = (".jScrollPaneContainer > div").length;
//     alert($(".jScrollPaneDrag").css("top").replace("px", ""));
//     if((($(".jScrollPaneDrag").height() + $(".jScrollPaneDrag").css("top") + 100) >= $(window).height()))
//     {
//       $('#newsJScroll').load('news/all/'+pagination, '', function(){$('#newsJScroll').jScrollPane()});
//     }
//   });
// });

$("#news_pag").live("click", function(){
  var pagination = $(this).attr("href");
  $('#newsJScroll').load(pagination, '', function(){$('#newsJScroll').jScrollPane()});
  return false;
});

/**
 color changing magic
*/

/** Jquery color plugin */
(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};})(jQuery);


// Find all elements with the red bg color, and group them by class
$('*').filter(function()
{
  return $(this).css("background-color") == "rgb(68, 155, 224)";
}).addClass("color_switcher_bg");


// Fade colors for .color_switcher_bg background color and color_switcher_fg foreground color
var switch_colors = [
  "#449BE0",
  "#D70026",
  "#6C0B80"
];
var switch_color_index = 0;

function color_switcher(color)
{
  // Iterate through colors
  // switch_color_index < (switch_colors.length-1) ? ++switch_color_index : switch_color_index=0;
  $(".color_switcher_bg").each(function(){
    // $(this).animate({"background-color": switch_colors[switch_color_index] + " !important"}, 2500);
    $(this).animate({"background-color": color + " !important"}, 2500);
  });
  
  $(".color_switcher_fg").each(function(){
    $(this).animate({"color": color + " !important"}, 2500);
  });
}