// JavaScript Document

/*---------------- functions ------------------*/

/*---------------- variables ------------------*/
var _show = 400;
var _hide = 200;
var backEnd = "/jmeanley_white/backend.php";
// var backEnd = "/~brianm/jmeanley_white/backend.php";

/*---------------- pre-load ------------------*/
$(document).ready(function() {
	
	// append loader gif to content box as images are loader.  remove it once it is finished!
	$("#content").append('<div class="loader"></div>');
	
	$("#navA").hover(function(){
		$(this).stop();
		$(this).animate({"top": "-72px"}, _show);
		}, function() {
		$(this).stop();
		$(this).animate({"top": "2px"}, _hide);
	});
	$("#navB").hover(function()
	{
		$(this).stop();
		$(this).animate({"top": "-37px"}, _show);
		}, function() {
		$(this).stop();
		$(this).animate({"top": "2px"}, _hide);
	});
	// $("#navC").hover(function()
	// {
	// 	$(this).stop();
	// 	$(this).animate({"top": "-37px"}, _show);
	// 	}, function() {
	// 	$(this).stop();
	// 	$(this).animate({"top": "2px"}, _hide);
	// });
	$("#white").click(function()
	{
	    var color = "white";
		$("body").css('background', '#fff');
		$("#content").css('background', '#eee');

	    // Send Ajax request to backend.php, with src set as "img" in the POST data
	    $.post(backEnd, {"theme": color}, function(return_data)
		{
			var themeColor = return_data;
		});
	});	
	$("#gray").click(function()
	{
	    var color = "gray";
		$("body").css('background', '#282828');
		$("#content").css('background', '#323232');

	    // Send Ajax request to backend.php, with src set as "img" in the POST data
	    $.post(backEnd, {"theme": color}, function(return_data)
		{
			var themeColor = return_data;
		});
	});
	$("#black").click(function()
	{
	    var color = "black";
		$("body").css('background', '#000');
		$("#content").css('background', '#121212');

	    // Send Ajax request to backend.php, with src set as "img" in the POST data
	    $.post(backEnd, {"theme": color}, function(return_data)
		{
			var themeColor = return_data;
		});
	});
});

/*---------------- post load ------------------*/
$(window).load(function()
{
	// remove loader gif
	$(".loader").remove();
});

