
/*********************************************
This function is called by the category to reset to the category level to one by setting the
field rather than adding to it. Page is passed fromt the catalogue so it knows how to submit.
*********************************************/
function clicked_category(category_id,page)
	{
	document.getElementById("display_order").value = "";
	//document.getElementById("category_toList_id").value = category_toList_id;
	document.getElementById("category_id").value = category_id;
	document.forms[0].method="post";
	document.forms[0].action = page;
	document.forms[0].submit();
	}

/*********************************************
This function is called by the inner most category to display the products.... 
*********************************************/
function clicked_category_toList(category_id,category_toList_id,page)
	{
	document.getElementById("display_order").value = "";
	document.getElementById("category_toList_id").value = category_toList_id;
	document.getElementById("category_id").value = category_id;
	if (document.getElementById("intpage") != null) 
		document.getElementById("intpage").value = 1;
	document.forms[0].method="post";
	document.forms[0].action = page;
	document.forms[0].submit();
	}
	
	
function change_displayOrder(page,display_order)
	{
	document.getElementById("display_order").value = display_order;
	document.forms[0].method="post";
	document.forms[0].action = page;
	document.forms[0].submit();
	}
	
function SubmitToDescription(page,product_id,product_item_id)
	{
	document.getElementById("product_id").value = product_id;
	document.getElementById("product_item_id").value = product_item_id;
	document.forms[0].method="post";
	document.forms[0].action = page;
	document.forms[0].submit();
	}
function SubmitToDescriptionRelatedProducts(page,product_id,category_id, subcat_id)
	{
	document.getElementById("product_id").value = product_id;
	document.getElementById("product_item_id").value = "";
	if (subcat_id != "")
		document.getElementById("category_id").value = subcat_id;
	else
		document.getElementById("category_id").value = category_id;
	document.getElementById("category_toList_id").value = category_id;
	document.forms[0].method="post";
	document.forms[0].action = page;
	document.forms[0].submit();
	}

function SubmitToCart(page)
	{
	//document.forms[0].category_toList_id.value= "";
	//document.forms[0].category_id.value= "";
	document.forms[0].method="post";
	document.forms[0].action = page;
	document.forms[0].submit();
	}
	
function SetProduct_item_id(product_item_id)
	{
	document.getElementById("product_item_id").value = product_item_id;
	}
	
function submitCartToUpdate()
	{
	document.getElementById('h_update_cart').value='1';
	document.shopping_cart.submit();
	}
	
function submitCartToDelete(product_item_id)
	{
	document.getElementById('h_delete_cart').value = product_item_id;
	document.shopping_cart.submit();
	}
function submitCartToCheckout(page)
	{
	document.shopping_cart.action = page;
	document.shopping_cart.submit();
	}