		$(document).ready(function() {

		   // Sets the current page's menu item to have class "active"
		   // Assumes: #menu > li > a > href==request_uri - so be consistent!
		   //$("#menu").find("li").each(function(i) {
			//	var childLink = $(this).children().get(0);
			//	var currentPage = "<?=$_SERVER['REQUEST_URI']?>";

			//	if ($(childLink).attr("href") == currentPage)
			//		$(this).addClass("active");
		   //});


			$("input.number").blur(function() {
				$(this).val($(this).val().replace(/[^0-9]/gi, ""));
			});

			$("input[type=radio]").click(function() {
				if ($(this).attr("name")=="paymethod") {
					if ($(this).val()=="Credit Card") $("#carddetails").show();
					//else $("#carddetails").hide();
				}
			});

		   $("table.cart").find("td").each(function(i) {
			if ($(this).text().substring(0,1)=="$" || $(this).text().substring(0,2)=="-$") 
			{
				$(this).css("text-align", "right");
				$(this).css("font-size", "14px");
				//console.log("Dunnit!");
			}
		   });

			$('a#select_image').click( function() {
				var str = "<img src='" + $(this).attr("rel") + "'>";
				$("#showimage").text(str);
				return false;
				});


			$("#btnAddToCart").click(function(e) {
			   var proceed = true;
			   e.preventDefault();

			   var valtouse = $("#quantity").val();

			   if (valtouse < 3) {
				   alert("Qty must be a minimum of 3");
				   proceed = false;
				   return false;
			   }

			   $("#btnAddToCart").attr("href", $("#btnAddToCart").attr("href")+"&quantity="+$("#quantity").val());


			   if (proceed) window.location=$(this).attr("href");
		   });


		startList();
		});
