//[DEBUG]
//var baseurl = 'http://jerseylavender.byteart.com/';
var baseurl = 'http://www.jerseylavender.co.uk/';

var mtimer = new Array();
var ls = -1;
// ## Genera ##
// Returns a reference to an object in the DOM
function getObj(nm) {
	if (document.getElementById) {
		return document.getElementById(nm);
	} else if (document.all) {
		return document.all[nm];
	} else {
		return eval("document." + nm);
	}
}
//
// ## Menu ##
// Turns a menu on
function menuOn(whatMenu, image) {
	getObj("menuHeaderImage" + whatMenu).src = baseurl + "graphics/button_" + image + "_on.gif";
}
//
// Called when mouse is moved away from a menu
function menuOut(whatMenu, image) {
	getObj("menuHeaderImage" + whatMenu).src = baseurl + "graphics/button_" + image + ".gif";
}
// for "about" menu, or any others that have no drop down	
function menuOn2(whatMenu, image) {
	getObj("menuHeaderImage" + whatMenu).src = baseurl + "graphics/button_" + image + "_on.gif";
}
//
function menuOut2(whatMenu, image) {
	getObj("menuHeaderImage" + whatMenu).src = baseurl + "graphics/button_" + image + ".gif";
}

function show_submenu(menuID) {
	//getObj(menuID).style.display = 'block';
	$('#' + menuID).show()
}

function hide_submenu(menuID) {
	//getObj(menuID).style.display = 'none';
	$('#' + menuID).hide();
}

function swap_backgroundcol(menuID, colorcode) {
	getObj(menuID).style.backgroundColor = '#' + colorcode;
}

function switchgraphic(menu, graphic) {
	obj = new getObj(menu);
	obj.src = "/graphics/" + graphic;
}

function checkEmail(email) {
	email = email.toLowerCase();
	if (email.match(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/)) {
		return true;
	} else {
		return false;
	}
}

function clearbox(objectID) {
	getObj(objectID).value = ""

}

function get_delivquote(sessionID, CustID) {
	var newurl1 = baseurl + "deliveryQuote.asp?custID=" + CustID;
	var photopage = window.open(newurl1, "Delivery_Quote", "width=600,height=500,locationbar=0,menubar=0,personalbar=0,status=0,scrollbars=0,resizable=0");
}
//-------------------------------------- Accounts Functions ------------------------------------------------------//

function arena_4_ecommerce_validsignup() {
	valid = 1;
	message = "You have not completed all the required fields, please check:\n";
	formName = document.forms["account_signup"];
	//alert(formName.elements['signup_firstname'].value)
	if (formName.elements['signup_firstname'].value == "") {
		valid = 0;
		message += "First Name\n";
		getObj("signup_firstname").style.border = "#aa0000 solid 1px";
	} else {
		getObj("signup_firstname").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_lastname"].value == "") {
		valid = 0;
		message += "Last Name\n";
		getObj("signup_lastname").style.border = "#aa0000 solid 1px";
	} else {
		getObj("signup_lastname").style.border = "#A5ACB2 solid 1px";
	}

	if (checkEmail(formName.elements["signup_email"].value) == false) {
		valid = 0;
		message += "E-mail Address\n";
		getObj("signup_email").style.border = "#aa0000 solid 1px";
	} else {
		getObj("signup_email").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_password"].value == "") {
		valid = 0;
		message += "Password\n";
		getObj("signup_password").style.border = "#aa0000 solid 1px";
	} else {
		getObj("signup_password").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_password_confirm"].value == "") {
		valid = 0;
		message += "Password Confirmation\n";
		getObj("signup_password_confirm").style.border = "#aa0000 solid 1px";
	} else {
		getObj("signup_password_confirm").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_password_confirm"].value != formName.elements["signup_password"].value) {
		valid = 0;
		message += "Passwords do not Match\n";
	}

	if (valid == 0) {
		alert(message);
	} else {
		formName.submit();
	}
}
//------------------------------------------------- Account Details -------------------------------------------------------//

