// When the document loads do everything inside here ...
 $(window).load(function(){
	$voted = false; 
	$('.content').load('http://www.ourfirstloves.com/practice/vote.php?q=e');	//by default initally load text from boo.php
 		$('.VoteOption').click(function() { 
			if (!$voted) { 
				$('.VoteOption').fadeOut();
				$(this).fadeIn();
				var id = $(this).attr("id");
				var post = $("#postid").attr("value");
				$("#status").load('http://www.ourfirstloves.com/practice/vote.php?id='+id+'&post='+post,{},showResults);
				// $("#VotingResults").load('http://www.ourfirstloves.com/practice/results.php?post='+post);
				$voted = true;
			}
		 	return false;
		});
	
	function showResults() {
		var post = $("#postid").attr("value");
		$("#VotingResults").load('http://www.ourfirstloves.com/practice/results.php?post='+post);	
		
	}
		
	 /* $('#menu a').click(function() { //start function when any link is clicked
					$(".content").slideUp("slow");
					 var content_show = $(this).attr("title"); //retrieve title of link so we can compare with php file
						$.ajax({
						method: "get",url: "boo.php",data: "page="+content_show,
						beforeSend: function(){$("#loading").show("fast");}, //show loading just when link is clicked
						complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete
						success: function(html){ //so, if data is retrieved, store it in html
						$(".content").show("slow"); //animation
						$(".content").html(html); //show the html inside .content div
				 }
			 }); //close $.ajax(
	 }); //close click( */
 }); //close $(