		function format_sel(how) {
			var oTag	= "<" + how + ">";
			var cTag	= "</" + how + ">";
			
			var str		= document.selection.createRange().text;
					  document.my_form.content.focus();
			var sel		= document.selection.createRange();
			sel.text	= oTag + str + cTag;
			return;
		}
		function insert_link(how) {
			var str		= document.selection.createRange().text;

				document.my_form.content.focus();
				var my_link	= (how == "link") ? prompt("Enter URL:","http://") : prompt("Email Address:","");
				if (my_link != null) {
    					var sel		= document.selection.createRange();
    					if (how == "link") {
						sel.text	= "<a href='" + my_link + "' target='NEW'>" + str + "</a>";
					}
					else {
						sel.text	= "<a href='mailto:" + my_link + "'>" + str + "</a>";
					}
				}
				return;
		}
		
		function mouseover(el)	{ el.className = "raised"; }
		function mouseout(el)	{ el.className = "butto";  }
		function mousedown(el)	{ el.className = "pressed";}
		function mouseup(el)	{ el.className = "raised"; }
		
		function setCookie(c_name,value,expiredays)
		{
			var exdate	= new Date();
			exdate.setDate(exdate.getDate()+expiredays);
			document.cookie	= c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		}
		
		function getCookie(c_name)
		{
			if (document.cookie.length > 0)
  			{
  				c_start = document.cookie.indexOf(c_name + "=")
  				if (c_start!=-1)
    				{ 
		   	 		c_start	= c_start + c_name.length + 1;
		    			c_end	= document.cookie.indexOf(";",c_start);
		    			if (c_end==-1)
		    			{
		    				c_end	= document.cookie.length;
		    			}
		    			return unescape(document.cookie.substring(c_start,c_end));
		    		} 
		  	}
			return "";
		}
		
		function checkCookie(name)
		{
			myCookie = getCookie(name)
			if (myCookie != null && myCookie != "")
  			{
  				return true;
  			}
			else 
			{
				return false;
  			}
		}
		
		function deleteCookie(name)
		{
			var expDate = new Date();
			expDate.setTime(expDate.getTime() - 1);
			
			setCookie(name,"",expDate.toGMTString());
		}
		
		function updateQuantity(qty,itmNum,origPrice)
		{
		    qtyItm      = "qtyItem" + itmNum;
			priceItm	= "priceItem" + itmNum;

			curPrice    = origPrice;        // Get current price
			newPrice    = curPrice * qty;   // Calcualte new price
			
			// SET NEW VALUE
			setCookie(qtyItm,qty);
			setCookie(priceItm,newPrice);
			
			window.location = '/cgi-bin/cart.cgi';
		}
		
		function updateSize(size,itmNum)
		{
		    sizeItm     = "sizeItem" + itmNum;
			
			// SET NEW VALUE
			setCookie(sizeItm,size);
			
			window.location = '/cgi-bin/cart.cgi';
		}
		
		function deleteAllCookies()
		{
			var totItems	= getCookie("totItems");
			
			for (i = 1; i <= totItems; i++)
			{
				qtyItm	    = "qtyItem" + i;
				priceItm	= "priceItem" + i;
				idItm		= "idItem" + i;
				titleItm	= "titleItem" + i
				origPrice	= "origPrice" + i;
				sizeItm 	= "sizeItem" + i;

				deleteCookie(qtyItm);
				deleteCookie(priceItm);
				deleteCookie(idItm);
				deleteCookie(titleItm);
				deleteCookie(origPrice);
				deleteCookie(sizeItm);
			}
			setCookie("totItems",0,1);
			
			window.location	= "/cgi-bin/cart.cgi";
		}
		
		function deleteOneItem(itmNum)
		{
			var totItems	= getCookie("totItems");
			
			for (i = 1; i <= totItems; i++)
			{			    
				if (itmNum == i)
				{
				    qtyItm      = "qtyItem" + itmNum;
					priceItm	= "priceItem" + itmNum;
					idItm		= "idItem" + itmNum;
					titleItm	= "titleItem" + itmNum;
					origPrice	= "origPrice" + itmNum;
					sizeItm     = "sizeItem" + itmNum;
					
					deleteCookie(qtyItm);
					deleteCookie(priceItm);
					deleteCookie(idItm);
					deleteCookie(titleItm);
					deleteCookie(origPrice);
					deleteCookie(sizeItm);
				}
				
				if (i > itmNum)
				{
					var newNum	= i-1;

					// GET CURRENT VALUES
					var qty 	= getCookie("qtyItem" + i);
					var price	= getCookie("priceItem" + i);
					var id		= getCookie("idItem" + i);
					var title	= getCookie("titleItem" + i);
					var orig	= getCookie("origPrice" + i);
					var size	= getCookie("sizeItem" + i);

					qtyItm	    = "qtyItem" + newNum;
					priceItm	= "priceItem" + newNum;
					idItm		= "idItem" + newNum;
					titleItm	= "titleItem" + newNum;
					origItm    	= "origPrice" + newNum;
					sizeItm     = "sizeItem" + newNum;

					// SET NEW VALUE
					setCookie(qtyItm,qty);
					setCookie(priceItm,price);
					setCookie(idItm,id);
					setCookie(titleItm,title);
					setCookie(origItm,orig);
					setCookie(sizeItm,size);

					// DELETE OLD VALUE
					deleteCookie("qtyItem" + i);
					deleteCookie("priceItem" + i);
					deleteCookie("idItem" + i);
					deleteCookie("titleItem" + i);
					deleteCookie("origPrice" + i);
					deleteCookie("sizeItem" + i);
				}
			}

			totItems	= totItems - 1;
			setCookie("totItems",totItems,1);
			
			window.location	= "/cgi-bin/cart.cgi";
		}


		// CREATE SESSION
		if (checkCookie("sessionID") == false)
		{
			var myDate	= new Date();
			sessionIDVal	= Math.random() + myDate;
			setCookie("sessionID",sessionIDVal,1)
		}
		
		// CREATE CART
		if (checkCookie("myCart") == false)
		{
			var myCart	= "MyCart" + getCookie("sessionID");
			setCookie("myCart",myCart,1);
			
			// Initalize items in cart
			setCookie("totItems",0,1);
		}