// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  //alert(dc);
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// code to display the member login form
var BaseURL; BaseURL = "http://www.performancesignal.com/";

// gather cookie info
var email, password, rememberme; email = ""; password = ""; rememberme = "/";
if (getCookie('email') != null) {
  email = getCookie('email');
  password = getCookie('passwd');
  rememberme = "checked";
}

document.write ('<form name="memberlogin" id="memberlogin" method="post" action="' + BaseURL + 'client/member.asp">');
document.write ('<p>Type your User Name<br><input type="text" name="email" value="' + email + '" /><br/>');
document.write ('Type your Password<br><input type="password" name="password" value="' + password + '" /></p>');
document.write ('<p><input type="submit" name="submit" value="Login Now" class="bluebutton"/></p>');
document.write ('<p><input type="checkbox" name="rememberme" ' + rememberme + '>Log me in automatically<br>');
document.write ('<a href="client/request_login.asp">I forgot my password.</a><br>');
document.write ('<a href="subscribe.html">Not a registered member?</a></p>');
document.write ('</form>');


