var cookies=document.cookie;  //read in all cookies
var start = cookies.indexOf("ss_cart_0001238361="); 
var cartvalues = "";
var linecount = 0;
var start1;
var end1;
var tmp;
// Start Output
document.write('<table width="800" height="100" class="header"><tr>');

document.write('<td class="header" width="300"><img src="http://www.your-door-knocker.com/image-files/banners/header100x300.gif" height="100" width="300" alt="your door knocker header banner" border="0"></td>' );

document.write('<td class="header"></td>');

document.write('<td class="header" width="400" cellpadding="0" cellspacing="0"><img src="http://www.your-door-knocker.com/image-files/banners/wilma.gif" height="100" width="100" alt="Wilma Door Knocker"><img src="http://www.your-door-knocker.com/image-files/banners/sale-2.jpg" height="100" width="275" alt="sale banner"></td>' );

//document.write('<td class="header" width="400"><img src="http://www.your-door-knocker.com/image-files/banners/sale.jpg"></td>' );
document.write('<td class="header">' );
// minicart cell
document.write('<td class="header" width="100">' );
document.write("<div style=\"color: 663300;");
document.write("background-color: transparent;");
document.write("text-align: center;");
document.write("font-family: Verdana, Arial, Helvetica, sans-serif;");
document.write("font-size: 8pt;");
document.write("\">\n");

  document.write("<a href=\"http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?storeid=*1eb6bb7c970a2b451661c5b69f9ff4be91&function=show\""); 
  document.write("style=\"text-decoration: underline; font-size: 10px; a:hover;text-decoration: underline; color:#000000");
  document.write("color: 663300;");
  document.write("\">");
  document.write("View Cart");
  document.write("<br>");
  document.write("<img src=\"http://www.your-door-knocker.com/store/media/themesmedia/cart-black.gif\" border=\"0\" name=\"cart\" align=\"top\"><br>");
  document.write("</a> ");

if (start == -1)  //No cart cookie
{
  document.write("<a href=\"http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?storeid=*1eb6bb7c970a2b451661c5b69f9ff4be91&function=show\"");
  document.write("style=\"text-decoration: underline; font-size: 10px; a:hover;text-decoration: underline; color:#000000");
  document.write("color: 663300;");
  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.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?storeid=*1eb6bb7c970a2b451661c5b69f9ff4be91&function=show\"");
        document.write("style=\"text-decoration: underline;");
        document.write("color: 663300;");
        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("</a>");
      }

      start = end;
    }
    else
      break;
    }
  } // end while loop

  //close minicart HTML
  
 // document.write("</div>\n");
  
  //start registration
  function DisplayLogName(name) {
  var cookies=document.cookie;
  var start = cookies.indexOf(name + "=");
  var name = "";
  var start1;
  var end1;
  var tmp;
  var signed_in = -1;

  if (start != -1) {
    start = cookies.indexOf("=", start) +1;
    var end = cookies.indexOf("|", start);
    if (end != -1) {
      signed_in = cookies.indexOf("|yes", start);
      name = unescape(cookies.substring(start,end-1));
      document.write("<font size='-2'>" + name + "</font>");
      if (signed_in != -1) {
        document.write("<br>");
        document.write("<a href=\"http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?func=3&storeid=*16b4fe79b71ed0641676b95f08&html_reg=html\" class=\"navbar3\">View/Edit Account</a>");
        document.write("<br>");
        document.write("<a href=\"http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?func=4&storeid=*16b4fe79b71ed0641676b95f08&html_reg=html\" class=\"navbar3\">Sign Out</a>");
        document.write("<br>");
      }
      else
      {
        document.write("<br>");
        document.write("signed out<br>");
      }
    }
  }
  if (signed_in == -1) {
//    document.write("<a href=\"http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?func=1&storeid=*16b4fe79b71ed0641676b95f08&html_reg=html\">Register</a>");
    document.write("<center>");
    document.write("<a href=\"http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?func=2&storeid=*16b4fe79b71ed0641676b95f08&html_reg=html\" class=\"navbar3\">Welcome");
    document.write("<br>");
    document.write("Guest</a>");
    document.write("</center>");
    document.write("<br>");
  }
}
DisplayLogName("ss_reg_0001238361");
document.write("</div>\n");
// end minicart cell

document.write('<td>' );
document.write('</tr></table>');

//document.write('<table width="800" class="outer" cellspacing="3"><tr>');

//document.write('<td class="navbar3" width="15%"><a href="http://www.your-door-knocker.com/index.html" class="navbar3">Home</a></td>');

//document.write('<td class="navbar3" width="17%"><a href="http://www.your-door-knocker.com/engraved-door-knocker.html" class="navbar3">Door<br>Knockers</a></td>');

//document.write('<td class="navbar3" width="17%"><a href="http://www.your-door-knocker.com/door-kick-plate.html" class="navbar3">Kick<br>Plates</a></td>');

//document.write('<td  class="navbar3" width="17%"><a href="http://www.your-door-knocker.com/store/Numbers.html" class="navbar3">Numbers<br>Letters</a></td>');

//document.write('<td class="navbar3" width="17%"><a href="http://www.your-door-knocker.com/store/door-eye-viewer.html" class="navbar3">Eye<br>Viewers</a></td>');

//document.write('<td class="navbar3" width="17%"><a href="http://www.your-door-knocker.com/cgi-your-door-knocker/sb/order.cgi?storeid=*20ef7b54650e144348f619eb687b99ffb6af&cert=gift" class="navbar3">Gift<br>Certificates</a></td>');

//document.write('</tr></table>');
