//Cufon text replacement
$(document).ready( function() {
							
	$(".requirementShow").click(function() {
		tb_show('Requirements List', '/__ajax/__requirements.asp?height=300&width=400', null);			
		return false;
	});
	
	$(".requirementHelp").click(function() {
		tb_show('Requirements List', '/__ajax/__requirements_help.asp?height=400&width=600', null);	
		return false;								 
	});
	
	
	
});

Cufon.replace('h1', { fontFamily: 'Helvetica' });

function RemoveItem(code) {
	
	$.ajax({
	   type: "POST",
	   url: "/__ajax/__requirements.asp",
	   cache: false,		 
	   data: "product_code=" + escape(code) + "&action=remove",
	   success: function(msg) {
		 // alert("Product added to list [" + msg + "]");
		//$("#requirementslist_items").html(msg);
		tb_show('Requirements List', '/__ajax/__requirements.asp?height=300&width=400', null);
		UpdateCount();
	   }
	 });

	return false;	
}

function IncrementItem(code) {
	
	$.ajax({
	   type: "POST",
	   url: "/__ajax/__requirements.asp",
	   cache: false,		 
	   data: "product_code=" + escape(code) + "&action=increment",
	   success: function(msg) {
		 // alert("Product added to list [" + msg + "]");
		//$("#requirementslist_items").html(msg);
		tb_show('Requirements List', '/__ajax/__requirements.asp?height=300&width=400', null);
		UpdateCount();
	   }
	 });

	return false;
	
}

function DecrementItem(code) {
	
	$.ajax({
	   type: "POST",
	   url: "/__ajax/__requirements.asp",
	   cache: false,		 
	   data: "product_code=" + escape(code) + "&action=decrement",
	   success: function(msg) {
		 // alert("Product added to list [" + msg + "]");
		//$("#requirementslist_items").html(msg);
		tb_show('Requirements List', '/__ajax/__requirements.asp?height=300&width=400', null);
		UpdateCount();
	   }
	 });

	return false;
	
}

function UpdateCount() {
	$.ajax({
	   type: "POST",
	   url: "/__ajax/__requirements.asp",
	   cache: false,		 
	   data: "action=count",
	   success: function(msg) {	
	   
		var count = msg;
		if (msg=="0") {
			$("#ReqBarContainer").hide();
		} else {
			$("#ReqBarContainer").show();
		}
		$("#requirementCount").html(msg);
	   }
	 });
}