/*
function getCurItem() {
	capture_item($("input[name='code']").val(), $("input[name='name']").val());
}
*/

	$(window).ready(function(){
		var $doc = $(document);
		//Prev
		$doc.selector = "li.prevLink a";
		$doc.live("click", navigateTo);
		//Next
		$doc.selector = "li.nextLink a";
		$doc.live("click", navigateTo);
		
		//Jump To
		$("#jumpToItem").bind("change", navigateTo);
		//ItemDetail.positionLocation is declared on item_detail.tpl since it's a PHP variable
		function navigateTo() {
			var url = "pos.php?"+ItemDetail.positionLocation+"pos_id=",
				$posId = $(this),
				posId = $posId.attr("rel") || $posId.val();
			if(posId) {
				location.href = url+posId;
			}
		}
		
		var $info = $("#popUpDetails").find(".info");
		// Bind Image Popup
		$(".itemImg a").overlay({
			target: '#popUpDetails',
			onLoad: function() { $info.show().fadeIn("slow"); }
		}).gallery({template:"<strong>${title}</strong>", autohide:false });
		
		$(".itemWoodTypes a").overlay({
			target: '#popUpDetails',
			onLoad: function() { $info.show().fadeIn("slow"); }
		}).gallery({template:"<strong>${title}</strong>", autohide:false });			
	});
