window.innerShiv = (function() {
	var d, r;
	
	return function(h, u) {
		if (!d) {
			d = document.createElement('div');
			r = document.createDocumentFragment();
			/*@cc_on d.style.display = 'none';@*/
		}
		
		var e = d.cloneNode(true);
		/*@cc_on document.body.appendChild(e);@*/
		e.innerHTML = h;
		/*@cc_on document.body.removeChild(e);@*/
		
		if (u === false) return e.childNodes;
		
		var f = r.cloneNode(true), i = e.childNodes.length;
		while (i--) f.appendChild(e.firstChild);
		
		return f;
	}
}());
jQuery(document).ready(function() {
  (function($) {

    var $body = $('body');


    if ($body.is('.work')) {	
     if ($body.is('#work')) { }
	 else if (!$.browser.msie) {		 
      if ($body.is('#arenson-maas')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/arenson-maas/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/arenson-maas/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/arenson-maas/2/index.html">2</a></li><li><a href="/work/arenson-maas/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/arenson-maas/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/arenson-maas/1/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/arenson-maas/3/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/arenson-maas/1/index.html">1</a></li><li>2</li><li><a href="/work/arenson-maas/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/arenson-maas/3/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/arenson-maas/2/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/arenson-maas/1/index.html">1</a></li><li><a href="/work/arenson-maas/2/index.html">2</a></li><li>3</li></ol></nav></figure></div>', false));
	  }		
      if ($body.is('#cedar-ridge-vineyards')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/cedar-ridge-vineyards/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/cedar-ridge-vineyards/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/cedar-ridge-vineyards/2/index.html">2</a></li><li><a href="/work/cedar-ridge-vineyards/3/index.html">3</a></li><li><a href="/work/cedar-ridge-vineyards/4/index.html">4</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/cedar-ridge-vineyards/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/cedar-ridge-vineyards/1/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/cedar-ridge-vineyards/3/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/cedar-ridge-vineyards/1/index.html">1</a></li><li>2</li><li><a href="/work/cedar-ridge-vineyards/3/index.html">3</a></li><li><a href="/work/cedar-ridge-vineyards/4/index.html">4</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/cedar-ridge-vineyards/3/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/cedar-ridge-vineyards/2/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/cedar-ridge-vineyards/4/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/cedar-ridge-vineyards/1/index.html">1</a></li><li><a href="/work/cedar-ridge-vineyards/2/index.html">2</a></li><li>3</li><li><a href="/work/cedar-ridge-vineyards/4/index.html">4</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/cedar-ridge-vineyards/4/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/cedar-ridge-vineyards/3/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/cedar-ridge-vineyards/1/index.html">1</a></li><li><a href="/work/cedar-ridge-vineyards/2/index.html">2</a></li><li><a href="/work/cedar-ridge-vineyards/3/index.html">3</a></li><li>4</li></ol></nav></figure></div>', false));
	  }	  
      if ($body.is('#clearheart-spirits')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/clearheart-spirits/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/clearheart-spirits/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/clearheart-spirits/2/index.html">2</a></li><li><a href="/work/clearheart-spirits/3/index.html">3</a></li><li><a href="/work/clearheart-spirits/4/index.html">4</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/clearheart-spirits/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/clearheart-spirits/1/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/clearheart-spirits/3/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/clearheart-spirits/1/index.html">1</a></li><li>2</li><li><a href="/work/clearheart-spirits/3/index.html">3</a></li><li><a href="/work/clearheart-spirits/4/index.html">4</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/clearheart-spirits/3/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/clearheart-spirits/2/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/clearheart-spirits/4/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/clearheart-spirits/1/index.html">1</a></li><li><a href="/work/clearheart-spirits/2/index.html">2</a></li><li>3</li><li><a href="/work/clearheart-spirits/4/index.html">4</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/clearheart-spirits/4/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/clearheart-spirits/3/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/clearheart-spirits/1/index.html">1</a></li><li><a href="/work/clearheart-spirits/2/index.html">2</a></li><li><a href="/work/clearheart-spirits/3/index.html">3</a></li><li>4</li></ol></nav></figure></div>', false));
      }
      if ($body.is('#inbox-marketing')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/inbox-marketing/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/inbox-marketing/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/inbox-marketing/2/index.html">2</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/inbox-marketing/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/inbox-marketing/1/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/inbox-marketing/1/index.html">1</a></li><li>2</li></ol></nav></figure></div>', false));		  
	  }
      if ($body.is('#john-deere')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/john-deere/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/john-deere/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/john-deere/2/index.html">2</a></li><li><a href="/work/john-deere/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/john-deere/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/john-deere/1/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/john-deere/3/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/john-deere/1/index.html">1</a></li><li>2</li><li><a href="/work/john-deere/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/john-deere/3/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/john-deere/2/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/john-deere/1/index.html">1</a></li><li><a href="/work/john-deere/2/index.html">2</a></li><li>3</li></ol></nav></figure></div>', false));			  
	  }
      if ($body.is('#kor')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/kor/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/kor/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/kor/2/index.html">2</a></li><li><a href="/work/kor/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/kor/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/kor/1/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/kor/3/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/kor/1/index.html">1</a></li><li>2</li><li><a href="/work/kor/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/kor/3/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/kor/2/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/kor/1/index.html">1</a></li><li><a href="/work/kor/2/index.html">2</a></li><li>3</li></ol></nav></figure></div>', false));			  
	  }
      if ($body.is('#luther-college')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/luther-college/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/luther-college/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/luther-college/2/index.html">2</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/luther-college/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/luther-college/1/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/luther-college/1/index.html">1</a></li><li>2</li></ol></nav></figure></div>', false));			  
	  }
      if ($body.is('#mpw')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/mpw/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/mpw/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/mpw/2/index.html">2</a></li><li><a href="/work/mpw/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/mpw/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/mpw/1/index.html" title="Previous">Previous</a></li><li class="next"><a href="/work/mpw/3/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/mpw/1/index.html">1</a></li><li>2</li><li><a href="/work/mpw/3/index.html">3</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/mpw/3/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/mpw/2/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/mpw/1/index.html">1</a></li><li><a href="/work/mpw/2/index.html">2</a></li><li>3</li></ol></nav></figure></div>', false));			  
	  }
      if ($body.is('#whatsup')) {
       var $slidewrapper = $(innerShiv('<div id="ajax-wrapper"><figure><img alt="" height="400" src="/work/whatsup/1/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="next"><a href="/work/whatsup/2/index.html" title="Next">Next</a></li></ul></nav><nav class="figures"><ol><li>1</li><li><a href="/work/whatsup/2/index.html">2</a></li></ol></nav></figure><figure><img alt="" height="400" src="/work/whatsup/2/images/figure.jpg" width="870" /><nav class="sequential"><ul><li class="previous"><a href="/work/whatsup/1/index.html" title="Previous">Previous</a></li></ul></nav><nav class="figures"><ol><li><a href="/work/whatsup/1/index.html">1</a></li><li>2</li></ol></nav></figure></div>', false));			  
	  }	  




/* Cache some jQuery objects */
/*
	  var context = document.getElementById('ajax-wrapper'),
          $slides = $('> figure', context),
		  $nav = $('nav a', context);
*/
      var $slides = $slidewrapper.find('> figure'),
	      $nav = $slidewrapper.find('nav a');

/* Add helpful IDs to figures */ 
      $slides.each(function(i){
        this.id='slide-' + ++i;										  									  
      });
	
/* Replace URLs with helpful hashes to links that correspond to figure IDs */
      $nav.each(function(){
        var index = this.pathname.lastIndexOf('/') - 1,
	        hash = '#slide-' + this.pathname.substring(index++, index);
	    this.href = hash;		  
      });

/* Make all slides transparent, set their z-index to a small enough number, and hide them */

	  $slides
	   .css({opacity:0,zIndex:10})
	   .hide();

	  $slidewrapper.replaceAll('#content > figure:first');
	 
/* Here is where the magic happens */
	  $(window).bind('hashchange', function () {

/* Need to add figure out which is the deafult slide */
	    var hash = window.location.hash,
            re = /#slide\-\d/;	
	    if (!(hash.length && re.test(hash))) {
	     var index = window.location.pathname.lastIndexOf('/') - 1,
             slide = window.location.pathname.substring(index++, index);  
	     hash = '#slide-' + (isNaN(slide) ? '1' : slide);		 
	    }  

/* Hide all of the slide */
        $slides
	     .stop()
	     .css({zIndex:10})
	     .animate({opacity:0}, 500, function(){ $(this).hide() });

/* Display the selected slide */
        $slides
	     .filter(hash)
	     .stop()
	     .show()
	     .css({zIndex:1000})
	     .animate({opacity:1}, 500);

/* Prevent the default click behavior. */
        return false;
	  
	  });	

  // Since the event is only triggered when the hash changes, we need
  // to trigger the event now, to handle the hash the page may have
  // loaded with.
  	  $(window).trigger( "hashchange" );
	
	 }
	}
  



/* Hover Effects */

 /* Global Navigation */
    $('#nav-global ul li a').each(function() {
	  var $this = $(this),
	      color = $this.css('color');
	  $this
	   .css({color:color})
	   .hover(function() {
		 $this.stop().animate({color:'#fff'}, 500);
        },
	    function() {
  		 $this.stop().animate({color:color}, 500);
        }
	  );
     });

 /* Home */

    if ($body.is('#home')) {	
     $('#featured article a')
	  .css({backgroundPosition:'top left'})	
	  .each(function() {
	    var $this = $(this),
	        $span = $('<span class="hover" />').css({opacity:0}).appendTo(this),
	        $headline = $this.find('h1'),
	        color = {
		    'anchor': $this.css('color'),
		    'headline': $headline.css('color')
		    };
	    $headline.css({color:color.headline});
	    $this
	     .css({color:color.anchor})
	     .hover(
          function() {
		   $this.stop().animate({color:'#ccc'}, 500); /* Go to #fff? */
		   $headline.stop().animate({color:'#fff'}, 500);
		   $span.stop().animate({opacity:1}, 500); 	
          },
	      function() {
  		   $this.stop().animate({color:color.anchor}, 500);
		   $headline.stop().animate({color:color.headline}, 500);
		   $span.stop().animate({opacity:0}, 500); 	
          }
	     );
	  });
    }

/* News */
    if ($body.is('.news') || $body.is('.articles')) {
     if ($body.is('#news') || $body.is('#articles')) {	
      $('article a').each(function() {
	    var $this = $(this),
		    $header = $this.find('header'),
			$time = $header.find('time'),
		    $figure = $this.find('figure'),
			$img = $figure.find('img'),
	        color = {
		    'anchor': $this.css('color'),
		    'headline': $header.css('color'),
			'time': $time.css('color')
		    };
        $header.css({color:color.headline});
		$time.css({color:color.time});
		$figure.css({backgroundImage:'url(' + $img.attr('src') + ')'});
	    $img.css({left:'auto', opacity:0, right:0});
	    $this
	     .css({color:color.anchor})
	     .hover(
          function() {
		   $this.stop().animate({color:'#333'}, 500);
		   $header.stop().animate({color:'#000'}, 500);
		   $time.stop().animate({color:'#e50'}, 500);
		   $img.stop().animate({opacity:1}, 500); 	
          },
	      function() {
		   $this.stop().animate({color:color.anchor}, 500);
		   $header.stop().animate({color:color.headline}, 500);
		   $time.stop().animate({color:color.time}, 500);
		   $img.stop().animate({opacity:0}, 500); 
          }
	     );			 
					  
	  });

     }
     else {
		 
     }
    }
	
/* Work */

    if ($body.is('.work')) {
     if ($body.is('#work')) {	
      $('nav.work a')
       .css({backgroundPosition:'bottom center'})	 
	   .each(function() {
	     var $this = $(this),
	         $span = $('<span class="hover" />').css({opacity:0}).appendTo(this),	   
	         color = $this.css('color');
	     $this
	      .css({color:color})	   
	      .hover(
           function() {
		    $this.stop().animate({color:'#000'}, 500);
            $span.stop().animate({opacity:1}, 500); 		 
           },
	       function() {
  		    $this.stop().animate({color:color}, 500);
            $span.stop().animate({opacity:0}, 500); 
           }
	      );
	   });	
     }
     else {
      $('nav.work a')
       .css({backgroundPosition:'bottom left'})
	   .each(function() {
	     var $this = $(this),
	          $span = $('<span class="hover" />').css({opacity:0}).appendTo(this),
	          color = $this.css('color');
         $this
	      .css({color:color})
	      .hover(
           function() {
		    $this.stop().animate({color:'#000'}, 500);
            $span.stop().animate({opacity:1}, 500); 
           },
	       function() {
  		    $this.stop().animate({color:color}, 500);
            $span.stop().animate({opacity:0}, 500); 
           }
	      );
	   });	


if (!$.browser.msie) {
     $('#content')
	  .find('nav.sequential li a')
	   .animate({opacity:0.5}, 0)
	   .end()
      .delegate('nav.sequential a', 'mouseenter', function() {
        $(this).stop().animate({opacity:1}, 500); 
      })
      .delegate('nav.sequential a', 'mouseleave', function() {
        $(this).stop().animate({opacity:0.5}, 500);  
      });						
}

     }
    }



/*
    if ($body.is('#news')) {	
	
var group = 8;	 
var $articles = $('#content article');
var total = $articles.size();
var groups = Math.ceil(total/group);
var list = [];
list[0] = '<nav class="pagination"><ul>'; 
var i = 1;
$articles.hide().slice(0,8).show();	 
for (x=1; x <= groups; x++) {
 list[i++] = '<li><a href="#page-';
 list[i++] = x;
 list[i++] = '">';
 list[i++] = x;
 list[i++] = '</a></li>'; 
}
list[i++] = '</ul></nav>';
$('#content').prepend(list.join(''));
	 
	 
	 
	}

*/



  })(jQuery);
});