jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeInOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return-h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return-h/2*((--f)*(f-2)-1)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInExpo:function(e,f,a,h,g){return(f===0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f===0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInRegular:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutRegular:function(e,f,a,h,g){return-h*(f/=g)*(f-2)+a},easeInOutRegular:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return-h/2*((--f)*(f-2)-1)+a}});var lbStatus='closed';function setCSS(css){try{document.getElementsByTagName("head")[0].appendChild(css);}catch(e){setTimeout(function(){setCSS(css)},100);}}
var css=document.createElement("link");css.setAttribute("href","/static/css/wwightbox.css");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");setCSS(css);css=null;String.prototype.endsWith=function(b){return(this.match(b+"$")==b)};function querySt(value,string){valueArray=string.split('?').join('&').split('&');for(i=0;i<valueArray.length;i++){result=valueArray[i].split('=');if(result[0]==value){return result[1];}}}
function repositionLightBox(){if(($('#lightBoxInner').outerHeight()+40)>$(window).height()){$('#lightBoxContent').css('top',($(window).scrollTop()+20)+'px').css('position','absolute').css('margin-top',0);}
else{$('#lightBoxContent').css('top','50%').css('position','fixed').css('margin-top',-($('#lightBoxInner').outerHeight()/2));}}
function animateLightBox(){$('#lightBoxInner').prepend('<a href="/Close" id="closeLightBoxBtn" class="closeLightBox"></a>')
var mTop=-($('#lightBoxInner').outerHeight()/2);var mLft=-($('#lightBoxInner').outerWidth()/2);if(($('#lightBoxInner').outerHeight()+40)>$(window).height()){$('#lightBoxContent').css('top',($(window).scrollTop()+20)+'px').css('position','absolute').css('margin-top',0);mTop=0;}
else{$('#lightBoxContent').css('top','50%').css('position','fixed');}
$('#lightBoxContent').stop().animate({width:$('#lightBoxInner').outerWidth(),height:$('#lightBoxInner').outerHeight(),marginTop:mTop,marginLeft:mLft,opacity:1},600,"easeInOutRegular",function(){repositionLightBox();$('#lightBoxContent').css('filter','');$('#lightBoxInner').css('visibility','visible');$('#lightBoxInner').stop().fadeTo(500,1,function(){$('#lightBoxContent, #lightBoxInner').css('filter','')});});}
function detectContent(boxID){$('#lightBoxInner').empty();$('#lightBoxInner').width('auto').height('auto');$('#lightBoxContent').css('overflow','hidden').width($('#lightBoxContent').width()).height($('#lightBoxContent').height()).css('margin',(-($('#lightBoxContent').outerHeight()/2))+'px 0 0 '+(-($('#lightBoxContent').outerWidth()/2))+'px');myTitle=querySt('title',boxID);myDesc=querySt('desc',boxID);myWidth=querySt('width',boxID);myHeight=querySt('height',boxID);if(myWidth!==undefined){$('#lightBoxInner').width(parseInt(myWidth));}
if(myHeight!==undefined){$('#lightBoxInner').height(parseInt(myHeight));}
if(myTitle!==undefined){$('#lightBoxInner').append('<h1>'+myTitle+'</h1>')}
if(myDesc!==undefined){$('#lightBoxInner').append(myDesc);}
if(boxID.indexOf('?')>-1){boxID=boxID.slice(0,boxID.indexOf('?'));}
r=document.location.href.toString().replace(document.location.hash.toString(),'');if(boxID.indexOf('?')>-1){q=boxID.slice(boxID.indexOf('?'));boxID=boxID.slice(0,boxID.indexOf('?'))}
if(boxID.indexOf(r)===0){boxID=boxID.replace(r,'');}
if(boxID.indexOf('#')===0){$(boxID).clone(true).appendTo('#lightBoxInner').show();animateLightBox();lbStatus='content';}
else if(boxID.endsWith('.html')||boxID.endsWith('.htm')||boxID.endsWith('.php')||boxID.endsWith('.aspx')){$('#lightBoxMid').addClass('loading');if(lbStatus=='closed'){$('#lightBoxInner').width(100).height(100);animateLightBox();}
$('#lightBoxInner').load(boxID,function(){$('#lightBoxMid').removeClass('loading');animateLightBox();lbStatus='html';});}
else if(boxID.endsWith('.jpg')||boxID.endsWith('.gif')||boxID.endsWith('.png')||boxID.endsWith('.bmp')||boxID.endsWith('.tiff')){$('#lightBoxMid').addClass('loading');if(lbStatus=='closed'){$('#lightBoxInner').width(100).height(100);animateLightBox();}
var img="img"+boxID.slice(boxID.lastIndexOf("/")+1,boxID.lastIndexOf("."));eval[img]=new Image();eval[img].onload=function(evt){$('#lightBoxInner').fadeTo(0,0,function(){if(myWidth!==undefined){eval[img].width=parseInt(myWidth);}
if(myHeight!==undefined){eval[img].height=parseInt(myHeight);}
$('#lightBoxInner').width(eval[img].width).height(eval[img].height).append(eval[img]);if(galleryArray.length>1){$('#lightBoxInner').append('<a href="/Previous" class="prevImg"></a><a href="/Next" class="nextImg"></a>')}
$('#lightBoxMid').removeClass('loading');animateLightBox();lbStatus='image';});};eval[img].src=boxID;imgNo=jQuery.inArray(boxID,galleryArray);}}
function showLightBox(boxID){$('#lightBoxInner').css('visibility','hidden');if($('#lightBoxContent:visible').size()>0){detectContent(boxID);}
else{$('#lightBox').stop().show().fadeTo(0,0).fadeTo(500,0.75,function(){$('#lightBoxContent').stop().show().fadeTo(0,0,function(){detectContent(boxID);});});}}
function openLightBox(boxID){if($('#lightBoxContent:visible').size()>0){$('#lightBoxInner').stop().fadeTo(500,0,function(){showLightBox(boxID);});}
else{$('#lightBoxInner').fadeTo(0,0,function(){showLightBox(boxID);});}}
var galleryArray=[];var imgNo=0;function gallery(){galleryArray=[];$('.lightBox[href$=".jpg"], .lightBox[href$=".gif"], .lightBox[href$=".png"], .lightBox[href$=".bmp"], .lightBox[href$=".tiff"]').each(function(){var inArray=false
var url=$(this).attr('href');if(jQuery.inArray(url,galleryArray)==-1){galleryArray.push(url);}});$('a[rel$=".jpg"], a[rel$=".gif"], a[rel$=".png"], a[rel$=".bmp"], a[rel$=".tiff"]').each(function(){var inArray=false
var url=$(this).attr('rel');if(jQuery.inArray(url,galleryArray)==-1){galleryArray.push(url);}});$('.thumbs a').not('.thumbs a.lightBox').click(function(){$('.thumbs a:hidden').insertBefore($(this)).show();$(this).hide();$('.gallery a').attr('href',$(this).attr('rel'));var img=$(this).attr('href');eval[img]=new Image();eval[img].src=img;$('.gallery a img').stop().fadeTo(500,0,function(){eval[img]=new Image();eval[img].onload=function(evt){$('.gallery a img').attr('src',img);$('.gallery a img').fadeTo(500,1);};eval[img].src=img;});return false;});}
function closeLightBox(){$('#lightBoxMid').removeClass('loading');$('#lightBoxContent').stop().fadeTo(500,0,function(){$('#lightBox').stop().fadeTo(500,0,function(){$('#lightBoxContent').hide().width('100px').height('100px');$('#lightBox').hide();$('#lightBoxInner').empty();lbStatus='closed';});});}
function initWWightBox(){$('body').append('<div id="lightBox" class="closeLightBox"></div><div id="lightBoxContent"><div id="lightBoxMid"><div id="lightBoxInner"></div></div></div>');$(document).bind('mouseup',function(e){$('.zoomBox img').unbind('mousemove');$('.zoomBox img').css('cursor','pointer');});$(window).resize(function(){repositionLightBox();});}
function prevImage(){imgNo--;if(imgNo<0){imgNo=galleryArray.length-1;}
openLightBox(galleryArray[imgNo]);}
function nextImage(){imgNo++;if(imgNo>(galleryArray.length-1)){imgNo=0;}
openLightBox(galleryArray[imgNo]);}
$('.lightBox').live('click',function(e){openLightBox($(this).attr('href'));return false;});$('.closeLightBox').live('click',function(){closeLightBox()
return false;});$('.prevImg').live('click',function(){prevImage()
return false;});$('.nextImg').live('click',function(){nextImage()
return false;});$(document).keyup(function(event){if(lbStatus!='closed'&&event.keyCode=='27'){event.preventDefault();closeLightBox();}
else if(lbStatus=='image'&&(event.keyCode=='37'||event.keyCode=='80')){event.preventDefault();prevImage()}
else if(lbStatus=='image'&&(event.keyCode=='39'||event.keyCode=='78')){event.preventDefault();nextImage()}
else if(lbStatus=='image'&&((parseInt(event.keyCode))>48&&(parseInt(event.keyCode))<58)){if((9-(58-(parseInt(event.keyCode))))!=imgNo){imgNo=(9-(58-(parseInt(event.keyCode))));if(imgNo>(galleryArray.length-1)){imgNo=(galleryArray.length-1)}
openLightBox(galleryArray[imgNo]);}}
else if(lbStatus=='image'&&((parseInt(event.keyCode))>96&&(parseInt(event.keyCode))<106)){if((9-(106-(parseInt(event.keyCode))))!=imgNo){imgNo=(9-(106-(parseInt(event.keyCode))));if(imgNo>(galleryArray.length-1)){imgNo=(galleryArray.length-1)}
openLightBox(galleryArray[imgNo]);}}});function removeLast(){$('.footer-navigation a:last').css("border-right","0");$('.footer-navigation a:last').css("padding-right","0");}
function hideOne(){var el=document.getElementById("tabbed-one");if(el.innerHTML==""){el.style.display="none";}else{el.style.display="block";}}
function hideTwo(){var el=document.getElementById("tabbed-two");if(el.innerHTML==""){el.style.display="none";}else{el.style.display="block";}}
function hideThree(){var el=document.getElementById("tabbed-three");if(el.innerHTML==""){el.style.display="none";}else{el.style.display="block";}}
function hideFour(){var el=document.getElementById("tabbed-four");if(el.innerHTML==""){el.style.display="none";}else{el.style.display="block";}}
function hideFive(){var el=document.getElementById("tabbed-five");if(el.innerHTML==""){el.style.display="none";}else{el.style.display="block";}}
$(document).ready(function(){removeLast();initWWightBox();$("#tabbed-one").click(function(){$(".tabbed").removeClass("on");$(this).addClass("on");$("#tabOne").show();$("#tabTwo").hide();$("#tabThree").hide();$("#tabFour").hide();$("#tabFive").hide();});$("#tabbed-two").click(function(){$(".tabbed").removeClass("on");$(this).addClass("on");$("#tabTwo").show();$("#tabOne").hide();$("#tabThree").hide();$("#tabFour").hide();$("#tabFive").hide();});$("#tabbed-three").click(function(){$(".tabbed").removeClass("on");$(this).addClass("on");$("#tabThree").show();$("#tabTwo").hide();$("#tabOne").hide();$("#tabFour").hide();$("#tabFive").hide();});$("#tabbed-four").click(function(){$(".tabbed").removeClass("on");$(this).addClass("on");$("#tabFour").show();$("#tabTwo").hide();$("#tabThree").hide();$("#tabOne").hide();$("#tabFive").hide();});$("#tabbed-five").click(function(){$(".tabbed").removeClass("on");$(this).addClass("on");$("#tabFive").show();$("#tabTwo").hide();$("#tabThree").hide();$("#tabFour").hide();$("#tabOne").hide();});if($.fn.cycle){$('.homepage-banners a').each(function(){var $link=$(this);if($link.children().length==0){$link.remove();}});$('.homepage-banners').cycle({'fx':'scrollHorz','timeout':5000});}else{$('.homepage-banners a:gt(0)').hide();}});function quotes(){$('.quoteList li').not(':first').addClass('closed').height(27)
$('.quoteList li').click(function(){var $this=$(this)
$('.quoteList li').not($(this)).not('.closed').addClass('closed').animate({height:27},500).find('.colour').stop().fadeTo(500,0);var itemHeight=$(this).find('.quoteTop').outerHeight()+$(this).find('blockquote').outerHeight();$(this).removeClass('closed').animate({height:itemHeight},500).find('.colour').stop().fadeTo(500,1);});}
$(function(){quotes();});
