var className;  // Defined in classhomepage.html
var baseURL;    // Defined in classhomepage.html
var title;      // Defined in classhomepage.html
var edu_window;

function doAssignment(tn) {
  var f = document.edu_form;
  if (edu_window == null || edu_window.closed) {
    var url = getBaseURL() + "modules/test.Test?className=" + className + "&testName=" + myEscape(tn);
    edu_window = window.open(url, "assignment_window", "scrollbars,resizable");
    edu_window.focus();
  } else {
    alert("You are currently either taking an assignment, or you\r\n" +
          "have another browser window open to the class homepage.\r\n\r\n" +
          "Please finish the assignment and/or close the other browser before\r\n" +
          "attempting another assignment.");
          edu_window.focus();
  }
}

function showAssignmentPolicies(tn) {
  var url = getBaseURL() + "modules/test.ShowPolicies?className=" + className + "&testName=" + myEscape(tn);
  window.open(url, "show_policies_window","width=400,height=300,scrollbars,resizable").focus();
}

function bookmarkText() {
  var d = document;
  if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4.0) {
    var url = window.location;
    d.write("<a href='javascript:window.external.AddFavorite(\"" + url + "\", \"" + escape(title) + "\");'>");
    d.write("<b>Please add this page to your Favorites,</b></a>");
  } else {
    d.write("<b>Please bookmark this page,</b>");
  }
}