// immediate for no-login redirects
if (!document.location.href.match(/newreg2?\.(pl|shtml)/)) {
  setCookie('rp',document.location.href);

  if (typeof(checkuser) != 'undefined') {
    var user = { login:getCookie('l'),epw:getCookie('p') };
    if ((!user.login) || (!user.epw)) {
      document.location.href = '/newreg.shtml';
    }
    else { usercheck(checkuser); }
  }
}

$(function() {
  if ($('#abloginstatus').length) { loggedinmsg(); }
  $('#footercontainer div h4').bind('mouseover',function() { moo(this); }).bind('dblclick',function() { document.location.href = '/mooadmin.html'; });

  $('#subscribedlinks').bind('click',function() {
    tb_show('','/subscribed_links.shtml?TB_iframe=true&width=600&height=365');
    return(false);
  });

  var pages = getCookie('gsl');
  if (pages) {
    if ((pages >= 0) && (pages < 4)) { setCookie('gsl',parseFloat(pages)+1); }
    else if (pages == 4) {
      if (typeof(tb_show) == 'function') {
        tb_show('','/subscribed_links.shtml?TB_iframe=true&width=600&height=365');
      }
      setCookie('gsl',-1,1095);
    }
  }
  else { setCookie('gsl',0); }
});
