$(document).ready(function(){
	var cookieName = 'full_color';
	var colors = ['gray','lightBlue','brown','lightGreen','darkBlue','purple','red','wine','black'];
	
	$(".howDoUFeeling a").click(function(){
		changeBodyClass(this.id);
		$.cookie(cookieName, this.id);
		return false;
	});
	
	if($.cookie(cookieName) == null) {
		$.cookie(cookieName, getRandomColor());
	}
	
	$(".menu2 .navig a").click(function() {
		var id=this.id;
		if(id=='links'){
			window.location=this.href;
			
		} 
		$(".menu2 .navig a").each(function(i) {
			$(this).removeClass('selected');
			if ($("#"+this.id+"_ul").is(":visible"))
				if(this.id==id) return false;
				$("#"+this.id+"_ul").slideUp();
		});
		
		$("#"+this.id+"_ul").slideDown();
		$(this).addClass('selected');

		return false;
		
	});
	
	$("#s").click(function(){
		if($(this).val()=='Buscar')
		$(this).val('');
	});
		
	changeBodyClass($.cookie(cookieName));
	
	function getRandomColor() {
		return colors[createRandomNumber(0, colors.length)];
	}
		
	function createRandomNumber(Min, Max){
		var rand = Math.random();
		return Math.round((Max-Min) * rand + Min);
	}
	
	function changeBodyClass(c) {
		$("#feeling").attr('class', c);
	}
	
//	$(".howDoUFeeling a").hover(
//		function(){
//			//$(".howDoUFeeling dt").text($(this).attr('title'));
//		}, function(){
//			//$(".howDoUFeeling dt").text('Como se sente hoje?');
//		}
//	);
		
});