// JavaScript Document

/*

Examples of Parameters

name: ss_reg_0001238150
url: www.rogersystems.com
storeid: *1e16c9d69d1632733aa1d5a65e9f25b5fd

Instructions:

1. Include this file within your shopsite template in the head of the document (ex: <script src="[Path to Javascript]/display_info.js" type="text/javascript"></script>
2. Call the function where you need it on the page 
   (ex: <script type="text/javascript">DisplayRegInfo("ss_reg_0001238150", "www.rogersystems.com", "*1e16c9d69d1632733aa1d5a65e9f25b5fd");</script>
*/


function DisplayRegInfo(name, url, storeid) {
  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);
     if (signed_in != -1) {
        document.write("<div class=\"hr4\"><ul><li><a href=\"http://" + url + "/shop-bin/sc/order.cgi?storeid=" + storeid + "&function=show\">View Cart</a></li><li><a href=\"http://" + url + "/shop-bin/sc/order.cgi?func=3&amp;storeid=" + storeid + "&amp;html_reg=html\">My Account</a></li><li><a href=\"http://" + url + "/shop-bin/sc/order.cgi?func=4&amp;storeid=" + storeid + "&amp;html_reg=html\">Logout</a><\li></ul><\/div>");
      }
    }
  }
  if (signed_in == -1) {
    document.write("<div class=\"hr4\"><ul><li><a href=\"http://" + url + "/shop-bin/sc/order.cgi?storeid=" + storeid + "&function=show\">View Cart</a></li><li><a href=\"https://" + url + "/shop-bin/sc/registration.cgi?func=1&amp;storeid=" + storeid + "&sbid=SSMSB1230661496.1215\">New Customer</a></li><li><a href=\"https://" + url + "/shop-bin/sc/registration.cgi?func=2&amp;storeid=" + storeid + "&sbid=SSMSB1230661496.1215\">Account Login</a></li></ul><\/div>");
  }
}