/* Author: Chase Reeves
	## = section
	$$ = customization option
*/
$(document).ready(function($) {
	// == ## ========================================================== Show/Hide baseline grid
	// $$ Remove this or comment it out to remove lil' top-right button
	$('body').append('<b id="show_baseline">&#9810;</b>');
	$('#show_baseline').click(function() {
	  $('body').toggleClass('show_baseline');
	});
	
	// == ## ========================================================== Mobile Nav
	// Thx Chris! http://css-tricks.com/13303-convert-menu-to-dropdown/
	// $$ Make sure you name your wordpress menu "Main Menu" so this works.
	$("<select />").appendTo(".menu-main-menu-container");$("<option />",{"selected":"selected","value":"","text":"Go to..."}).appendTo(".menu-main-menu-container select");$(".menu-main-menu-container a").each(function(){var el=$(this);$("<option />",{"value":el.attr("href"),"text":el.text()}).appendTo(".menu-main-menu-container select")});$(".menu-main-menu-container select").change(function(){window.location=$(this).find("option:selected").val()});
	
	// == ## ========================================================== Image Rollover Style
	// $$ you can put the class `img_opa` on anything you want to add an opacity effect to.
	$('.img_opa').css({opacity:1});$('.img_opa').each(function(){$(this).hover(function(){$(this).stop().animate({opacity:0.8},10)},function(){$(this).stop().animate({opacity:1},500)})});
	
	// FitVid
	$("#content").fitVids();
	// FitText
	$("#homepage_banner_panel h1").fitText(1.1);
	// Lettering.js
	$("#logo a").lettering();
});
// Put OS and Browser in body class
$.each($.browser,function(i){$('body').addClass(i);return false});var os=['iphone','ipad','windows','mac','linux'];var match=navigator.appVersion.toLowerCase().match(new RegExp(os.join('|')));if(match){$('body').addClass(match[0])};
// Remove .no-js from body
$('body').removeClass('no-js');
/* ## FitVids 1.0 Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com*/
(function($){$.fn.fitVids=function(options){var settings={customSelector:null}
var div=document.createElement('div'),ref=document.getElementsByTagName('base')[0]||document.getElementsByTagName('script')[0];div.className='fit-vids-style';div.innerHTML='&shy;<style>         \
      .fluid-width-video-wrapper {        \
         width: 100%;                     \
         position: relative;              \
         padding: 0;                      \
      }                                   \
                                          \
      .fluid-width-video-wrapper iframe,  \
      .fluid-width-video-wrapper object,  \
      .fluid-width-video-wrapper embed {  \
         position: absolute;              \
         top: 0;                          \
         left: 0;                         \
         width: 100%;                     \
         height: 100%;                    \
      }                                   \
    </style>';ref.parentNode.insertBefore(div,ref);if(options){$.extend(settings,options);}
return this.each(function(){var selectors=["iframe[src^='http://player.vimeo.com']","iframe[src^='http://www.youtube.com']","iframe[src^='http://www.kickstarter.com']","object","embed"];if(settings.customSelector){selectors.push(settings.customSelector);}
var $allVideos=$(this).find(selectors.join(','));$allVideos.each(function(){var $this=$(this);if(this.tagName.toLowerCase()=='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){return;}
var height=this.tagName.toLowerCase()=='object'?$this.attr('height'):$this.height(),aspectRatio=height/$this.width();$this.wrap('<div class="fluid-width-video-wrapper" />').parent('.fluid-width-video-wrapper').css('padding-top',(aspectRatio*100)+"%");$this.removeAttr('height').removeAttr('width');});});}})(jQuery);
/* ## FitText.js 1.0 Copyright 2011, Dave Rupert http://daverupert.com */
(function($){$.fn.fitText=function(kompressor,options){var settings={'minFontSize':Number.NEGATIVE_INFINITY,'maxFontSize':Number.POSITIVE_INFINITY};return this.each(function(){var $this=$(this);var compressor=kompressor||1;if(options){$.extend(settings,options)}var resizer=function(){$this.css('font-size',Math.max(Math.min($this.width()/(compressor*10),parseFloat(settings.maxFontSize)),parseFloat(settings.minFontSize)))};resizer();$(window).resize(resizer)})}})(jQuery);
/* ## Lettering.JS 0.6.1 Copyright 2010, Dave Rupert http://daverupert.com */
(function($){function injector(t,splitter,klass,after){var a=t.text().split(splitter),inject='';if(a.length){$(a).each(function(i,item){inject+='<span class="'+klass+(i+1)+'">'+item+'</span>'+after;});t.empty().append(inject);}}
var methods={init:function(){return this.each(function(){injector($(this),'','char','');});},words:function(){return this.each(function(){injector($(this),' ','word',' ');});},lines:function(){return this.each(function(){var r="eefec303079ad17405c889e092e105b0";injector($(this).children("br").replaceWith(r).end(),r,'line','');});}};$.fn.lettering=function(method){if(method&&methods[method]){return methods[method].apply(this,[].slice.call(arguments,1));}else if(method==='letters'||!method){return methods.init.apply(this,[].slice.call(arguments,0));}
$.error('Method '+method+' does not exist on jQuery.lettering');return this;};})(jQuery);
