(function(jQuery){jQuery.fn.lavaLamp=function(o){o=jQuery.extend({target:'li',fx:'swing',speed:500,click:function(){return true},startItem:'',autoReturn:true,returnDelay:0,setOnClick:true,homeTop:0,homeLeft:0,homeWidth:0,homeHeight:0,returnHome:false,autoResize:false},o||{});function getInt(arg){var myint=parseInt(arg);return(isNaN(myint)?0:myint);}
if(o.autoResize)
jQuery(window).resize(function(){jQuery(o.target+'.selectedLava').trigger('mouseenter focusin');});return this.each(function(){if(jQuery(this).css('position')=='static')
jQuery(this).css('position','relative');if(o.homeTop||o.homeLeft){var $home=jQuery('<'+o.target+' class="homeLava"></'+o.target+'>').css({left:o.homeLeft,top:o.homeTop,width:o.homeWidth,height:o.homeHeight,position:'absolute'});jQuery(this).prepend($home);}
var path=location.pathname+location.search+location.hash,$selected,$back,$lt=jQuery(o.target+'[class!=noLava]',this),delayTimer,bx=0,by=0;$selected=jQuery(o.target+'.selectedLava',this);if(o.startItem!='')
$selected=$lt.eq(o.startItem);if((o.homeTop||o.homeLeft)&&$selected.length<1)
$selected=$home;if($selected.length<1){var pathmatch_len=0,$pathel;$lt.each(function(){var thishref=$('a:first',this).attr('href');if(path.indexOf(thishref)>-1&&thishref.length>pathmatch_len)
{$pathel=$(this);pathmatch_len=thishref.length;}});if(pathmatch_len>0){$selected=$pathel;}}
if($selected.length<1)
$selected=$lt.eq(0);$selected=jQuery($selected.eq(0).addClass('selectedLava'));$lt.bind('mouseenter focusin',function(){if(delayTimer){clearTimeout(delayTimer);delayTimer=null;}
move(jQuery(this));}).click(function(e){if(o.setOnClick){$selected.removeClass('selectedLava');$selected=jQuery(this).addClass('selectedLava');}
return o.click.apply(this,[e,this]);});$back=jQuery('<li class="backLava"><div class="leftLava"></div><div class="bottomLava"></div><div class="cornerLava"></div></li>').css('position','absolute').prependTo(this);bx=getInt($back.css('borderLeftWidth'))+getInt($back.css('borderRightWidth'))+getInt($back.css('paddingLeft'))+getInt($back.css('paddingRight'));by=getInt($back.css('borderTopWidth'))+getInt($back.css('borderBottomWidth'))+getInt($back.css('paddingTop'))+getInt($back.css('paddingBottom'));if(o.homeTop||o.homeLeft)
$back.css({left:o.homeLeft,top:o.homeTop,width:o.homeWidth,height:o.homeHeight});else
{$back.css({left:$selected.position().left,top:$selected.position().top,width:$selected.outerWidth()-bx,height:$selected.outerHeight()-by});}
jQuery(this).bind('mouseleave focusout',function(){var $returnEl=null;if(o.returnHome)
$returnEl=$home;else if(!o.autoReturn)
return true;if(o.returnDelay){if(delayTimer)clearTimeout(delayTimer);delayTimer=setTimeout(function(){move($returnEl);},o.returnDelay);}
else{move($returnEl);}
return true;});function move($el){if(!$el)$el=$selected;$back.stop().animate({left:$el.position().left,top:$el.position().top,width:$el.outerWidth()-bx,height:$el.outerHeight()-by},o.speed,o.fx);};});};})(jQuery);$.fn.stickyfloat=function(options,lockBottom){var $obj=this;var parentPaddingTop=parseInt($obj.parent().css('padding-top'));var startOffset=$obj.parent().offset().top;var opts=$.extend({startOffset:startOffset,offsetY:parentPaddingTop,duration:200,lockBottom:true},options);$obj.css({position:'absolute'});if(opts.lockBottom){var bottomPos=$obj.parent().height()-$obj.height()+parentPaddingTop;if(bottomPos<0)
bottomPos=0;}
$(window).scroll(function(){$obj.stop();var pastStartOffset=$(document).scrollTop()>opts.startOffset;var objFartherThanTopPos=$obj.offset().top>startOffset;var objBiggerThanWindow=$obj.outerHeight()<$(window).height();if((pastStartOffset||objFartherThanTopPos)&&objBiggerThanWindow){var newpos=($(document).scrollTop()-startOffset+opts.offsetY);if(newpos>bottomPos)
newpos=bottomPos;if($(document).scrollTop()<opts.startOffset)
newpos=parentPaddingTop;$obj.animate({top:newpos},opts.duration);}});};(function(d){d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(f,e){d.fx.step[e]=function(g){if(!g.colorInit){g.start=c(g.elem,e);g.end=b(g.end);g.colorInit=true}g.elem.style[e]="rgb("+[Math.max(Math.min(parseInt((g.pos*(g.end[0]-g.start[0]))+g.start[0]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[1]-g.start[1]))+g.start[1]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[2]-g.start[2]))+g.start[2]),255),0)].join(",")+")"}});function b(f){var e;if(f&&f.constructor==Array&&f.length==3){return f}if(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}if(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)){return[parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55]}if(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}if(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}if(e=/rgba\(0, 0, 0, 0\)/.exec(f)){return a.transparent}return a[d.trim(f).toLowerCase()]}function c(g,e){var f;do{f=d.curCSS(g,e);if(f!=""&&f!="transparent"||d.nodeName(g,"body")){break}e="backgroundColor"}while(g=g.parentNode);return b(f)}var a={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],transparent:[255,255,255]}})(jQuery);jQuery.fn.animatecolor=function(config){this.each(function(){var elem=jQuery(this);var duration=config.duration;var queue=config.queue;var property=config.property;var animationarguements1={};animationarguements1[property]=config.value;var animationarguements2={};animationarguements2[property]=elem.css(property);jQuery(this).bind('mouseenter focusin',function(){jQuery(this).animate(animationarguements1,{queue:queue,duration:duration});});jQuery(this).bind('mouseleave focusout',function(){jQuery(this).animate(animationarguements2,{queue:queue,duration:duration});});});};jQuery.fn.backgroundimgageviewer=function(config){this.each(function(){myconfig=jQuery.extend({initialDisplayDelay:500,displayTime:1000,fadeTime:200},config);var photos=[{"image":"http://js.chimeraenterprises.co.uk/images/vacation2.jpg"},{"image":"http://js.chimeraenterprises.co.uk/images/work2.jpg"},{"image":"http://js.chimeraenterprises.co.uk/images/biking2.jpg"},{"image":"http://js.chimeraenterprises.co.uk/images/nature2.jpg"},{"image":"http://js.chimeraenterprises.co.uk/images/food2.jpg"}];var activeContainer=1;var currentImg=0;var animating=false;var navigate=function(direction){if(animating){return;}
if(direction=="next"){currentImg++;if(currentImg==photos.length+1){currentImg=1;}}else{currentImg--;if(currentImg==0){currentImg=photos.length;}}
var currentContainer=activeContainer;if(activeContainer==1){activeContainer=2;}else{activeContainer=1;}
showImage(photos[currentImg-1],currentContainer,activeContainer);};var currentZindex=-1;var showImage=function(photoObject,currentContainer,activeContainer){animating=true;currentZindex--;$("#headerimg"+activeContainer).css({"background-image":"url("+photoObject.image+")","display":"block","z-index":currentZindex});$("#headerimg"+currentContainer).delay(myconfig.displayTime).fadeOut(myconfig.fadeTime,function(){setTimeout(function(){animating=false;});});};interval=setInterval(function(){navigate("next");},myconfig.initialDisplayDelay+myconfig.fadeTime);});};(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);
