function Subscribe() {
  root = "/home/content/s/a/c/sace1/html/";
  document.location =
    root + "subscribe.php?email=" + GetCookie("passport") + "&subscribe=" + (1-loginSubscribe) +
                  "&retaddr=" + document.location;
}

function Join() {
  var location =  joinpage + "?email=" + escape(document.subscribeform.email.value) +
                             "&subscribe=1&retaddr=" + escape(document.location);
//alert(location);
  document.location = location;
}

function DoIt() {
  if (GetCookie("passport") != "") {
    Subscribe();
  } else {
    Join();
  }
}

function DoButton() {
  document.write('<button class="Button" name="search">');
  document.write('  <span class="btn">');
  document.write('    <span class="l"></span>');
  document.write('    <span class="r"></span>');
  document.write('    <span class="t">Subscribe</span>');
  document.write('  </span>');
  document.write('</button>');
}

document.write("<form name='subscribeform' action='javascript:DoIt();'>");
if (GetCookie("passport") != "") {
  if (loginSubscribe != "1") {
    document.write("Welcome " + loginName + ". Know when this portal gets changed,  Press Subscribe and we'll keep you updated.<br><br>");
    document.write("<input name='email' type='hidden' value='" + GetCookie("passport") + "'>");
    DoButton();
  } else {
    document.write("Welcome " + loginName + ".  We will keep you updated whenever this portal is changed.<br><br>");
  }
} else {
  document.write("Know when this portal gets changed.  Submit your email and we'll keep you updated.<br><br>");
  document.write("<input type='text' value='' name='email' id='s' style='width: 95%;' />");
  document.write("<input name='subscribe' type='hidden' value='1'>");
  DoButton();
}
document.write("<input name='retaddr' type='hidden' value='" + document.location + "'>");
document.write("</form>");

