$(function(){$("body").removeClass("coda-slider-no-js");$(".coda-slider").children('.panel').hide().end().prepend('

Loading...
loading...

');});var sliderCount=1;$.fn.codaSlider=function(settings){settings=$.extend({autoHeight:true,autoHeightEaseDuration:1000,autoHeightEaseFunction:"easeInOutExpo",autoSlide:false,autoSlideInterval:7000,autoSlideStopWhenClicked:true,crossLinking:true,dynamicArrows:true,dynamicArrowLeftText:"« left",dynamicArrowRightText:"right »",dynamicTabs:true,dynamicTabsAlign:"center",dynamicTabsPosition:"top",externalTriggerSelector:"a.xtrig",firstPanelToLoad:1,panelTitleSelector:"h2.title",slideEaseDuration:3000,slideEaseFunction:"easeInOutExpo"},settings);return this.each(function(){var slider=$(this);if(settings.dynamicArrows){slider.parent().addClass("arrows");slider.before('
'+settings.dynamicArrowLeftText+'
');slider.after('
'+settings.dynamicArrowRightText+'
');};var panelWidth=slider.find(".panel").width();var panelCount=slider.find(".panel").size();var panelContainerWidth=panelWidth*panelCount;var navClicks=0;$('.panel',slider).wrapAll('
');$(".panel-container",slider).css({width:panelContainerWidth});if(settings.crossLinking&&location.hash&&parseInt(location.hash.slice(1))<=panelCount){var currentPanel=parseInt(location.hash.slice(1));var offset=-(panelWidth*(currentPanel-1));$('.panel-container',slider).css({marginLeft:offset});}else if(settings.firstPanelToLoad!=1&&settings.firstPanelToLoad<=panelCount){var currentPanel=settings.firstPanelToLoad;var offset=-(panelWidth*(currentPanel-1));$('.panel-container',slider).css({marginLeft:offset});}else{var currentPanel=1;};$("#coda-nav-left-"+sliderCount+" a").click(function(){navClicks++;if(currentPanel==1){offset=-(panelWidth*(panelCount-1));alterPanelHeight(panelCount-1);currentPanel=panelCount;slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('li:last a').addClass('current');}else{currentPanel-=1;alterPanelHeight(currentPanel-1);offset=-(panelWidth*(currentPanel-1));slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().prev().find('a').addClass('current');};$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);if(settings.crossLinking){location.hash=currentPanel};return false;});$('#coda-nav-right-'+sliderCount+' a').click(function(){navClicks++;if(currentPanel==panelCount){offset=0;currentPanel=1;alterPanelHeight(0);slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('a:eq(0)').addClass('current');}else{offset=-(panelWidth*currentPanel);alterPanelHeight(currentPanel);currentPanel+=1;slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().next().find('a').addClass('current');};$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);if(settings.crossLinking){location.hash=currentPanel};return false;});if(settings.dynamicTabs){var dynamicTabs='
';switch(settings.dynamicTabsPosition){case"bottom":slider.parent().append(dynamicTabs);break;default:slider.parent().prepend(dynamicTabs);break;};ul=$('#coda-nav-'+sliderCount+' ul');$('.panel',slider).each(function(n){ul.append('
  • '+$(this).find(settings.panelTitleSelector).text()+'
  • ');});navContainerWidth=slider.width()+slider.siblings('.coda-nav-left').width()+slider.siblings('.coda-nav-right').width();ul.parent().css({width:navContainerWidth});switch(settings.dynamicTabsAlign){case"center":ul.css({width:($("li",ul).width()+2)*panelCount});break;case"right":ul.css({float:'right'});break;};};$('#coda-nav-'+sliderCount+' a').each(function(z){$(this).bind("click",function(){navClicks++;$(this).addClass('current').parents('ul').find('a').not($(this)).removeClass('current');offset=-(panelWidth*z);alterPanelHeight(z);currentPanel=z+1;$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);if(!settings.crossLinking){return false};});});$(settings.externalTriggerSelector).each(function(){if(sliderCount==parseInt($(this).attr("rel").slice(12))){$(this).bind("click",function(){navClicks++;targetPanel=parseInt($(this).attr("href").slice(1));offset=-(panelWidth*(targetPanel-1));alterPanelHeight(targetPanel-1);currentPanel=targetPanel;slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq('+(targetPanel-1)+') a').addClass('current');$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);if(!settings.crossLinking){return false};});};});if(settings.crossLinking&&location.hash&&parseInt(location.hash.slice(1))<=panelCount){$("#coda-nav-"+sliderCount+" a:eq("+(location.hash.slice(1)-1)+")").addClass("current");}else if(settings.firstPanelToLoad!=1&&settings.firstPanelToLoad<=panelCount){$("#coda-nav-"+sliderCount+" a:eq("+(settings.firstPanelToLoad-1)+")").addClass("current");}else{$("#coda-nav-"+sliderCount+" a:eq(0)").addClass("current");};if(settings.autoHeight){panelHeight=$('.panel:eq('+(currentPanel-1)+')',slider).height();slider.css({height:panelHeight});};if(settings.autoSlide){slider.ready(function(){setTimeout(autoSlide,settings.autoSlideInterval);});};function alterPanelHeight(x){if(settings.autoHeight){panelHeight=$('.panel:eq('+x+')',slider).height() slider.animate({height:panelHeight},settings.autoHeightEaseDuration,settings.autoHeightEaseFunction);};};function autoSlide(){if(navClicks==0||!settings.autoSlideStopWhenClicked){if(currentPanel==panelCount){var offset=0;currentPanel=1;}else{var offset=-(panelWidth*currentPanel);currentPanel+=1;};alterPanelHeight(currentPanel-1);slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq('+(currentPanel-1)+') a').addClass('current');$('.panel-container',slider).animate({marginLeft:offset},settings.slideEaseDuration,settings.slideEaseFunction);setTimeout(autoSlide,settings.autoSlideInterval);};};$('.panel',slider).show().end().find("p.loading").remove();slider.removeClass("preload");sliderCount++;});};