function showCart(){

var cookies=document.cookie;  //read in all cookies
var start = cookies.indexOf("ss_cart_" + serialNumber + "="); 
var cartvalues = "";
var linecount = 0;
var start1;
var end1;
var tmp;

if (start == -1)  //No cart cookie
{
  document.write("<a id=\"items\" href=\"" + baseCgiUrl + "/order.cgi?storeid=" + storeId + "&function=show" + "\"><span>0 Items</span><\/a>");
  //document.write("<span id=\"price\">$00.00<\/span>");
}
else   //cart cookie is present
{
  start = cookies.indexOf("=", start) +1;  
  var end = cookies.indexOf(";", start);  

  if (end == -1)
  {
    end = cookies.length;
  }

  cartvalues = unescape(cookies.substring(start,end)); //read in just the cookie data

  start = 0;
  while ((start = cartvalues.indexOf("|", start)) != -1)
  {
    start++;
    end = cartvalues.indexOf("|", start);
    if (end != -1)
    {
      linecount++;

      if (linecount == 2) // Total Quantity of Items
      {
        tmp = cartvalues.substring(start,end);
        colon = tmp.indexOf(":", 0);
         document.write("<a href=\"" + baseCgiUrl + "/order.cgi?storeid=" + storeId + "&function=show" + "\" id=\"items\"><span>");
        document.write(tmp.substring(colon+1,end - start));
        if ((tmp.substring(colon+1,end - start)) == 1 )
        {
          document.write(" Item");
        }
        else
        {
          document.write(" Items");
        }
        document.write("<\/span><\/a>")
      }
     

      if (linecount == 3)  // Product Subtotal
      {
        tmp = cartvalues.substring(start,end);
        colon = tmp.indexOf(":", 0);
        //document.write("<span id=\"price\">");
        //document.write(tmp.substring(colon+1,end - start));
        //document.write("<\/span>");
      }

      start = end;
    }
    else
      break;
    }
  } // end while loop

  //close minicart HTML
}
/* end showCart() */


function openTopMenu(liObj){
	$(liObj).addClassName("over")
}
function closeTopMenu(liObj){
	$(liObj).removeClassName("over")
}

var currentMenu = null;
function openMenu(obj){
	if(currentMenu == $(obj).up().select("ul")[0]){
		return;
	}
	if(currentMenu){
		currentMenu.slideUp({duration: 0.3})
	}
	currentMenu = $(obj).up().select("ul")[0];
	//currentMenu.setStyle({display: "block"})	
	currentMenu.slideDown({duration: 0.3});
}
function applyImageAligments(obj, verticalAligment){
	var img = $(obj);
	var left = (159 - img.getWidth())/2;
	img.setStyle({left: "" + left + "px"});
	if(verticalAligment == "bottom"){
		img.setStyle({bottom: 0});
	}else if(verticalAligment == "middle"){
		var top = (112 - img.getHeight())/2;
		img.setStyle({top: "" + top + "px"})
	}
}