function enquete(){
	$(document).ready(function() {   
		$('#votar').click(function() {
			$.post('_enquete_act.php', $('#enquete').formSerialize(), function(data) {
				if (data == "erro") { 
					alert("Selecione uma opção");
				} else if (data == "errovotos") { 
					alert("Você só pode votar uma vez por dia"); 
				} else {
					$("div#formenquete").css("display", "none");
					$("div#enqueteresultado").css("display", "block");
				} 
			});
		});
		$('a#enquetebtnresultado').live('click',function(){
			$("div#formenquete").css("display", "none");
			$("div#enqueteresultado").css("display", "block");
		});
		$('a#enquetevoltar').live('click',function(){
			$("div#formenquete").css("display", "block");
			$("div#enqueteresultado").css("display", "none");
		});
	});
}
$(document).ready(function(){
		$('.date-pick')
		.datePicker({startDate:'01/01/1996'})
		.bind(
			'focus',
			function(event, message)
			{
				if (message == $.dpConst.DP_INTERNAL_FOCUS) {
					return true;
				}
				var dp = this;
				var $dp = $(this);
				$dp.dpDisplay();
				$('*').bind(
					'focus.datePicker',
					function(event)
					{
						var $focused = $(this);
						if (!$focused.is('.dp-applied')) // don't close the focused date picker if we just opened a new one!
						{
							// if the newly focused element isn't inside the date picker and isn't the original element which triggered
							// the opening of the date picker

							if ($focused.parents('#dp-popup').length == 0 && this != dp && !($.browser.msie && this == document.body)) {
								$('*').unbind('focus.datePicker');
								$dp.dpClose();
							}
						}
					}
				);
				return false;
			}
		).bind(
			'dpClosed',
			function(event, selected)
			{
				$('*').unbind('focus.datePicker');
			}
		);
});

// Calendário	
function calendario(){	
	$(document).ready(function() {   
		$('#caldireita').click(function() {
			$('div#agenda').load($('a#caldireita').attr('href'));
		});	
		$('#calesquerda').click(function() {
			$('div#agenda').load($('a#calesquerda').attr('href'));
		});	
	});
}