// JavaScript Document
$(document).ready(function(){
	//Forgot password pop up
	$('.login-help').hover(function(){
		$('.forgot-psswd').slideDown(200);
	});
	$('.signin-top').mouseleave(function(){
		$('.forgot-psswd').slideUp(200);
	});
	
	//Search box
	$('.select-options').mouseenter(function(){
		$('.category').stop(true, true).slideDown(600);
	});
	$('.search-form').mouseleave(function(){
		$('.category').stop(true, true).slideUp(600);
	});
	$('.select-options li').click(function(){
		$('.category').stop(true, true).slideUp();
	});
	
	//Sign Up box effects
	$('.signup-txt').each(function() {
		   var default_value = this.value;
	
		   $(this).focus(function(){
				   if(this.value == default_value) {
						   this.value = '';
						   $(this).addClass("filled");
				   }
		   });
		   $(this).blur(function(){
				   if(this.value == '') {
						   this.value = default_value;
						   $(this).removeClass("filled");
				   }
		   });
	});
	
	//Rating
	$('.star').hover(function(){
		$(this).prevAll().andSelf().addClass('rated_over');
		$(this).nextAll().removeClass('rated_over');  
	});
	$('.star').click(function(){
		$('.rating-coloum').children('span').removeClass('rated');
		$(this).addClass('rated');
	});
	
	//Slider
	var findImg = $('.slider-container').children().size();
	var totalwidth = findImg*137;
	var movelength = 400;
	var count = 1;
	
	$('.slider-container').width(totalwidth);
	$('li.next-slide').click(function(){
		var moveme = movelength*count;
		$('.slider-container').animate({left:-moveme});
	});
	$('li.prev-slide').click(function(){
		var moveme = movelength*count;
		$('.slider-container').animate({left:moveme-400});
	});
	
	
});
