
$(document).ready(function(){$('#navigation').lavaHover();$('a.in-page').inPageScroll();$('a.mailto').emailProtection();$('#archive li.cat').attachHover();$('#submit-caf-form').click(function(){$('form#caf-form').submit();return false;});if(typeof(SCROLL_TO)!='undefined'&&$(SCROLL_TO).length>0){$.scrollTo(SCROLL_TO,800);};$('a#video').click(function(){Shadowbox.open({player:'html',content:'<div id="no-flash"><a href="http://get.adobe.com/flashplayer/" title="Get Adobe Flash Player"><img src="http://www.adobe.com/images/shared/download_buttons/get_adobe_flash_player.png" width="158" height="39"></a><p>Please update your Flash Player to view this video.</p></div>',title:'Dragon Boat Challenge - London 2008',width:600,height:353,options:{onFinish:function(){var flashvars={file:'/_assets/CRASH.flv',width:'600',height:'353',autostart:'true',displayheight:'333',showicons:'true',backcolor:'0x000000',frontcolor:'0xCCCCCC',lightcolor:'0xFFFFFF'};var params={allowfullscreen:'true'};swfobject.embedSWF("/_swf/flvplayer.swf","shadowbox_content",flashvars.width,flashvars.height,"9.0.0","/_swf/expressInstall.swf",flashvars,params);}}});return false;});});(function($){$.fn.attachHover=function(options){return this.each(function(){$(this).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});});};$.fn.lavaHover=function(options){options=$.extend({fx:"linear",speed:400,click:function(){}},options||{});return this.each(function(){var me=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(me),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this);},noop);$(this).hover(noop,function(){move(curr);});$li.click(function(e){setCurr(this);window.location=$(this).find('a').attr('href');});setCurr(curr);function setCurr(el){$back.css({"left":el.offsetLeft+"px","width":el.offsetWidth+"px"});curr=el;};function move(el){$back.each(function(){$(this).dequeue();}).animate({width:el.offsetWidth,left:el.offsetLeft},options.speed,options.fx);};});};$.fn.emailProtection=function(options){var options=$.extend({separator:'[at]'},options);return this.each(function(){var e=this.href.replace(options.separator,'@');var t=this.href.replace('mailto:','');if(t==$(this).text()){$(this).text(e.replace('mailto:',''));};this.href=e;});};$.fn.inPageScroll=function(){return this.each(function(){var hash=$(this).attr('href');if(hash.substring(0,1)=='#'&&$(hash).length>0){$(this).click(function(){$.scrollTo(hash,800);return false;});}});};})(jQuery);