	function strip(str){
		if (str==null) return str;
		if (str.length==0) return '';
		while (str.length>0 && str.charAt(0)==' '){
			str=str.substring(1);
		}
		while (str.length>0 && str.charAt(str.length-1)==' '){
			str=str.substring(0,str.length-1);
		}
		return str;
	}

	function getCookies(){
		var carray=document.cookie.split(";");
		_cookiedict=new Array();
		for (var i=0;i<carray.length;i++){
			var tuple=carray[i].split("=");
			_cookiedict[strip(tuple[0])]=strip(tuple[1]);
		}
		return _cookiedict;
	}

	function EnableCheckout(comp){
		var c=getCookies();
		if (c['itemcount'] && c['itemcount'] >0 ){
			comp.disabled=false;
		} else {
			comp.disabled=true;
		}
	}

	function WriteItemCount(){
		var c=getCookies();
		document.write("<DIV CLASS='cartbox'>");
		if (c['itemcount'] && c['itemcount'] >0 ){
			if (c['itemcount']==1) document.write("1 item in cart.");
			else document.write(c['itemcount'].toString()+" items in cart.");
		} else {
			document.write("No items in cart.");
		}
		document.write("</DIV>");
	}
	
