$(document).ready(function(){
						   
	 //fix png behavior
	$.ifixpng('/images/tgif.gif');
	$("img[@src$=.png]").ifixpng();	
	
	//order tab slide
	$("#order_tab").click(function(){
 		$("#order_form").slideToggle("slow");
 		$(this).toggleClass("active"); return false;
 	});
 
	//image swap for display
	$("#display #desc").append('<strong></strong>')
	$("a.thumbs").click(function(){
	  var largePath = $(this).attr("href");
	  var largeAlt = $(this).attr("name");
	  $("#display #large").attr({ src: largePath, alt: largeAlt });
	  $("#display #desc strong").html(" " + largeAlt + " "); return false;
	});
	
	
	//CALCULATOR
	// bind the recalc function to the quantity fields then calculate
	$("input[@name^=qty_]").bind("keyup", recalc);
	recalc();
	
});
	
	
function recalc(){
		$("[@id^=total_]").calc(
			// the equation to use for the calculation
			"qty * price",
			// define the variables used in the equation, these can be a jQuery object
			{
				qty: $("input[@name^=qty_]"),
				price: $("[@id^=price_]")
			},
			// define the formatting callback, the results of the calculation are passed to this function
			function (s){
				// return the number as a dollar amount
				return "$" + s.toFixed(2);
			},
			// define the finish callback, this runs after the calculation has been complete
			function ($this){
				// sum the total of the $("[@id^=total_item]") selector
				var sum = $this.sum();
				
				$("#grandTotal").text(
					// round the results to 2 digits
					"$" + sum.toFixed(2)
				);

			}
		);
	}