function change_displayOrder(page,display_order)
	{
	document.getElementById("display_order").value = display_order;
	document.forms.cart.method="post";
	document.forms.cart.action = page;
	document.forms.cart.intpage.value = '1';
	document.forms.cart.submit();
	}
	
function submitCartToUpdate()
	{
	document.getElementById('h_update_cart').value='1';
	document.forms.cart.submit();
	}
function submitCartToDelete(product_item_id,color_nb,category_id, country_id)
	{
	document.getElementById('h_delete_cart_item_id').value = product_item_id;
	document.getElementById('h_delete_cart_color_nb').value = color_nb;
	document.getElementById('h_delete_cart_category_id').value = category_id;
	document.getElementById('h_delete_cart_country_id').value = country_id;
	document.forms.cart.submit();
	}

function change_items_per_page(page,user_items_per_page)
	{
	document.getElementById("items_per_page").value = user_items_per_page;
	document.forms.cart.method="post";
	document.forms.cart.action = page;
	document.forms.cart.submit();
	}
	
	
	
// Shopping Cart // Wishlist -------------------------- //

			function update_comments(item_id, color_nb, category_id) {
				update_item(item_id, color_nb, category_id);
			}
			function update_quantity(item_id, color_nb, category_id) {
				var the_qty = document.getElementById("quantity_"+item_id+"_"+color_nb).value;
				if (isFinite(the_qty) && the_qty.indexOf(".") < 0) {
					if (the_qty == "") {
						the_qty = 1;
						document.getElementById("quantity_"+item_id+"_"+color_nb).value = "1";
					}
					
					/*
							subtotal = document.getElementById("price_"+item_id).value * the_qty;
							leStr = new String(subtotal); 
							strSplit = leStr.split(".");
							if(strSplit.length==1){
								subtotal = subtotal + ".00";
							}else if(strSplit.length==2 && strSplit[strSplit.length-1].length > 2){
								subtotal = Math.round(subtotal*100)/100;
							}else if(strSplit.length==2 && strSplit[strSplit.length-1].length == 1){
								subtotal = subtotal + "0";
							}
							total = parseFloat(document.getElementById("total").value) - parseFloat(document.getElementById("subtotal_" + item_id).value) + parseFloat(subtotal);
							leStr2 = new String(total); 
							strSplit2 = leStr2.split(".");
							if(strSplit2.length==1){
								total = total + ".00";
							}else if(strSplit2.length==2 && strSplit2[strSplit2.length-1].length > 2){
								total = Math.round(total*100)/100;
							}else if(strSplit2.length==2 && strSplit2[strSplit2.length-1].length == 1){
								total = total + "0";
							}

							document.getElementById("span_total").innerHTML = total;
							document.getElementById("total").value = total;
				
							document.getElementById("span_subtotal_" + item_id).innerHTML = subtotal;
							document.getElementById("subtotal_" + item_id).value = subtotal;
					*/
					
					update_item(item_id, color_nb, category_id);
				} else {
					document.getElementById("quantity_"+item_id+"_"+color_nb).value = document.getElementById("old_qty_"+item_id+"_"+color_nb).value;
				}
				
			}
		
			function set_qty_old(item_id, color_nb) {
				document.getElementById("old_qty_"+item_id+'_'+color_nb).value = document.getElementById("quantity_"+item_id+'_'+color_nb).value;
			}
			function update_item(item_id, color_nb, category_id) {
				//update the price
				//then submit the iframe

				theiframe = window.frames['shopping_cart_update'];
				theiframe.update(item_id,document.getElementById("quantity_"+item_id+'_'+color_nb).value,color_nb,category_id);
				//theiframe.update(item_id,document.getElementById("quantity_"+item_id).value,"");
				}		