function arena_4_ecommerce_validaccsave() {
	valid = 1;
	message = "You have not completed all the required fields, please check:\n";
	formName = document.forms["update_accdetails"];
	//alert(formName.elements['signup_firstname'].value)
	if (formName.elements['signup_firstname'].value == "") {
		valid = 0;
		message += "First Name\n";
		getObj("signup_firstname").style.border = "#FF0000 solid 1px";
	} else {
		getObj("signup_firstname").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_lastname"].value == "") {
		valid = 0;
		message += "Last Name\n";
		getObj("signup_lastname").style.border = "#FF0000 solid 1px";
	} else {
		getObj("signup_lastname").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_email"].value == "") {
		valid = 0;
		message += "E-mail Address\n";
		getObj("signup_email").style.border = "#FF0000 solid 1px";
	} else {
		getObj("signup_email").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_password"].value == "") {
		valid = 0;
		message += "Password\n";
		getObj("signup_password").style.border = "#FF0000 solid 1px";
	} else {
		getObj("signup_password").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_password_confirm"].value == "") {
		valid = 0;
		message += "Password Confirmation\n";
		getObj("signup_password_confirm").style.border = "#FF0000 solid 1px";
	} else {
		getObj("signup_password_confirm").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements["signup_password_confirm"].value != formName.elements["signup_password"].value) {
		valid = 0;
		message += "Passwords do not Match\n";
	}

	if (valid == 0) {
		alert(message);
	} else {
		formName.submit();
	}
}


function arena_4_ecommerce_validaccaddress() {
	valid = 1;
	message = "You have not completed all the required fields, please check:\n";
	formName = document.forms["accountaddress_details"];

	if (TrimString(formName.elements['billing_address1'].value) == "") {
		valid = 0;
		message += "Line 1\n";
		getObj("billing_address1").style.border = "#FF0000 solid 1px";
	} else {
		getObj("billing_address1").style.border = "#A5ACB2 solid 1px";
	}

	//if (TrimString(formName.elements['billing_address2'].value) == "") {
	//valid = 0;
	//message += "Line 2\n";
	//getObj("billing_address2").style.border = "#FF0000 solid 1px";
	//} else {
	//	getObj("billing_address2").style.border = "#A5ACB2 solid 1px";
	//}

	//if (formName.elements['billing_address3'].value == "") {
	//	valid = 0;
	//	message += "Billing Line 3\n";
	//	getObj("billing_address3").style.border = "#FF0000 solid 1px";
	//} else {
	//	getObj("billing_address3").style.border = "#A5ACB2 solid 1px";
	//}

	if (TrimString(formName.elements['billing_postcode'].value) == "") {
		valid = 0;
		message += "Postcode\n";
		getObj("billing_postcode").style.border = "#FF0000 solid 1px";
	} else {
		getObj("billing_postcode").style.border = "#A5ACB2 solid 1px";
	}

	if (TrimString(formName.elements['billing_town'].value) == "") {
		valid = 0;
		message += "Town\n";
		getObj("billing_town").style.border = "#FF0000 solid 1px";
	} else {
		getObj("billing_town").style.border = "#A5ACB2 solid 1px";
	}

	if (TrimString(formName.elements['billing_country'].value) == "") {
		valid = 0;
		message += "Country\n";
		getObj("billing_country").style.color = "#FF0000";
	} else {
		getObj("billing_country").style.color = "#000000";
	}


	//if (formName.elements['day_telephone'].value == "") {
	//valid = 0;
	//message += "Daytime Telephone\n";
	//getObj("day_telephone").style.border = "#aa0000 solid 1px";
	//} else {
	//	getObj("day_telephone").style.border = "#A5ACB2 solid 1px";
	//}

	if (valid == 0) {
		alert(message);
	} else {
		formName.submit();
	}

}

function arena_4_ecommerce_validaccaddresssave() {
	valid = 1;
	message = "You have not completed all the required fields, please check:\n";
	formName = document.forms["accountaddress_details"];

	if (formName.elements['billing_address1'].value == "") {
		valid = 0;
		message += "Billing Line 1\n";
		getObj("billing_address1").style.border = "#aa0000 solid 1px";
	} else {
		getObj("billing_address1").style.border = "#A5ACB2 solid 1px";
	}

	//if (formName.elements['billing_address2'].value == "") {
	//	valid = 0;
	//	message += "Billing Line 2\n";
	//		getObj("billing_address2").style.border = "#aa0000 solid 1px";
	//} else {
	//	getObj("billing_address2").style.border = "#A5ACB2 solid 1px";
	//}

	//	if (formName.elements['billing_address3'].value == "") {
	//	valid = 0;
	//	message += "Billing Line 3\n";
	//	getObj("billing_address3").style.border = "#aa0000 solid 1px";
	//} else {
	//	getObj("billing_address3").style.border = "#A5ACB2 solid 1px";
	//}

	if (formName.elements['billing_postcode'].value == "") {
		valid = 0;
		message += "Billing Postcode\n";
		getObj("billing_postcode").style.border = "#aa0000 solid 1px";
	} else {
		getObj("billing_postcode").style.border = "#A5ACB2 solid 1px";
	}


	if (formName.elements['billing_town'].value == "") {
		valid = 0;
		message += "Billing Town\n";
		getObj("billing_town").style.border = "#aa0000 solid 1px";
	} else {
		getObj("billing_town").style.border = "#A5ACB2 solid 1px";
	}

	if (formName.elements['billing_country'].value == "") {
		valid = 0;
		message += "Billing Country\n";
		getObj("billing_country").style.color = "#aa0000";
	} else {
		getObj("billing_country").style.color = "#000000";
	}

	//if (formName.elements['day_telephone'].value == "") {
	//valid = 0;
	//	message += "Daytime Telephone\n";
	//	getObj("day_telephone").style.border = "#aa0000 solid 1px";
	//} else {
	//	getObj("day_telephone").style.border = "#A5ACB2 solid 1px";
	//}

	if (valid == 0) {
		alert(message);
	} else {
		formName.submit();
	}
}

