/* selectively disable js if mobile */

		var mobi = ['android', 'blackberry', 'ipad', 'safari'];
		var midp = ['blackberry', 'symbian'];		
		var ua = navigator.userAgent.toLowerCase();
		if ((ua.indexOf('midp') != -1) || (ua.indexOf('mobi') != -1) || ((ua.indexOf('ppc') != -1) && (ua.indexOf('mac') == -1)) || (ua.indexOf('webos') != -1)) {
			var mobilesite = true;
		}	
		



/*
 AnythingSlider v1.5.7 minified using Google Closure Compiler
 By Chris Coyier: http://css-tricks.com
 with major improvements by Doug Neiner: http://pixelgraphics.us/
 based on work by Remy Sharp: http://jqueryfordesigners.com/
*/

(function(c){c.anythingSlider=function(g,i){var a=this;a.$el=c(g).addClass("anythingBase").wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');a.$el.data("AnythingSlider",a);a.init=function(){a.options=c.extend({},c.anythingSlider.defaults,i);c.isFunction(a.options.onBeforeInitialize)&&a.$el.bind("before_initialize",a.options.onBeforeInitialize);a.$el.trigger("before_initialize",a);a.$wrapper=a.$el.parent().closest("div.anythingSlider").addClass("anythingSlider-"+a.options.theme); a.$window=a.$el.closest("div.anythingWindow");a.$controls=c('<div class="anythingControls"></div>').appendTo(a.options.appendControlsTo!==null&&c(a.options.appendControlsTo).length?c(a.options.appendControlsTo):a.$wrapper);a.win=window;a.$win=c(a.win);a.$nav=c('<ul class="thumbNav" />').appendTo(a.$controls);a.timer=null;a.flag=false;a.playing=false;a.hovered=false;a.panelSize=[];a.currentPage=a.options.startPanel;a.adjustLimit=a.options.infiniteSlides?0:1;a.options.playRtl&&a.$wrapper.addClass("rtl"); a.original=[a.options.autoPlay,a.options.buildNavigation,a.options.buildArrows];a.updateSlider();a.$currentPage=a.$items.eq(a.currentPage);a.$lastPage=a.$currentPage;a.runTimes=c("div.anythingSlider").index(a.$wrapper)+1;a.regex=RegExp("panel"+a.runTimes+"-(\\d+)","i");if(!c.isFunction(c.easing[a.options.easing]))a.options.easing="swing";a.options.theme!=="default"&&!c("link[href*="+a.options.theme+"]").length&&c("body").append('<link rel="stylesheet" href="'+a.options.themeDirectory.replace(/\{themeName\}/g, a.options.theme)+'" type="text/css" />');a.options.pauseOnHover&&a.$wrapper.hover(function(){if(a.playing){a.$el.trigger("slideshow_paused",a);a.clearTimer(true)}},function(){if(a.playing){a.$el.trigger("slideshow_unpaused",a);a.startStop(a.playing,true)}});var b=a.options.hashTags?a.gotoHash()||a.options.startPanel:a.options.startPanel;a.setCurrentPage(b,false);a.slideControls(false);a.$wrapper.bind("mouseenter mouseleave",function(e){a.hovered=e.type==="mouseenter"?true:false;a.slideControls(a.hovered, false)});a.options.enableKeyboard&&c(document).keyup(function(e){if(a.$wrapper.is(".activeSlider"))switch(e.which){case 39:a.goForward();break;case 37:a.goBack()}});var d="slideshow_paused slideshow_unpaused slide_init slide_begin slideshow_stop slideshow_start initialized swf_completed".split(" ");c.each("onShowPause onShowUnpause onSlideInit onSlideBegin onShowStop onShowStart onInitialized onSWFComplete".split(" "),function(e,f){c.isFunction(a.options[f])&&a.$el.bind(d[e],a.options[f])});c.isFunction(a.options.onSlideComplete)&& a.$el.bind("slide_complete",function(){setTimeout(function(){a.options.onSlideComplete(a)},0)});a.$el.trigger("initialized",a)};a.updateSlider=function(){a.$el.find("li.cloned").remove();a.$nav.empty();a.$items=a.$el.find("> li");a.pages=a.$items.length;if(a.options.resizeContents){a.options.width&&a.$wrapper.add(a.$items).css("width",a.options.width);a.options.height&&a.$wrapper.add(a.$items).css("height",a.options.height)}if(a.pages===1){a.options.autoPlay=false;a.options.buildNavigation=false; a.options.buildArrows=false;a.$controls.hide();a.$nav.hide();a.$forward&&a.$forward.add(a.$back).hide()}else{a.options.autoPlay=a.original[0];a.options.buildNavigation=a.original[1];a.options.buildArrows=a.original[2];a.$controls.show();a.$nav.show();a.$forward&&a.$forward.add(a.$back).show()}a.buildNavigation();if(a.options.autoPlay){a.playing=!a.options.startStopped;a.buildAutoPlay()}a.options.buildArrows&&a.buildNextBackButtons();a.$el.prepend(a.options.infiniteSlides?a.$items.filter(":last").clone().addClass("cloned").removeAttr("id"): c('<li class="cloned" />'));a.$el.append(a.options.infiniteSlides?a.$items.filter(":first").clone().addClass("cloned").removeAttr("id"):c('<li class="cloned" />'));a.$el.find("li.cloned").each(function(){c(this).html(c(this).html().replace(/<a/gi,"<span").replace(/\/a>/gi,"/span>"))});a.$items=a.$el.find("> li").addClass("panel");a.setDimensions();a.options.resizeContents||a.$win.load(function(){a.setDimensions()});if(a.currentPage>a.pages){a.currentPage=a.pages;a.setCurrentPage(a.pages,false)}a.$nav.find("a").eq(a.currentPage- 1).addClass("cur");a.hasEmb=a.$items.find("embed[src*=youtube]").length;a.hasSwfo=typeof swfobject!=="undefined"&&swfobject.hasOwnProperty("embedSWF")&&c.isFunction(swfobject.embedSWF)?true:false;a.hasEmb&&a.hasSwfo&&a.$items.find("embed[src*=youtube]").each(function(b){var d=c(this).parent()[0].tagName==="OBJECT"?c(this).parent():c(this);d.wrap('<div id="ytvideo'+b+'"></div>');swfobject.embedSWF(c(this).attr("src")+"&enablejsapi=1&version=3&playerapiid=ytvideo"+b,"ytvideo"+b,d.attr("width"),d.attr("height"), "10",null,null,{allowScriptAccess:"always",wmode:a.options.addWmodeToObject,allowfullscreen:true},{"class":d.attr("class"),style:d.attr("style")},function(){b>=a.hasEmb-1&&a.$el.trigger("swf_completed",a)})});a.$items.find("a").unbind("focus").bind("focus",function(b){a.$items.find(".focusedLink").removeClass("focusedLink");c(this).addClass("focusedLink");var d=c(this).closest(".panel");if(!d.is(".activePage")){a.gotoPage(a.$items.index(d));b.preventDefault()}})};a.buildNavigation=function(){a.options.buildNavigation&& a.pages>1&&a.$items.filter(":not(.cloned)").each(function(b){var d=b+1;b=(d===1?"first":"")+(d===a.pages?"last":"");b=c('<a href="#"></a>').addClass("panel"+d).wrap('<li class="'+b+'" />');a.$nav.append(b.parent());if(c.isFunction(a.options.navigationFormatter)){var e=a.options.navigationFormatter(d,c(this));b.html(e);parseInt(b.css("text-indent"),10)<0&&b.addClass(a.options.tooltipClass).attr("title",e)}else b.text(d);b.bind(a.options.clickControls,function(f){if(!a.flag&&a.options.enableNavigation){a.flag= true;setTimeout(function(){a.flag=false},100);a.gotoPage(d);a.options.hashTags&&a.setHash(d)}f.preventDefault()})})};a.buildNextBackButtons=function(){if(!a.$forward){a.$forward=c('<span class="arrow forward"><a href="#">'+a.options.forwardText+"</a></span>");a.$back=c('<span class="arrow back"><a href="#">'+a.options.backText+"</a></span>");a.$back.bind(a.options.clickArrows,function(b){a.goBack();b.preventDefault()});a.$forward.bind(a.options.clickArrows,function(b){a.goForward();b.preventDefault()}); a.$back.add(a.$forward).find("a").bind("focusin focusout",function(){c(this).toggleClass("hover")});a.$wrapper.prepend(a.$forward).prepend(a.$back);a.$arrowWidth=a.$forward.width()}};a.buildAutoPlay=function(){if(!a.$startStop){a.$startStop=c("<a href='#' class='start-stop'></a>").html(a.playing?a.options.stopText:a.options.startText);a.$controls.prepend(a.$startStop);a.$startStop.bind(a.options.clickSlideshow,function(b){if(a.options.enablePlay){a.startStop(!a.playing);if(a.playing)a.options.playRtl? a.goBack(true):a.goForward(true)}b.preventDefault()}).bind("focusin focusout",function(){c(this).toggleClass("hover")});a.startStop(a.playing)}};a.setDimensions=function(){var b,d,e,f,j,h=0,k=a.$window.width(),l=a.$win.width();a.$items.each(function(m){e=c(this).children("*");if(a.options.resizeContents){b=parseInt(a.options.width,10)||k;d=parseInt(a.options.height,10)||a.$window.height();c(this).css({width:b,height:d});if(e.length===1){e.css({width:"100%",height:"100%"});e[0].tagName==="OBJECT"&& e.find("embed").andSelf().attr({width:"100%",height:"100%"})}}else{b=c(this).width();j=b>=l?true:false;if(e.length===1&&j){f=e.width()>=l?k:e.width();c(this).css("width",f);e.css("max-width",f);b=f}b=j?a.options.width||k:b;c(this).css("width",b);d=c(this).outerHeight();c(this).css("height",d)}a.panelSize[m]=[b,d,h];h+=b});a.$el.css("width",h<a.options.maxOverallWidth?h:a.options.maxOverallWidth)};a.gotoPage=function(b,d,e){if(a.pages!==1){a.$lastPage=a.$items.eq(a.currentPage);if(typeof b!=="number"){b= a.options.startPage;a.setCurrentPage(a.options.startPage)}if(!(a.hasEmb&&a.checkVideo(a.playing))){if(b>a.pages+1-a.adjustLimit)b=!a.options.infiniteSlides&&!a.options.stopAtEnd?1:a.pages;if(b<a.adjustLimit)b=!a.options.infiniteSlides&&!a.options.stopAtEnd?a.pages:1;a.$currentPage=a.$items.eq(b);a.currentPage=b;a.$el.trigger("slide_init",a);a.slideControls(true,false);if(d!==true)d=false;if(!d||a.options.stopAtEnd&&b===a.pages)a.startStop(false);a.$el.trigger("slide_begin",a);a.options.resizeContents|| a.$wrapper.filter(":not(:animated)").animate({width:a.panelSize[b][0],height:a.panelSize[b][1]},{queue:false,duration:a.options.animationTime,easing:a.options.easing});a.$window.filter(":not(:animated)").animate({scrollLeft:a.panelSize[b][2]},{queue:false,duration:a.options.animationTime,easing:a.options.easing,complete:function(){a.endAnimation(b,e)}})}}};a.endAnimation=function(b,d){if(b===0){a.$window.scrollLeft(a.panelSize[a.pages][2]);b=a.pages}else if(b>a.pages){a.$window.scrollLeft(a.panelSize[1][2]); b=1}a.setCurrentPage(b,false);a.$items.removeClass("activePage").eq(b).addClass("activePage");a.hovered||a.slideControls(false);if(a.hasEmb){var e=a.$currentPage.find("object[id*=ytvideo], embed[id*=ytvideo]");e.length&&c.isFunction(e[0].getPlayerState)&&e[0].getPlayerState()>0&&e[0].getPlayerState()!==5&&e[0].playVideo()}a.$el.trigger("slide_complete",a);typeof d==="function"&&d(a);a.options.autoPlayLocked&&!a.playing&&setTimeout(function(){a.startStop(true)},a.options.resumeDelay-a.options.delay)}; a.setCurrentPage=function(b,d){if(b>a.pages+1-a.adjustLimit)b=a.pages-a.adjustLimit;if(b<a.adjustLimit)b=1;if(a.options.buildNavigation){a.$nav.find(".cur").removeClass("cur");a.$nav.find("a").eq(b-1).addClass("cur")}if(!a.options.infiniteSlides&&a.options.stopAtEnd){a.$wrapper.find("span.forward")[b===a.pages?"addClass":"removeClass"]("disabled");a.$wrapper.find("span.back")[b===1?"addClass":"removeClass"]("disabled");b===a.pages&&a.playing&&a.startStop()}if(!d){a.$wrapper.css({width:a.panelSize[b][0], height:a.panelSize[b][1]});a.$wrapper.scrollLeft(0);a.$window.scrollLeft(a.panelSize[b][2])}a.currentPage=b;if(!a.$wrapper.is(".activeSlider")){c(".activeSlider").removeClass("activeSlider");a.$wrapper.addClass("activeSlider")}};a.goForward=function(b){if(b!==true){b=false;a.startStop(false)}a.gotoPage(a.currentPage+1,b)};a.goBack=function(b){if(b!==true){b=false;a.startStop(false)}a.gotoPage(a.currentPage-1,b)};a.gotoHash=function(){var b=a.win.location.hash.match(a.regex);return b===null?"":parseInt(b[1], 10)};a.setHash=function(b){var d="panel"+a.runTimes+"-",e=a.win.location.hash;if(typeof e!=="undefined")a.win.location.hash=e.indexOf(d)>0?e.replace(a.regex,d+b):e+"&"+d+b};a.slideControls=function(b){var d=b?"slideDown":"slideUp",e=b?0:a.options.animationTime,f=b?a.options.animationTime:0;b=b?0:1;a.options.toggleControls&&a.$controls.stop(true,true).delay(e)[d](a.options.animationTime/2).delay(f);if(a.options.buildArrows&&a.options.toggleArrows){if(!a.hovered&&a.playing){b=1;f=0}a.$forward.stop(true, true).delay(e).animate({right:b*a.$arrowWidth,opacity:f},a.options.animationTime/2);a.$back.stop(true,true).delay(e).animate({left:b*a.$arrowWidth,opacity:f},a.options.animationTime/2)}};a.clearTimer=function(b){if(a.timer){a.win.clearInterval(a.timer);b||a.$el.trigger("slideshow_stop",a)}};a.startStop=function(b,d){if(b!==true)b=false;b&&!d&&a.$el.trigger("slideshow_start",a);a.playing=b;if(a.options.autoPlay){a.$startStop.toggleClass("playing",b).html(b?a.options.stopText:a.options.startText);if(parseInt(a.$startStop.css("text-indent"), 10)<0)a.$startStop.addClass(a.options.tooltipClass).attr("title",b?"Stop":"Start")}if(b){a.clearTimer(true);a.timer=a.win.setInterval(function(){a.hasEmb&&a.checkVideo(b)||(a.options.playRtl?a.goBack(true):a.goForward(true))},a.options.delay)}else a.clearTimer()};a.checkVideo=function(b){var d,e,f=false;a.$items.find("object[id*=ytvideo], embed[id*=ytvideo]").each(function(){d=c(this);if(d.length&&c.isFunction(d[0].getPlayerState)){e=d[0].getPlayerState();if(b&&(e===1||e>2)&&a.$items.index(d.closest("li.panel"))=== a.currentPage&&a.options.resumeOnVideoEnd)f=true;else e>0&&d[0].pauseVideo()}});return f};a.init()};c.anythingSlider.defaults={width:null,height:null,resizeContents:true,tooltipClass:"tooltip",theme:"default",themeDirectory:"css/theme-{themeName}.css",startPanel:1,hashTags:true,infiniteSlides:true,enableKeyboard:true,buildArrows:true,toggleArrows:false,buildNavigation:true,enableNavigation:true,toggleControls:false,appendControlsTo:null,navigationFormatter:null,forwardText:"&raquo;",backText:"&laquo;", enablePlay:true,autoPlay:true,autoPlayLocked:false,startStopped:false,pauseOnHover:true,resumeOnVideoEnd:true,stopAtEnd:false,playRtl:false,startText:"Start",stopText:"Stop",delay:3E3,resumeDelay:15E3,animationTime:600,easing:"swing",clickArrows:"click",clickControls:"click focusin",clickSlideshow:"click",addWmodeToObject:"opaque",maxOverallWidth:32766};c.fn.anythingSlider=function(g,i){return this.each(function(){var a=c(this).data("AnythingSlider");if((typeof g).match("object|undefined"))if(a)a.updateSlider(); else new c.anythingSlider(this,g);else if(/\d/.test(g)&&!isNaN(g)&&a){var b=typeof g==="number"?g:parseInt(c.trim(g),10);b>=1&&b<=a.pages&&a.gotoPage(b,false,i)}})}})(jQuery);


/*
 * AnythingSlider Slide FX 1.1 minified
 * By Rob Garrison (aka Mottie & Fudgey)
 * Dual licensed under the MIT and GPL licenses.
 */
(function(h){h.fn.anythingSliderFx=function(i){var o=h(this).closest(".anythingSlider"),k=o.width(),p=o.height(),q=function(e){return{top:[{inFx:{top:0},outFx:{top:"-"+(e||p)}}],bottom:[{inFx:{bottom:0},outFx:{bottom:e||p}}],left:[{inFx:{left:0},outFx:{left:"-"+(e||k)}}],right:[{inFx:{right:0},outFx:{right:e||k}}],fade:[{inFx:{opacity:1,time:500},outFx:{opacity:0,time:500}}],expand:[{inFx:{width:"100%",top:"0%",left:"0%"},outFx:{width:e||"10%",top:"50%",left:"50%"}}],listLR:[{inFx:{left:0,opacity:1}, outFx:[{left:e||k,opacity:0},{left:"-"+(e||k),opacity:0}],selector:[":odd",":even"]}],listRL:[{inFx:{left:0,opacity:1},outFx:[{left:e||k,opacity:0},{left:"-"+(e||k),opacity:0}],selector:[":even",":odd"]}],"caption-Top":[{inFx:{top:0,opacity:0.8},outFx:{top:"-"+e||-50,opacity:0}}],"caption-Right":[{inFx:{right:0,opacity:0.8},outFx:{right:"-"+e||-150,opacity:0}}],"caption-Bottom":[{inFx:{bottom:0,opacity:0.8},outFx:{bottom:"-"+e||-50,opacity:0}}], "caption-Left":[{inFx:{left:0,opacity:0.8},outFx:{left:"-"+e||-150,opacity:0}}]}};return this.each(function(){var e=q(),j={easing:"swing",timeIn:400,timeOut:350},r=function(b){b.each(function(){h(this).closest(".panel").is(".activePage")||h(this).hide()})},n=function(b,c,d){if(!(b.length===0||typeof c=="undefined")){var a=c[0]||c,g=a[1]||"",f=parseInt(g===""?a.time:a[0].time,10);if(d){b.css("position")!=="absolute"&&b.css({position:"relative"});b.stop();if(g!==""){b.filter(c[1][0]).animate(a[0], {queue:false,duration:f,easing:a[0].easing});b.filter(c[1][1]).animate(g,{queue:false,duration:f,easing:a[0].easing,complete:function(){setTimeout(function(){r(b)},j.timeOut)}});return}}d||b.show();b.animate(a,{queue:false,duration:f,easing:a.easing,complete:function(){d&&setTimeout(function(){r(b)},j.timeOut)}})}},t=function(b,c){var d,a,g=c?"outFx":"inFx",f={},m=c?j.timeOut:j.timeIn,l=h.trim(b[0].replace(/\s+/g," ")).split(" ");if(c&&l.length==1&&e.hasOwnProperty(l)&&typeof e[l][0].selector!=="undefined"){a= e[l][0].outFx;a[0].time=b[2]||j.timeOut;a[0].easing=b[3]||j.easing;return[a,e[l][0].selector||[]]}h.each(l,function(u,s){if(e.hasOwnProperty(s)){d=typeof b[1]=="undefined"?e:q(b[1]);h.extend(true,f,d[s][0][g]);f.time=b[2]||f.time||m;f.easing=b[3]||j.easing}});return[f]};h(this).bind("slide_init",function(b,c){var d=c.$currentPage,a=c.$lastPage;if(d.is(".cloned")){var g=c.currentPage==c.pages?c.pages:1;d=d.add(a).add(c.$items.eq(g))}else d=d.add(a);for(var f in i)if(f=="outFx")for(var m in i.outFx)d.find(m)&& n(d.find(m),i.outFx[m],true);else f!=="inFx"&&h.isArray(i[f])&&n(d.find(f),t(i[f],true),true)}).bind("slide_complete",function(b,c){var d=c.$currentPage;if(d.is(".cloned"))d=c.$items.eq(c.currentPage==c.pages?c.pages:1);for(var a in i)if(a=="inFx")for(var g in i.inFx)d.find(g)&&n(d.find(g),i.inFx[g],false);else a!="outFx"&&h.isArray(i[a])&&d.find(a)&&n(d.find(a),t(i[a],false),false)})})}})(jQuery);


/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		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;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
 
 
/*
jQuery Waypoints - v1.1
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/MIT-license.txt
https://github.com/imakewebthings/jquery-waypoints/blob/master/GPL-license.txt
*/
(function($,k,m,i,d){var e=$(i),g="waypoint.reached",b=function(o,n){o.element.trigger(g,n);if(o.options.triggerOnce){o.element[k]("destroy")}},h=function(p,o){var n=o.waypoints.length-1;while(n>=0&&o.waypoints[n].element[0]!==p[0]){n-=1}return n},f=[],l=function(n){$.extend(this,{element:$(n),oldScroll:-99999,waypoints:[],didScroll:false,didResize:false,doScroll:$.proxy(function(){var q=this.element.scrollTop(),p=q>this.oldScroll,s=this,r=$.grep(this.waypoints,function(u,t){return p?(u.offset>s.oldScroll&&u.offset<=q):(u.offset<=s.oldScroll&&u.offset>q)}),o=r.length;if(!this.oldScroll||!q){$[m]("refresh")}this.oldScroll=q;if(!o){return}if(!p){r.reverse()}$.each(r,function(u,t){if(t.options.continuous||u===o-1){b(t,[p?"down":"up"])}})},this)});$(n).scroll($.proxy(function(){if(!this.didScroll){this.didScroll=true;i.setTimeout($.proxy(function(){this.doScroll();this.didScroll=false},this),$[m].settings.scrollThrottle)}},this)).resize($.proxy(function(){if(!this.didResize){this.didResize=true;i.setTimeout($.proxy(function(){$[m]("refresh");this.didResize=false},this),$[m].settings.resizeThrottle)}},this));e.load($.proxy(function(){this.doScroll()},this))},j=function(n){var o=null;$.each(f,function(p,q){if(q.element[0]===n){o=q;return false}});return o},c={init:function(o,n){this.each(function(){var u=$.fn[k].defaults.context,q,t=$(this);if(n&&n.context){u=n.context}if(!$.isWindow(u)){u=t.closest(u)[0]}q=j(u);if(!q){q=new l(u);f.push(q)}var p=h(t,q),s=p<0?$.fn[k].defaults:q.waypoints[p].options,r=$.extend({},s,n);r.offset=r.offset==="bottom-in-view"?function(){var v=$.isWindow(u)?$[m]("viewportHeight"):$(u).height();return v-$(this).outerHeight()}:r.offset;if(p<0){q.waypoints.push({element:t,offset:t.offset().top,options:r})}else{q.waypoints[p].options=r}if(o){t.bind(g,o)}});$[m]("refresh");return this},remove:function(){return this.each(function(o,p){var n=$(p);$.each(f,function(r,s){var q=h(n,s);if(q>=0){s.waypoints.splice(q,1)}})})},destroy:function(){return this.unbind(g)[k]("remove")}},a={refresh:function(){$.each(f,function(r,s){var q=$.isWindow(s.element[0]),n=q?0:s.element.offset().top,p=q?$[m]("viewportHeight"):s.element.height(),o=q?0:s.element.scrollTop();$.each(s.waypoints,function(u,x){var t=x.options.offset,w=x.offset;if(typeof x.options.offset==="function"){t=x.options.offset.apply(x.element)}else{if(typeof x.options.offset==="string"){var v=parseFloat(x.options.offset);t=x.options.offset.indexOf("%")?Math.ceil(p*(v/100)):v}}x.offset=x.element.offset().top-n+o-t;if(s.oldScroll>w&&s.oldScroll<=x.offset){b(x,["up"])}else{if(s.oldScroll<w&&s.oldScroll>=x.offset){b(x,["down"])}}});s.waypoints.sort(function(u,t){return u.offset-t.offset})})},viewportHeight:function(){return(i.innerHeight?i.innerHeight:e.height())},aggregate:function(){var n=$();$.each(f,function(o,p){$.each(p.waypoints,function(q,r){n=n.add(r.element)})});return n}};$.fn[k]=function(n){if(c[n]){return c[n].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof n==="function"||!n){return c.init.apply(this,arguments)}else{if(typeof n==="object"){return c.init.apply(this,[null,n])}else{$.error("Method "+n+" does not exist on jQuery "+k)}}}};$.fn[k].defaults={continuous:true,offset:0,triggerOnce:false,context:i};$[m]=function(n){if(a[n]){return a[n].apply(this)}else{return a.aggregate()}};$[m].settings={resizeThrottle:200,scrollThrottle:100};e.load(function(){$[m]("refresh")})})(jQuery,"waypoint","waypoints",this);





$(document).ready(function(){

$('.tweet-body').hide();

var username='lkieksi'; // set user name
var format='json'; // set format, you really don't have an option on this one
var url='http://api.twitter.com/1/statuses/user_timeline/'+username+'.'+format+'?callback=?'; // make the url

	$.getJSON(url,function(tweet){ // get the tweets
		$(".tweet-body").html(tweet[0].text).fadeIn(); // get the first tweet in the response and place it inside the div
	});
	


	if (mobilesite == true) {
		$('body').addClass('mobile');
	}

if (mobilesite != true) {

		$('#carousel-items').anythingSlider({
			width : 960,
			height: 390,
			startPanel: 1,
			buildArrows: true,
			buildNavigation: false,
			startStopped: false,
			resizeContents: false,
			animationTime: 900,
			appendControlsTo: null,
			enableKeyboard: false,
			toggleArrows: true,
			easing: "easeInOutExpo",
			resumeDelay : 500,
			delay: 7000,
			autoPlayLocked: true
		});
		
	$('.case-study-slides').anythingSlider({
		width : 960,
		height: 600,
		startPanel: 1,
		buildArrows: true,
		resizeContents: false,
		startStopped: true,
		animationTime: 900,
		animationTime: 900,
		appendControlsTo: null,
		enableKeyboard: true,
		toggleArrows: true,
		easing: "easeInOutExpo",
		resumeDelay : 500,
		delay: 7000,
		autoPlayLocked: false
	});
	
		$('#carousel-items').bind('slide_complete', function(slider){
			fadeCarouselTitles();
		});
		
		
	
}

   $('a[href*=#]').click(function() {

      // skip SmoothScroll on links inside sliders or scroll boxes also using anchors or if there is a javascript call
      if($(this).parent().attr('class')=='scrollable_navigation' || $(this).attr('href').indexOf('javascript')>-1) return;

      // duration in ms
      var duration=1000;

      // easing values: swing | linear
      var easing='swing';

      // get / set parameters
      var newHash=this.hash;
      var oldLocation=window.location.href.replace(window.location.hash, '');
      var newLocation=this;

      // make sure it's the same location      
      if(oldLocation+newHash==newLocation)
      {
         // get target
         var target=$(this.hash+', a[name='+this.hash.slice(1)+']').offset().top;

         // adjust target for anchors near the bottom of the page
         if(target > $(document).height()-$(window).height()) target=$(document).height()-$(window).height();         

         // set selector
         if($.browser.safari) var animationSelector='body:not(:animated)';
         else var animationSelector='html:not(:animated)';

         // animate to target and set the hash to the window.location after the animation
         $(animationSelector).animate({ scrollTop: target }, duration, easing, function() {

            // add new hash to the browser location
            window.location.href=newLocation;
         });

         // cancel default click action
         return false;
      }
   });

	
	$('.anythingControls, #back-to-top').css({
		'display' : 'none'
	});
		
		fadeCarouselTitles();
		$('.case-info:eq(1)').animate({
			'opacity' : '1.00'
		},900, "easeInOutSine", function(){
			$('#carousel .arrow, .case-study-carousel .arrow').css({
				'display' : 'block'
			});
		});
		
		
		$('.carousel-item').css({
			'cursor' : 'pointer'
		});

		$('#previous-clients li a').each(function(){
			var theLabel = $(this).html().toLowerCase().split(' ').join('');
			$(this).addClass(theLabel);
			$(this).prepend('<span></span>');
		});


		if (mobilesite != true ) {

			$('#previous-clients li a').live('mouseenter', function(){
				$('#previous-clients li a span').hide();
				$(this).children('span').fadeIn();
			});
		
			$('#previous-clients li a').live('mouseleave', function(){
				$(this).children('span').fadeOut();
			});

		
	
		$('#welcome-text').waypoint(function(event, direction){
			if (direction === 'down') {
				$('#back-to-top').fadeIn();
			}
			else {
				$('#back-to-top').fadeOut();
			}
		});
		
	}
		
		
	});
	
	function fadeCarouselTitles(){
			$('.case-info').css({'opacity':'0'});
			$('.activePage .case-info').stop().animate({
				'opacity' : '1.00'
			},900, "easeInOutSine");
	};
	
