

$(document).ready(function() {
	var durShort = 150;
	var durMed = 250;
	var durLong = 500;
	var durXLong = 750;
	var filterLiHeight = 31;


	$(".placeholder").each(function() {
	  var defaultTxt = $(this).attr("placeholder");
  
	  if (!supports_input_placeholder()) {

	    $(this).val(defaultTxt);
	    $(this).addClass("grey");
	    $(this).focus(
	      function() { if ($(this).val() == defaultTxt) { $(this).val(""); $(this).removeClass("grey"); }
	    });

	    $(this).blur(
	      function() { if ($(this).val() == "") { $(this).addClass("grey"); $(this).val(defaultTxt); } }
	    );
	  }

	  // check whether placeholder allowed
	  function supports_input_placeholder() {
	    var i = document.createElement('input');
	    return 'placeholder' in i;
	  }
	});

	// footer expansion
	$('#footer .click-target').click(function(){
		if($('#footer #footer-label').hasClass('open')){
			$('#footer').animate({
				height: '40px'
			}, durMed);
			$('#footer #footer-label').removeClass('open');
			$('#newsletter-input').blur();
		} else {
			$('#footer').animate({
				height: '314px'
			}, durMed);
			$('#footer #footer-label').addClass('open');
		}
	});

	$('#footer .click-target').hover(function(){
		$('#footer #footer-label').addClass('hover');
	}, function(){
		$('#footer #footer-label').removeClass('hover');
	});


	var HeaderShadow;

	HeaderShadow = (function () {
	  "use strict";

	  // variables by type/alpha
	  var $header = $('#header');

	  // methods
	  function detectPosition() {
	    var position_top = $header.position().top;

	    if (position_top > 0) {
	      $header.addClass('scrolling');
	    } else {
	      $header.removeClass('scrolling')
	    }
	  }

	  // must be last
	  return function init() {
	    $(window).scroll(function () {
	      detectPosition();
	    });
	  };

	}());

	var headerShadow = new HeaderShadow();

}); 


