// Typekit
try{Typekit.load();}catch(e){}

// Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18396354-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

// Placeholder
jQuery(function() {
jQuery.support.placeholder = false;
test = document.createElement('input');
if('placeholder' in test) jQuery.support.placeholder = true;
});
$(function() {
if(!$.support.placeholder) { 
  var active = document.activeElement;
  $(':text').focus(function () {
     if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
        $(this).val('').removeClass('hasPlaceholder');
     }
  }).blur(function () {
     if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
        $(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
     }
  });
  $(':text').blur();
  $(active).focus();
  $('form:eq(0)').submit(function () {
     $(':text.hasPlaceholder').val('');
  });
}
});

// Product Image Gallery
$(document).ready(function(){	
	$("figure ul li a").click(function() {
	var image = $(this).attr("href");
	var title = $(this).attr("title");
	$("figure > img").attr({ src: image });
	$("figure > strong").html(title);
	return false;
});
});

// Slideshow
$(document).ready(function(){
	$('#slideshow li:gt(0)').hide();
	setInterval(function(){$('#slideshow li:eq(0)').fadeOut(1125).next().fadeIn(1125).end().appendTo('#slideshow');}, 3250);
});