function arena_4_ecommerce_validnoregsave() {
	bad = "#faa5a5";
	good = "#EBECED";
	valid = true;
	message = "You have not completed all the required fields, please check:\n";
	formName = document.forms["account_noreg"];

	element = "signup_firstname"
	elementmes = "First Name\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "signup_lastname"
	elementmes = "Last Name\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "signup_email"
	elementmes = "E-mail\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "billing_address1"
	elementmes = "Billing Line 1\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "billing_postcode"
	elementmes = "Billing Postcode\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "billing_country"
	elementmes = "Billing Country\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "shipping_name"
	elementmes = "Shipping Name\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "shipping_address1"
	elementmes = "Shipping Line 1\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "shipping_postcode"
	elementmes = "Shipping Postcode\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	element = "shipping_country"
	elementmes = "Shipping Country\n";
	if (formName.elements[element].value == "") {
		valid = false;
		message += elementmes;
		getObj(element).style.background = bad;
	} else {
		getObj(element).style.background = good;
	}
	if (!valid) {
		alert(message);
	}
	return valid;
}

//-----------------------------------------------------Checkout Postage functions -----------------------------------------//

function setzero_postage(line_id, cart_lines) {
	var postage_amount = document.forms["cartline" + line_id].item_postage_value.value;
	var delivery_type = document.forms["cartline" + line_id].products_deliver.value;
	var actual_postage = document.forms["cartline" + line_id].item_actual_postage_value.value;
	//alert(delivery_type)

	if (delivery_type == "1") {
		document.forms["cartline" + line_id].item_postage_value.value = actual_postage;
	} else {
		document.forms["cartline" + line_id].item_postage_value.value = "0.00";
		document.forms["cartline" + line_id].item_surcharge.value = "0.00";
	}
	var calcpostage = calculate_postage(cart_lines, 0);
}
//
function calculate_postage(cart_lines, zonepercent) {
	//
	var thispostage = 0.00;
	var lastpostage = 0.00;
	var maxpostage = 0.00;
	var surcharge = 0.00;
	var totalpostage = 0.00;
	var maxprodsurcharge = 0.00;
	for (var i = 1; i <= cart_lines; i++) {
		var thispostage = document.forms["cartline" + i].item_postage_value.value;
		var delivery_type = document.forms["cartline" + i].products_deliver.value;
		var surcharge = document.forms["cartline" + i].item_surcharge.value;
		var quantity = parseInt(document.forms["cartline" + i].products_Quantity.value);
		if (delivery_type == "1") {
			document.forms["cartline" + i].item_postage_value.value = document.forms["cartline" + i].item_actual_postage_value.value
		}
		//
		//alert(surcharge)
		if (thispostage > lastpostage) {
			maxpostage = thispostage;
			maxprodsurcharge = surcharge;
		}
		lastpostage = thispostage;
		if (surcharge != 0.00) {
			var surchargetotal = (surcharge * quantity) - surcharge;
			var totalpostage = parseFloat(surchargetotal) + parseFloat(maxpostage);
			//alert(surchargetotal)
		} else {
			var totalpostage = maxpostage
		}
	}

	document.forms["master_form"].order_delivery_cost.value = totalpostage;
	//alert(totalpostage)
}
//
//
function verify_deliveryoptions(cart_lines) {
	//
	var checkpostageset = calculate_postage(cart_lines, 0);
	//
	var overall_valid = "true";
	var valid = 0;
	var total_true = cart_lines;
	for (var i = 1; i <= cart_lines; i++) {
		var delivery_selected = document.forms["cartline" + i].products_deliver.value;
		//
		if (delivery_selected != "") {
			document.forms["cartline" + i].products_deliver.value = delivery_selected;
			document.forms["cartline" + i].products_deliver.style.color = "#000000";
			var valid = valid + 1;
		} else {
			var valid = valid + 0;
			document.forms["cartline" + i].products_deliver.style.color = "#aa0000";
		}

	}
	//alert(valid)
	if (valid != cart_lines) {
		alert("You have not declared all your delivery/collection options");
	} else {
		var max_postage = calculate_postage(cart_lines, 0);

		//getObj("delivery_cost_display").style.display = "block"
		var message = "Your total delivery charge is £" + document.forms["master_form"].order_delivery_cost.value + " If you wish to accept this and continue the checkout process please click OK, if you wish to alter your delivery/collection options please click Cancel"
		//alert(message)
		//
		if (document.forms["master_form"].order_delivery_cost.value == "0") {
			var message = "All items have been set to collection OR their is no delivery charge for your selected item(s). If you wish to accept this and continue the checkout process please click OK, if you wish to cancel this process please click Cancel"
		}
		//
		if (confirm(message)) {
			//
			var completecheck = complete_checkout(cart_lines);
		}
	}
}
//
//
function complete_checkout(cart_lines) {
	//
	var order_id = document.getElementById("order_id").value;
	var maximum_delivery = document.forms["master_form"].order_delivery_cost.value
	var offercode = document.forms["master_form"].order_offercodeID.value
	//
	if (maximum_delivery == "") {
		var maximum_delivery = 0.00
	}
	//
	var redirect = baseurl + "checkout_saveoptions.asp?offercode=" + offercode + "&orderid=" + order_id + "&maxdel=" + maximum_delivery
	//
	for (var i = 1; i <= cart_lines; i++) {
		//var delivery_selected = document.forms["cartline" + i].products_deliver.value;
		var delivery_selected = document.getElementById("products_deliver").value;
		//
		var redirect = redirect + "&l=" + i + "_" + delivery_selected
	}
	document.location.href = redirect
	//
}
var shippingName = "";
var shippingAddress1 = "";
var shippingAddress2 = "";
var shippingAddress3 = "";
var shippingPostcode = "";
var shippingTown = "";
var shippingCountry = "";

