/* Author: Reason Media Company/ Kid Genius

*/

function validateForm()
{

	var x = document.getElementById('selectSize');

if (x==null || x=="")
  {
  alert("Please select a size");
  return false;
  }
}

$(document).scroll(function() {
  var height = $(window).height();
  var scrollTop = $(window).scrollTop();
  if (scrollTop > 115){
  $('.minicart').hide();
  } 

});



$(document).ready(function() {
 $("a[rel^='prettyPhoto']").prettyPhoto();
		$( ".detailsTab" ).tabs();
		$(".image").click(function() {
var image = $(this).attr("rel");
$('.mainImage').hide();
$('.mainImage').fadeIn('slow');
$('.mainImage').html('<a href="' + image + '"class="jqzoom"><img src="' + image + '"/></a>');
return false;
	});
	
	var defaultText = 'search';
	
	$('.searchField').attr("value", defaultText).css('color', '#bbbbbb')
.focus(function(){
    if (defaultText == $(this).attr("value")) {
      $(this).attr("value", "").css('color', '#fff');
    }
  }).blur(function(){
    if ($(this).attr("value") == '') {
      $(this).attr("value", defaultText).css('color', '#bbbbbb');
    }
  });
  
  $('#addtocart2').click(function() {
  alert('Please select a size!');
});

	
	

    
	$('.close').click(function(){
	 $('.referral').hide();
	});
	
		$('.closeCart').click(function(){
	 $('.minicart').hide();
	});
	
	$('.subscribe a').click(function(){  
  $('.dropdown').show();
});

$('.shopNav li:last').addClass('last');


  $('#slideshow a:not(:first)').hide();
    
    setInterval(function(){
      $('#slideshow img:first-child').fadeOut()
         .next('img').fadeIn()
         .end().appendTo('#slideshow');}, 
      5000);
	
	
	$('li#shopItem').each(function(index) {
	
    	$(this).mouseover(function(){
		 	$(this).find('#itemHover').show();
		 	$(this).mouseout(function(){
	   			 $(this).find('#itemHover').hide();
			});
		});
	});

	

	
	
$(function() {
		$( "#selectable" ).selectable();
	});
	
	
	
  $('.jqzoom').jqzoom({
            zoomType: 'standard',
            lens:true,
            preloadImages: false,
            alwaysOn:false
  });

	

	
	
});
	
	
























