// JavaScript Document
	var Order = {
		paper: function(obj)
		{
			$(".P1").hide();
			$(".P2").hide();
			$(".P3").hide();
			$(".P4").hide();
			$(".P5").hide();
			$("."+$(obj).val()).show();
		},
		checkQuantity: function(multiple)
		{
			if (($("#"+quantity).val() % parseInt(multiple)) != 0)
			{
				alert("Please enter a quantity in multiples of "+multiple);
				return false;
			} else return true;
		},
		showHide: function(obj,id)
		{

			if ($("#"+id).hasClass("down"))
			{
					$("#"+id).fadeOut("fast",function()
					{	
						$(obj).html("More");
						$("#"+id).removeClass("down");
						
						if ($("#"+id+"_intro").length > 0) $("#"+id+"_intro").fadeIn();
					});


			}
			else 
			{
				if ($("#"+id+"_intro").length > 0)
				{
					$("#"+id+"_intro").fadeOut("fast",function()
						{
							$(obj).html("Less");
							$("#"+id).fadeIn();	
							$("#"+id).addClass("down");
						}
					);
				}
				else 
				{
					$(obj).html("Less");
					$("#"+id).fadeIn();	
					$("#"+id).addClass("down");
				}
			}
		},
		showAll: function(obj)
		{
			if ($(obj).hasClass("expanded"))
			{
				$(".hideable").fadeOut("fast", function()
				{
					$(obj).removeClass("expanded");
					$(obj).html("Show All");
					$(".hideable").removeClass("down");
					$(".intro").fadeIn();
				});
			}
			else
			{
				$(".intro").fadeOut("fast", function()
				{
					$(obj).addClass("expanded");
					$(obj).html("Hide All");
					$(".hideable").addClass("down");
					$(".hideable").fadeIn();
				});
			}
			
		}
	}


var DropDown = {
	init: function()
	{
		$("li.dropDown").mouseover(function(data)
		{
			var current = $(data.currentTarget);

			$($(current).find("a")[0]).addClass('over');

			$($(current).find("ul")[0]).fadeIn();
			var brk;
		});

		$("li.dropDown").mouseout(function(data)
		{
			var current = $(data.currentTarget);

			var a = $($(current).find("a")[0]).removeClass('over');
			var brk;
		});
	},
}


var PageSelect = {
	init: function()
	{	
		var links = $("#navigation").find("a");

		for (var i=0; i<$(links).length; i++)
		{
			if (window.location == $(links)[i].href)
			{
				$($(links)[i]).addClass("thisPage");
				return false;
			}
		}
	}
}

$(document).ready(function()
{
	DropDown.init();
	PageSelect.init();
});
