$(document).ready(function() {
	
	$(document).pngFix(); 
	
	$('input#searchText').focus(function() {
		$('input#searchText').val('');
	});
	
	$('input#yesVote').click(function() {
		//alert('Clicked YES');
		$.ajax({
			url: "/sendVote.php", 
			type: "POST", 
			data: "yesVote=1", 
			cache: false,
			success: function(returnedResult) { 
				$("#voteHolder").empty(); 
				if (returnedResult.length > 0) { 
					$("#voteHolder").append(returnedResult); 
				} 
			} 
		});
	});
	
	$('input#noVote').click(function() {
		$.ajax({
			url: "/sendVote.php", 
			type: "POST", 
			data: "noVote=1", 
			cache: false,
			success: function(returnedResult) { 
				$("#voteHolder").empty(); 
				if (returnedResult.length > 0) { 
					$("#voteHolder").append(returnedResult); 
				} 
			} 
		});
	});
	$('input#showResults').click(function() {
		$.ajax({
			url: "/sendVote.php", 
			cache: false,
			success: function(returnedResult) { 
				$("#voteHolder").empty(); 
				if (returnedResult.length > 0) { 
					$("#voteHolder").append(returnedResult); 
				} 
			} 
		});
	});
	
	$.localScroll.defaults.axis = 'xy';
	
	// Scroll initially if there's a hash (#something) in the url 
	$.localScroll.hash({
		target: '#content', // Could be a selector or a jQuery object too.
		queue:true,
		duration:1500
	});
	
	$.localScroll({
		target: '#content', // could be a selector or a jQuery object too.
		queue:true,
		duration:1000,
		hash:true
	});
	
	// SIMPLE ACCORDIAN STYLE MENU FUNCTION
	$('div.accordionButton').click(function() {
		$('div.accordionContent').slideUp('normal');	
		$(this).next().slideDown('normal');
	});
	
	$("div.accordionContent").hide(); //CLOSES ALL DIVS ON PAGE LOAD
	
	
	$('ul#tabs li').hover(function() {
		$(this).next('span').slideDown('normal');	
	});
	
});


