$(document).ready(function(){
	if ($('.zoomable').length) { // check the zoom container exists ( ($(selector).length > 0 )
	  var zoomUrl = $('.zoom').attr('href');
	  $('<img/>').attr('src',zoomUrl).appendTo('body').css('display','none'); // preload large image
	  $('.zoom').zoomy({ // magnify
	    clickable:false,
	    zoomSize: 150,
        zoomText: 'Click to toggle inspection mode',
	    round: true,
        glare: true,
	    attr:'rel'
	  });
	}
	if ($('#slides').length) { // slide container exists on all pages, slides list only where carousel is needed
	  $('#slide').infiniteCarousel({ // but the carousel must be applied to the slide container, not to the list
	    displayProgressBar : true,
	    showControls : false,
	    displayThumbnails : false,
	    easeLeft: 'easeInOutQuart'
	  });	
	}
	
	if ('#signup-form') {
		$.support.placeholder = (function(){
		    var i = document.createElement('input');
		    return 'placeholder' in i;
		})();
		
		if (!$.support.placeholder) {
			$('#signup-form').find('input').not('.submit').each(function(){
				$(this).val($(this).attr('placeholder'));
			});
			$('#signup-form').find('input').not('.submit').focus(function(){
				if ($(this).val() == $(this).attr('placeholder')) {
					$(this).val('');
				}
			});
			$('#signup-form').find('input').not('.submit').blur(function(){
				if ($(this).val() == '') {
					$(this).val($(this).attr('placeholder'));
				}
			});
			$('#signup-form').submit(function(e){
				if ($(this).find('input').val() == $(this).find('input').attr('placeholder')) {
					e.preventDefault();
				}
			});
		} 
	}
	
});