function saveVariables(form) {
	shippingAddress1 = form.shipping_address1.value;
	shippingAddress2 = form.shipping_address2.value;
	shippingAddress3 = form.shipping_address3.value;
	shippingPostcode = form.shipping_postcode.value;
	shippingTown = form.shipping_town.value;
	shippingCountry = form.shipping_country.value;
	shippingName = form.shipping_name.value;
	//
}

function BillToShipPerson(form) {
	if (form.copyAddress.checked) {
		saveVariables(form);
		form.shipping_address1.value = form.billing_address1.value;
		form.shipping_address2.value = form.billing_address2.value;
		form.shipping_address3.value = form.billing_address3.value;
		form.shipping_postcode.value = form.billing_postcode.value;
		form.shipping_town.value = form.billing_town.value;

		if (form.cust_billingname != null) {
			form.shipping_name.value = form.cust_billingname.value;
		}
		var shippingCountSel = select_item(form.shipping_country, form.billing_country.value);
	}
	else {
		form.shipping_address1.value = shippingAddress1;
		form.shipping_address2.value = shippingAddress2;
		form.shipping_address3.value = shippingAddress3;
		form.shipping_postcode.value = shippingPostcode;
		form.shipping_town.value = shippingTown;
		form.shipping_name.value = form.shipping_name.value;
		var shippingCountSel = select_item(form.shipping_country, shippingCountry);
	}
}
//
function select_item(selc, item) {
	for (x = 0; x < selc.options.length; x++) {
		if (selc.options[x].value == item) {
			selc.options[x].selected = true;
			return;
		}
	}
}
//
//---------------------------------------------------------- Various ------------------------------------------------------//

function enlarge_photo(photo_id, productname, catid) {
	var newurl1 = baseurl + "enlarge.asp?photo=" + photo_id + "&pname=" + productname + "&cid=" + catid;
	var photopage = window.open(newurl1, "Enlarged_Photo", "width=600,height=500,locationbar=0,menubar=0,personalbar=0,status=0,scrollbars=0,resizable=0");
}

function TrimString(sInString) {
	sInString = sInString.replace(/^\s+/g, ""); // strip leading
	return sInString.replace(/\s+$/g, ""); // strip trailing
}

function display_readmore(readmoreID) {
	var newurl1 = baseurl + "readmore.asp?rid=" + readmoreID;
	var testipage = window.open(newurl1, "Enlarged_Photo", "width=300,height=400,locationbar=0,menubar=0,personalbar=0,status=0,scrollbars=0,resizable=0");
}

