<!--
	BASKET_EXPIRE_DAYS = 3;

	function product(productInfo) {
		arrayOfElements = productInfo.split("|");
		this.productID = arrayOfElements[0]
		this.quantity = arrayOfElements[1]
		this.image = arrayOfElements[2]
		this.name = arrayOfElements[3]
		this.elements = arrayOfElements[4]
		this.price = arrayOfElements[5]
		this.displayProduct	= displayProduct
	}

	function displayProduct () {	
		var elSep = "|";
		var prdEnd = ":";
		var result = this.productID + elSep 
			       + this.quantity + elSep 
			       + this.image + elSep 
			       + this.name + elSep 
			       + this.elements + elSep 
			       + this.price + prdEnd;
		return result;
	}

	function changeProductQuantity(NameOfCookie, productID, elements, quantity) {
		basket = getCookie(NameOfCookie);
		if (basket != null && quantity != 0) {
			arrayOfProducts = basket.split(":");
			for (var i=0; i < arrayOfProducts.length-1; i++) {
				currentProduct = new product(arrayOfProducts[i]);
				if (currentProduct.productID == productID && currentProduct.elements == elements) {
					oldProduct = new product(currentProduct.displayProduct().replace(":", ""));
					currentProduct.quantity = quantity;
					newProduct = currentProduct;
					value = basket.replace(oldProduct.displayProduct(), newProduct.displayProduct());
					var ExpireDate = new Date ();
					ExpireDate.setTime(ExpireDate.getTime() + (BASKET_EXPIRE_DAYS * 24 * 3600 * 1000));
					document.cookie = NameOfCookie + "=" + escape(value) + "; expires=" + ExpireDate.toGMTString();
					return;
				}
			}
		}
	}

	function setCookie(NameOfCookie, value, expiredays) { 
		basket = getCookie(NameOfCookie);
		if (basket != null) {
			newProduct = new product(value);
			replaced = new Boolean(false);
			arrayOfProducts = basket.split(":");
			for (var i=0; i < arrayOfProducts.length-1; i++) {
				currentProduct = new product(arrayOfProducts[i]);
				if (newProduct.productID == currentProduct.productID && newProduct.elements == currentProduct.elements) {
					oldProduct = new product(currentProduct.displayProduct().replace(":", ""));
					++currentProduct.quantity;
					newProduct = currentProduct;
					basket = basket.replace(oldProduct.displayProduct(), newProduct.displayProduct());
					replaced = true;
					break;
				}
			}
			if (replaced == false) {
				basket = basket.concat(value);
			}
			value = basket;
		}
		var ExpireDate = new Date ();
		ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
		document.cookie = NameOfCookie + "=" + escape(value) + 
		((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
	}

	function getCookie(NameOfCookie) { 
		if (document.cookie.length > 0) { 
			begin = document.cookie.indexOf(NameOfCookie+"="); 
			if (begin != -1) { 
				begin += NameOfCookie.length+1; 
				end = document.cookie.indexOf(";", begin);
				if (end == -1) {
					end = document.cookie.length;
				}
				return unescape(document.cookie.substring(begin, end)); 
			} 
		}
		return null; 
	}
	
	function removeProduct(NameOfCookie, productID, elements) {
		basket = getCookie(NameOfCookie);
		if (basket != null) {
			arrayOfProducts = basket.split(":");
			basket = "";
			if (arrayOfProducts.length == 1) {
				delCookie(NameOfCookie);
			}
			else {
				for (var i=0; i < arrayOfProducts.length-1; i++) {
					currentProduct = new product(arrayOfProducts[i]);
					if (currentProduct.productID != productID || (currentProduct.productID == productID && currentProduct.elements != elements)){
						basket = basket.concat(currentProduct.displayProduct());
					}
				}
				delCookie(NameOfCookie);
				setCookie(NameOfCookie, basket, BASKET_EXPIRE_DAYS);
			}
		}
	}

	function delCookie (NameOfCookie) { 
		if (getCookie(NameOfCookie)) {
			document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}
		function validateQuantity(objQuantity, el) {	
		if (isNaN(objQuantity.value)) {
			objQuantity.value = 1;
		}
		else {
			if (objQuantity.value < 1 ) {
				objQuantity.value = 1;
			}
			else {
				changeProductQuantity('DinoBasket', objQuantity.name, el, objQuantity.value);
			}
		}
	}
	
	// -->