function acceptInt(e) {
  var key;
  if (window.event) {key = window.event.keyCode} else if (e) {key = e.which} else {return true}
  if ((key < 48 || key > 57) && key != 0 && key != 8 && key != 13) {return false} else {return true}
}

function getCookie(cookieName) {
  var cookieStr = "" + document.cookie;
  var index1 = cookieStr.indexOf(cookieName);
  if (index1 == -1 || !cookieName) {
    return "";
  }
  var index2 = cookieStr.indexOf(";", index1);
  if (index2 == -1) {
    index2 = cookieStr.length;
  }
  return(unescape(cookieStr.substring(index1 + cookieName.length + 1, index2)));
}

function popup(url, name, w, h, features, warning) {
  if (url) {
    var win_features = "";
    if (w) { win_features += "width=" + w; }
    if (h) {
      if (win_features) { win_features += ","; }
      win_features += "height=" + h;
    }
    if (features) {
      if (win_features) { win_features += ","; }
      win_features += features;
    }
    window.open(url, name, win_features);
  } else {
    if (warning) {
      alert(warning);
    }
  }
}

function bookmarkLink() {
  if (document.all) {
    document.write('<A CLASS="function bookmark" HREF="#" onClick="window.external.AddFavorite(location.href, document.title)">bookmark page</A>');
  }
}

// navigation
sfHover = function() {
  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    }
  }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