//---------------------------------------- AJAX CODE --------------------------------------------------------//
function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	@else 
	xmlhttp = false; 
@end
	@*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}



var http = getHTTPObject(); // We create the HTTP Object 

function get_offer() {
	var callurl = baseurl + "arena_ecommerce_4_ajax_getoffer.asp";
	var offerCode = document.getElementById('offer_code').value;
	if (offerCode != "") {
		http.open("GET", callurl + "?offcode=" + escape(offerCode), true);
		http.onreadystatechange = Offer_HttpResponse;
		http.send(null);
	}
}

function Offer_HttpResponse() {
	if (http.readyState == 4) {
		//alert(http.responseText)
		results = http.responseText.split("###");
		var resultsNum = results.length;
		if (resultsNum > 0) {
			var offerID = results[0];
			var offerAmt = results[1];
			var offerText = results[2];
			var offerType = results[3];
			var amountWithoutPostage = $("#total_amount_without_postage").val();
			var order_delivery_cost = $("#order_delivery_cost").val();
			//
			if (offerID == "0") {
				alert(offerText)
				//$("#delivery_discountkey").html("Discount:");
				//$("#delivery_discount").html("&pound;0.00");
				$("#delivery_discountkey").html("");
				$("#delivery_discount").html("");
				new_total = (amountWithoutPostage / 100 * 100) + (order_delivery_cost / 100 * 100);
				var xxx = "&pound;" + new_total;
				$("#checkout_totalamount").html(xxx);
			} else {
				if (offerType == "Perc") {
					totalamount = $("#total_orderAmount").val();
					if (offerAmt > 0) {
						reductionAmount = (amountWithoutPostage / 100) * offerAmt;
						Discount_Amount = Math.round(reductionAmount * 100) / 100;
						$("#order_offercodereduction").val(Discount_Amount);
						$("#order_offercodeID").val(offerID);
						$("#delivery_discountkey").html("Discount  (" + offerAmt + "%):");
						$("#delivery_discount").html("&pound;" + Discount_Amount);
						//$("#delivery_discount_holder").css("display", "table-row");
						new_total = totalamount - Discount_Amount;
						new_final_total = Math.round(new_total * 100) / 100;
						if (new_final_total <= 0.00) {
							new_final_total = 0.00
						}
						var xxx = "&pound;" + Math.round(new_final_total * 100) / 100
						$("#checkout_totalamount").html(xxx);
					}
				} else {
					totalamount = $("#total_orderAmount").val();
					$("#order_offercodereduction").val(offerAmt);
					$("#order_offercodeID").val(offerID);
					$("#delivery_discountkey").html("Discount:");
					$("#delivery_discount").html("&pound;" + offerAmt);
					//$("#delivery_discount_holder").css("display", "table-row");
					new_total = totalamount - offerAmt;
					new_final_total = Math.round(new_total * 100) / 100;
					if (new_final_total <= 0.00) {
						new_final_total = 0.00
					}
					var xxx = "&pound;" + Math.round(new_final_total * 100) / 100
					$("#checkout_totalamount").html(xxx);
				}

			}
		}
	}
}


//
function save_checkoutmsg() {
	var callurlmsg = baseurl + "arena_ecommerce_4_ajax_checkoutsave.asp";
	var masterOrderID = document.forms['master_form'].masterOrderID.value;
	var customer_notes = $("#customer_notes").val();
	var customer_msg = $("#customer_msg").val();
	var str = "masterOrderID=" + masterOrderID + "&customer_notes=" + escape(customer_notes) + "&customer_msg=" + escape(customer_msg)
	if (masterOrderID != "") {
		http.open("POST", callurlmsg, true);
		http.onreadystatechange = Msg_HttpResponse;
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		http.send(str);
	}
}

function Msg_HttpResponse() {
	if (http.readyState == 4) {
		//alert(http.responseText)
	}
}


// on_document_ready
$(document).ready(function() {
	$('#main_navi ol li').hover(
        function() {
        	$(this).children("ol").show();
        },
        function() {
        	$(this).children("ol").hide();
        }
    );
});

function updatecartline(line_id, product_id) {
	var testquantity = document.forms["cartline" + line_id].products_Quantity.value // hmmm
	var testurl = "/arena_ecommerce_4_cart_LineAmend.asp?lineID=" + line_id + "&new_quantity=" + escape(testquantity) + "&productid=" + product_id
	document.location.href = testurl
}

function remove_cartline(line_id, product_id) {
	var testurl = "/arena_ecommerce_4_cart_LineAmend.asp?lineID=" + line_id + "&new_quantity=0&productid=" + product_id
	document.location.href = testurl
}
