/* Author:

*/

jQuery(document).ready(function(){

	jQuery('.product-image li').hide();
	
	jQuery('.product-image li:first').show();
	
	jQuery('.product-description li a').click(function() {
		var i = jQuery('.product-description li').index(jQuery(this).parent('li'));
		jQuery('.product-image ul li:visible').fadeOut('fast', function() {
			jQuery('.product-image ul li').eq(i).fadeIn('fast');
		});

	});


/* form placeholders */
 $("input[type='text'], input[type='password'], textarea").each(function(){
	 var inputField = this;
	 
	 $(this).bind("focus",function(){
	 	$(this).parent().find("label").addClass("sleep");
	 });
	 
	 $(this).bind("blur",function(){
		if($(this).val().length < 1){
	 		$(this).parent().find("label") .removeClass("sleep");
	 	}
	 });
	 
	if($(this).val().length > 0){
		$(this).parent().find("label") .addClass("sleep");
	}

	 $(this).parent().find("label").click(function() {
	 	$(this).addClass("sleep");
	 	inputField.focus();
	 });
		 
	 $(this).bind("keyup",function(e){
	 //console.log($(this).val().length)
	 if($(this).val().length>0){
	 	$(this).parent().find("label").addClass("sleep");
	 }else{
		 $(this).parent().find("label") .removeClass("sleep");
	 }
	 });
 
 });



});

