window.currentPage = false;

$(document).ready(function()
{
								
	$(".plDetail").hide();

	//Toggle the component with class "element"
	$(".plan h5").click(function()
	{
		$(this).next(".plDetail").slideToggle(300);
	});	

				
	$(".button").click( function() 
	{		
		var query = "name=" + $("#name").val();
		query+= "&company=" + $("#company").val();
		query+= "&email=" + $("#email").val();
		query+= "&phone=" + $("#phone").val();
		query+= "&message=" + $("#message").val();
		$.ajax(
		{
			type: "POST",
			url: "contact.php",
			data: query,
			success: function(data)
			{
				$("#name, #company, #email, #phone, #message").val("");
			}
		});
	});
			
	$(".thumb").hover( function()
	{
		var thumbId = $(this).attr("id");
		$("." + thumbId).css("display", "block");
		
	}, function() {
		
		var thumbId = $(this).attr("id");
		$("." + thumbId).css("display", "none");
	});

	//Hide pages when logo is clicked
	$("#home").click( function()
	{
		if (window.currentPage)
		{
			$(".page").css("display", "none");
			$(".home").slideDown();
			window.currentPage = false;
		}
	});
  
  
	//Page transitioning via navigation
	$("#Les").click( function()
	{
		if ($(this).attr("id") != window.currentPage)
		{
			window.currentPage = $(this).attr("id");
			$(".page").css("display", "none");
			$(".Les").slideDown();
		}
	});


	$("#cts").click( function()
	{
		if ($(this).attr("id") != window.currentPage)
		{
			window.currentPage = $(this).attr("id");
			$(".page").css("display", "none");
			$(".cts").slideDown();
		}
	});
  
	$("#prjs").click( function()
	{
		if ($(this).attr("id") != window.currentPage)
		{
			window.currentPage = $(this).attr("id");
			$(".page").css("display", "none");
			$(".prjs").slideDown();  
		}
	});
  
	$("#frnd").click(function()
	{
		if ($(this).attr("id") != window.currentPage)
		{
			window.currentPage = $(this).attr("id");
			$(".page").css("display", "none");
			$(".frnd").slideDown();  
		}
	});

	$("#abt").click(function()
	{
		if ($(this).attr("id") != window.currentPage)
		{
			window.currentPage = $(this).attr("id");
			$(".page").css("display", "none");
			$(".abt").slideDown();  
		}
	});
  
	$("#cnt").click(function()
	{
		if ($(this).attr("id") != window.currentPage)
		{
			window.currentPage = $(this).attr("id");
			$(".page").css("display", "none");
			$(".cnt").slideDown();  
		}
	});
});



