

var cookies=document.cookie;  //read in all cookies

var start = cookies.indexOf("ss_cart_0004002675="); 

var cartvalues = "";

var linecount = 0;

var start1;

var end1;

var tmp;



// Start Output

document.write("<div style=\"color: #CCFFCC;");

document.write("background-color: transparent;");

document.write("text-align: right;");

document.write("font-family: Arial, Helvetica, sans-serif;");

document.write("font-size: 10pt;");

document.write("\">\n");




  document.write("<a href=\"http://www.marquel.com/cgi/sc/order.cgi?storeid=*1a176041d0aac80810816b1f58aab4&function=show\""); 

  document.write("style=\"text-decoration: underline;");

  document.write("color: #CCFFCC;");

  document.write("\">");

  document.write("<img src=\"http://www.marquel.com/store/media/themesmedia/cart-white.gif\" border=\"0\" name=\"cart\" align=\"top\">");

  document.write("</a> ");




if (start == -1)  //No cart cookie

{

  document.write("<a href=\"http://www.marquel.com/cgi/sc/order.cgi?storeid=*1a176041d0aac80810816b1f58aab4&function=show\"");

  document.write("style=\"text-decoration: underline;");

  document.write("color: #CCFFCC;");

  document.write("\">");

  document.write("0 Items");

  document.write("</a> ");

  document.write("</div>\n");

}

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=\"http://www.marquel.com/cgi/sc/order.cgi?storeid=*1a176041d0aac80810816b1f58aab4&function=show\"");

        document.write("style=\"text-decoration: underline;");

        document.write("color: #CCFFCC;");

        document.write("\">");

        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(": ");

      }



      if (linecount == 3)  // Product Subtotal

      {

        tmp = cartvalues.substring(start,end);

        colon = tmp.indexOf(":", 0);

        document.write(tmp.substring(colon+1,end - start));

        document.write("</a>");

      }



      start = end;

    }

    else

      break;

    }

  } // end while loop



  //close minicart HTML

  document.write("</div>\n");


