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>');
  }
}


// quickpoll
function makeResultsWindow() {
  window.open("", "QuickPoll_results", "directories=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0,width=550,height=400");
  document.QuickPoll.js.value = "no";
  document.QuickPoll.target = "QuickPoll_results";
  return true;
}

// 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);

