// Allender Butzke Engineers Custom Javascript 1.1.a
/* This javascript file was created by Chris Butzke of mintconditioned.com.  This file features original scripts as well as several borrowed scripts.  When borrowed, the appropriate documentation has been included. */

// Easing Plugin 1.3
/*
 * 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
 *
 * 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. 
*/
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){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}});
 // End Easing Plugin
 // SpasticNav Plugin
 /* SpasticNav by Jeffery Way: http://jeffery-way.com */
(function($) {$.fn.spasticNav = function(options) {options = $.extend({overlap : 8,speed : 300,reset : 1000,easing : 'easeOutQuad'}, options);return this.each(function() {var nav = $(this),currentPageItem = $('#selected', nav),blob,reset;$('<li id="blob"></li>').css({width : currentPageItem.outerWidth(),height : currentPageItem.outerHeight() + options.overlap,left : currentPageItem.position().left,top : currentPageItem.position().top - options.overlap / 2,backgroundColor : options.color}).appendTo(this);blob = $('#blob', nav);$('li:not(#blob)', nav).hover(function() {
/* mouse over */
clearTimeout(reset);blob.animate({left : $(this).position().left,width : $(this).width()},{duration : options.speed,easing : options.easing,queue : false});}, function() {
/* mouse out */	
reset = setTimeout(function() {blob.animate({width : currentPageItem.outerWidth(),left : currentPageItem.position().left}, options.speed)}, options.reset);});});};})(jQuery);
// End Spastic Nav
// Anything Slider
/*	anythingSlider v1.2
    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/
	To use the navigationFormatter function, you must have a function that
	accepts two paramaters, and returns a string of HTML text.
	index = integer index (1 based);
	panel = jQuery wrapped LI item this tab references
	@return = Must return a string of HTML/Text
	navigationFormatter: function(index, panel){
		return index + " Panel"; // This would have each tab with the text 'X Panel' where X = index}
*/
(function($){$.anythingSlider=function(d,f){var g=this;g.$el=$(d);g.el=d;g.currentPage=1;g.timer=null;g.playing=false;g.$el.data("AnythingSlider",g);g.init=function(){g.options=$.extend({},$.anythingSlider.defaults,f);g.$wrapper=g.$el.find('> div').css('overflow','hidden');g.$slider=g.$wrapper.find('> ul');g.$items=g.$slider.find('> li');g.$single=g.$items.filter(':first');if(g.options.buildNavigation)g.buildNavigation();g.singleWidth=g.$single.outerWidth();g.pages=g.$items.length;g.$items.filter(':first').before(g.$items.filter(':last').clone().addClass('cloned'));g.$items.filter(':last').after(g.$items.filter(':first').clone().addClass('cloned'));g.$items=g.$slider.find('> li');g.buildNextBackButtons();if(g.options.autoPlay){g.playing=!g.options.startStopped;g.buildAutoPlay()};if(g.options.pauseOnHover){g.$el.hover(function(){g.clearTimer()},function(){g.startStop(g.playing)})}if((g.options.hashTags==true&&!g.gotoHash())||g.options.hashTags==false){g.setCurrentPage(1)}};g.gotoPage=function(a,b){if(b!==true)b=false;if(!b)g.startStop(false);if(typeof(a)=="undefined"||a==null){a=1;g.setCurrentPage(1)};if(a>g.pages+1)a=g.pages;if(a<0)a=1;var c=a<g.currentPage?-1:1,n=Math.abs(g.currentPage-a),left=g.singleWidth*c*n;g.$wrapper.filter(':not(:animated)').animate({scrollLeft:'+='+left},g.options.animationTime,g.options.easing,function(){if(a==0){g.$wrapper.scrollLeft(g.singleWidth*g.pages);a=g.pages}else if(a>g.pages){g.$wrapper.scrollLeft(g.singleWidth);a=1};g.setCurrentPage(a)})};g.setCurrentPage=function(a,b){if(g.options.buildNavigation){g.$nav.find('.cur').removeClass('cur');$(g.$navLinks[a-1]).addClass('cur')};if(b!==false)g.$wrapper.scrollLeft(g.singleWidth*a);g.currentPage=a};g.goForward=function(a){if(a!==true)a=false;g.gotoPage(g.currentPage+1,a)};g.goBack=function(){g.gotoPage(g.currentPage-1)};g.gotoHash=function(){if(/^#?panel-\d+$/.test(window.location.hash)){var a=parseInt(window.location.hash.substr(7));var b=g.$items.filter(':eq('+a+')');if(b.length!=0){g.setCurrentPage(a);return true}};return false};g.buildNavigation=function(){g.$nav=$("<div id='thumbNav'></div>").appendTo(g.$el);g.$items.each(function(i,a){var b="&nbsp;";var c=$("<a href='#'></a>");if(typeof(g.options.navigationFormatter)=="function"){c.html(g.options.navigationFormatter(b,$(this)))}else{c.text(b)}c.click(function(e){g.gotoPage(b);if(g.options.hashTags)g.setHash('panel-'+b);e.preventDefault()});g.$nav.append(c)});g.$navLinks=g.$nav.find('> a')};g.buildNextBackButtons=function(){var a=$('<a class="arrow forward"></a>'),$back=$('<a class="arrow back"></a>');g.$wrapper.after($back).after(a)};g.buildAutoPlay=function(){g.$startStop=$("<a href='#' id='start-stop'></a>").html(g.playing?g.options.stopText:g.options.startText);g.$el.append(g.$startStop);g.$startStop.click(function(e){g.startStop(!g.playing);e.preventDefault()});g.startStop(g.playing)};g.startStop=function(a){if(a!==true)a=false;g.playing=a;if(g.options.autoPlay)g.$startStop.toggleClass("playing",a).html(a?g.options.stopText:g.options.startText);if(a){g.clearTimer();g.timer=window.setInterval(function(){g.goForward(true)},g.options.delay)}else{g.clearTimer()}};g.clearTimer=function(){if(g.timer)window.clearInterval(g.timer)};g.setHash=function(a){if(typeof window.location.hash!=='undefined'){if(window.location.hash!==a){window.location.hash=a}}else if(location.hash!==a){location.hash=a};return a};g.init()};$.anythingSlider.defaults={easing:"swing",autoPlay:true,startStopped:false,delay:3000,animationTime:600,hashTags:true,buildNavigation:true,pauseOnHover:true,startText:"Start",stopText:"Stop",navigationFormatter:null};$.fn.anythingSlider=function(b){if(typeof(b)=="object"){return this.each(function(i){(new $.anythingSlider(this,b));b.hashTags=false})}else if(typeof(b)=="number"){return this.each(function(i){var a=$(this).data('AnythingSlider');if(a){a.gotoPage(b)}})}}})(jQuery);
// End Anything Slider
// Yahoo! YQL Weather Widget
$.YQL=function(a,b){if(!a||!b){throw new Error('$.YQL(): Parameters may be undefined');}var c=encodeURIComponent(a.toLowerCase()),url='http://query.yahooapis.com/v1/public/yql?q='+c+'& maxage=3600'+'&format=json&callback=?';$.getJSON(url,b)};$.YQL("select * from weather.forecast where location=50310",function(a){var w=a.query.results.channel;var b="url(images/weathericons/originals/"+w.item.condition.code+".png)";var c=w.wind.direction;if(c>=348.75&&c<=360){c="N"};if(c>=0&&c<11.25){c="N"};if(c>=11.25&&c<33.75){c="NNE"};if(c>=33.75&&c<56.25){c="NE"};if(c>=56.25&&c<78.75){c="ENE"};if(c>=78.75&&c<101.25){c="E"};if(c>=101.25&&c<123.75){c="ESE"};if(c>=123.75&&c<146.25){c="SE"};if(c>=146.25&&c<168.75){c="SSE"};if(c>=168.75&&c<191.25){c="S"};if(c>=191.25&&c<213.75){c="SSW"};if(c>=213.75&&c<236.25){c="SW"};if(c>=236.25&&c<258.75){c="WSW"};if(c>=258.75&&c<281.25){c="W"};if(c>=281.25&&c<303.75){c="WNW"};if(c>=303.75&&c<326.25){c="NW"};if(c>=326.25&&c<348.75){c="NNW"};$('#weatherIcon').css("background-image",b);$('#weatherLocation').html(w.location.city+", "+w.location.region);$('#weatherTemp').html(w.item.condition.temp+"&deg;"+"f");$('#weatherText').html(w.item.condition.text);$('#weatherHumidity').html("Humidity: "+w.atmosphere.humidity+"%");$('#weatherWind').html("Wind: "+c+" "+w.wind.speed+" mph");$('#weatherForecast').html("Hi: "+w.item.forecast[0].high+" Lo: "+w.item.forecast[0].low);$('#weatherTomorrow').html(w.item.forecast[1].day+" &nbsp;Hi: "+w.item.forecast[1].high+"  &nbsp;"+w.item.forecast[1].text);$('#weatherLink').html("<a href='"+w.item.link+"' target='_blank'>click for full forecast or new location</a>")});
