// ---------------------------------------------------------------------
// Common functions, and common code to run on every  page.
// ---------------------------------------------------------------------

/*@cc_on @*/     // Turn on conditional comments for IE.

// ---------------------------------------------------------------------
// Cookies
// ---------------------------------------------------------------------

function getCookie(name) {
  var start = document.cookie.indexOf(name + "=");
  var len = start + name.length + 1;
  if ((!start) && (name != document.cookie.substring(0, name.length))) return null;
  if (start == -1) return null;
  var end = document.cookie.indexOf( ";", len );
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len, end));
}  


// ---------------------------------------------------------------------
// Popup Windows
// ---------------------------------------------------------------------

function popupWindow (name, url, w, h, l, t, statusbar) {
    var opts = "scrollbars,resizable";
    if (statusbar) opts += ",status";
    opts += ",width=" + w + ",height=" + h;
    opts += ",left=" + l + ",top=" + t;
    
    var popup = window.open(url, name, opts);
    popup.focus();
    return false;
};


// ---------------------------------------------------------------------
// Update Checkboxes
// ---------------------------------------------------------------------

function updateCheckboxes(formName,status) {
  if (status == 0) {
    for (i=1; i<document.f[formName].length; i++) {
      document.f[formName][i].checked=false;
    }
  } else {
    document.f[formName][0].checked=false;
  }
}





