  _editor_url = "js/htmlarea";
  _editor_lang = "en";
var agt = navigator.userAgent.toLowerCase();
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_opera  = (agt.indexOf("opera") != -1);
var is_mac    = (agt.indexOf("mac") != -1);
var is_mac_ie = (is_ie && is_mac);
var is_win_ie = (is_ie && !is_mac);
var is_gecko  = (navigator.product == "Gecko");
function openPopup (message, event) {
//  return overlib(message);
}
function openPopupAbove (message) {
//  return overlib(message, ABOVE);
}
function closePopup () {
//  nd();
//  nd();
}
function silentErrorHandler() {
  return true;
}
 window.onError = silentErrorHandler();
var activeItem = "";
var treeopened = 1;
function opentree(tree) {
  var cls = '';
  if (document.getElementById) {
    var el = document.getElementById (tree);
    if (el && el.className) {
      el.className = (el.className == 'navOpened') ? 'navClosed' : 'navOpened';
    }
  }
  return false;
}
function setActiveNode(id) {
	if (activeItem == id) {
		return false;
	}
	if (activeItem != '' ) {
		var cur = document.getElementById(activeItem);
		cur.className = 'node';
	}
	activeItem = id;
	var el = document.getElementById(id);
	el.className='nodeActive';
	return false;
}
function openScreen (id, url) {
	setActiveNode(id);
	top.mainFrame.workFrame.location.href = url;
	return false;
}
function mover (o) {
	o.className = 'navTitleOver';
}
function mout (o) {
	o.className = 'navTitle';
}
function hideBlock (block_id) {
  document.getElementById(block_id).style.visibility = 'hidden';
  document.getElementById(block_id).style.display    = 'none';
}
function showBlock (block_id) {
  document.getElementById(block_id).style.visibility = 'visible';
  document.getElementById(block_id).style.display    = 'block';
}
function showHideBlock (id) {
  var block = document.getElementById (id);
  if (block.style.display == 'none') {
    block.style.display = 'block';
  } else {
    block.style.display = 'none';
  }
}
function NewWindow(mypage, myname, w, h, is_modal) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  if (winName != undefined) { 
    winName++ ;
  } else {
    var winName = 0; 
  }
  if (is_modal == true && is_ie) {
    var opts1 = "dialogHeight:30";
    var opts2 = "dialogWidth:30";
    var o = new Object();
    o.var1 = opts1;
    o.var2 = opts2;
    o.opener = self;
    var vRetVal = window.showModalDialog(mypage, o);
//    winprops = 'dialogHeight:25;dialogWidth:20;edge:Raised;center:Yes;help:No;resizable:No;status:No;';
//    winName = window.showModalDialog (mypage, myname, winprops)
  } else {
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars=yes'
    winName = window.open(mypage, myname, winprops)
  }
  if (parseInt(navigator.appVersion) >= 4) { 
    winName.window.focus(); 
  }  
}
function submitForm (form_obj, return_div_id, timeout, message) {
   var h = getHTTPObject(); // We create the HTTP Object
   var action = form_obj.action;
   if (action == '') { action = 'index_text.php'; }
   h.open("POST", action, true);
   if (message != "" && message != null) {
     notify (message);
   }
   h.onreadystatechange = function () {
     if (h.readyState == 4) {
       if (h.status == 200) {
         
         result = h.responseText;
         moveNotifyDown();
	 if (return_div_id) {
           document.getElementById(return_div_id).innerHTML = result;
         
         }
         if (timeout != "" && timeout != null) {
            eval (timeout);
         }
         return;
       } else {
         alert('There was a problem with the request.');
         return;
       }
     }
   }

   var parameters = getFormValues( form_obj );
   h.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   h.setRequestHeader("Content-length", parameters.length);
   h.setRequestHeader("Connection", "close");
   h.send(parameters);
/*
   if (return_div_id) {   
     document.getElementById(return_div_id).innerHTML = "<center><br><br><font color=\"blue\"><b>Saving...</b></font><br></center>";
   }
*/
   return false;
}

function getFormValues(fobj,valFunc) {
   // grabbed from http://www.devarticles.com/c/a/XML/XML-in-the-Browser-Submitting-forms-using-AJAX/5/
   var str = "";
   var valueArr = null;
   var val = "";
   var cmd = "";
   for(var i = 0;i < fobj.elements.length;i++) {
		//alert(fobj.elements[i].type);
     switch(fobj.elements[i].type) {
       case "hidden":   
       case "textarea":
       case "submit":
       case "text":
         if(valFunc) {
             //use single quotes for argument so that the value of
             //fobj.elements[i].value is treated as a string not a literal
             cmd = valFunc + "(" + 'fobj.elements[i].value' + ")";
             val = eval(cmd)
         }
         if(fobj.elements[i].type=="text") {
	         str += fobj.elements[i].name +
	             "=" + escape(fobj.elements[i].value) + "&";         
         } else {
	         str += fobj.elements[i].name +
	             "=" + escape(fobj.elements[i].value) + "&";         
         }
         
         break;
       case "select-one":
         str += fobj.elements[i].name +
         "=" + fobj.elements[i].options[fobj.elements[i].selectedIndex].value + "&";
         break;
       case "checkbox":
         value = (fobj.elements[i].checked == false) ? 'off' : 'on';
         str += fobj.elements[i].name +
         "=" + escape(value) + "&";
         break;
	       //alert(fobj.elements[i].name + ":" +fobj.elements[i].checked);
      
       case "radio":
         value = (fobj.elements[i].checked == false) ? 'off' : 'on';
         str += fobj.elements[i].name +
         "=" + escape(value) + "&";
         break;
     }
   }
   str = str.substr(0,(str.length - 1));
   s = new String(str);
   s = s.replace(/\+/g,encodeURIComponent("+"));
   str = s;
   return str;   
}

function clearPreloadPage() { //DOM
  if (document.getElementById){
    document.getElementById('prepage').style.display='none';
    document.getElementById('prepage').style.visibility='hidden';
  } else {
    if (document.layers){ //NS4
      document.prepage.visibility = 'hidden';
    } else { //IE4
      document.all.prepage.style.visibility = 'hidden';
    }
  }
}
function handleLink(e) {
  if (e == null) {
    return;
  }
  if (e.target.name != undefined) {
    if (e.target.tagName == 'a' || e.target.tagName == 'A') { 
      window.top.showLoadMessage ();
    }
  }
  routeEvent(e);
}
function inits() {
//  clearPreloadPage();
  initRPC();
}

function initDefault() {
  createNotifyHtml ();
}

function setStatus(text) {
    window.status = text;
}
var load_div = '';
function loadDivDelayed (div_id, url) {
  setTimeout ('loadDiv(\''+div_id+'\', \''+url+'\')', 2000);
}
function loadDiv (div_id, url, message, timeout) {
   var h = getHTTPObject(); // We create the HTTP Object

   // preventing caching
   var timestamp = new Date();
   var url = url + (url.indexOf("?") > 0 ? "&" : "?") + "timestamp="+ timestamp.getTime();
   

   h.open("GET", url, true);
   if (message != "" && message != null) {
     notify (message);
   }
   h.onreadystatechange = function () {
    if (h.readyState == 4) {
      results = h.responseText;
      moveNotifyDown();
      if(div_id!="") {
	      document.getElementById(div_id).style.display = 'block';
	      document.getElementById(div_id).innerHTML = results;      
      }
      if (timeout != "" && timeout != null) {
        eval (timeout);
      }
    }

   }
   h.send(null);
}
var rpc_host = "http://"+location.hostname+"/student/index_rpc.php";
var containers = new Array();
var container_tags = new Array ("TR","TABLE", "DIV");
var container_count = 0;
var inc_id = 0;
var no_parse = false;
//addGlobal ("enroll_id", "12");
//addGlobal ("chal_id", 265);
// }}}
// globals {{{
globals = new Array( new Array() );
global_index = 0;
globals["_storage"] = new Array();
function addGlobal (name, value) {
  globals[name] = value;
}
function getGlobals() {
  return globals;
}
// }}}
function loadRPC (from_id, to_id, global_idx, message) {
  no_parse = false;
  var from_dom = document.getElementById(from_id);
  if (from_dom.getAttribute("src") != null) {
    parent_id = "";
    id = from_dom.getAttribute ("id");
    containers[id] = new container(id);
    containers[id].nodeName = from_dom.nodeName;
    containers[id].storeHTML();
    if (global_idx >= 0 ) { 
      containers[id].globals = globals["_storage"][global_idx];
    } else {
      containers[id].globals = globals;
    }
    containers[id].src = from_dom.getAttribute("src");
    containers[id].domNode = from_dom.cloneNode(true);
    containers[id].parent_id = parent_id;
    containers[id].to_id = to_id;
    setAllNotLoaded();
    parseContainers (document.getElementById(from_id), containers[id].globals, from_id);
    parseLoop(message);
  }
}
//  arraySearch (needle, haystack) {{{
function arraySearch (needle, haystack) { // hate having to do this.. need more docs..
  for (i = 0; i < haystack.length; i++) {
    if (haystack[i] == needle) {
      return true;
    }
  }
  return false;
}
// }}}
// getHTTPObject {{{
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
  	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object

if (typeof DOMParser == "undefined") {
   DOMParser = function () {}
   DOMParser.prototype.parseFromString = function (str, contentType) {
      if (typeof ActiveXObject != "undefined") {
         try {
           var d = new ActiveXObject("MSXML2.DOMDocument");
           d.loadXML(str);
         } catch (e) {
         }
         return d;
      } else if (typeof XMLHttpRequest != "undefined") {
         var req = new XMLHttpRequest;
         req.open("GET", "data:" + (contentType || "application/xml") +
                         ";charset=utf-8," + encodeURIComponent(str), false);
         if (req.overrideMimeType) {
            req.overrideMimeType(contentType);
         }
         req.send(null);
         return req.responseXML;
      }
   }
}

// }}}

// parseContainers (node) -- Search for all HTML containers, once found call itself on the children nodes and call rpc {{{
function parseContainers (node, glob, last_parent) {
  if (no_parse == true) {
    return;
  }
  var child = node.firstChild;
  var xml = "";
  var id = "";
  var parent_id = "";
  //window.alert("Parent: " + node.nodeName + " " + node.getAttribute("id") + "\nChild: " + child.nodeName + "\nInnerHTML:" + node.innerHTML + "\nChild INNTERHTML:" + child.innerHTML );
  while (child != undefined) {
    if ( arraySearch (child.nodeName.toUpperCase(), container_tags) ) {
      id = child.getAttribute("id");
      //window.alert("ID:"+id);
      if (id == "templates_start") {
        no_parse = true;
		return;
      }
      if (child.getAttribute("src") != null) {
		//window.alert("ID:"+id + ": added to containers");
        container_count++;

        parent_id = last_parent;
        containers[id] = new container(id);
        containers[id].nodeName = child.nodeName;
        containers[id].storeHTML();
        containers[id].globals = glob;
        containers[id].src = child.getAttribute("src");
        containers[id].domNode = child.cloneNode(true);
        containers[id].parent_id = parent_id;
        if (parent_id != null && parent_id != "") {
        	if(containers[parent_id]!=null) {
        	 containers[parent_id].has_children = true;
        	} else {
        		containers[id].parent_id=null;
        		//window.alert("Parent without container:"+parent_id+"Nodename:"+node.nodeName);
        	}
	         
        }
      }
      
    }
    if (child.hasChildNodes()) {
      if (id != "") {
        parseContainers (child, glob, id);
      } else {
        parseContainers (child, glob, last_parent);
      }
    }
    if (! (child = child.nextSibling)) {
      break;
    }
  }
}
// }}}
// rpc (xml, id) -- Send RPC request, results go to rpcParseResponse() {{{
function rpc (xml, id, message) {
   var h = getHTTPObject(); // We create the HTTP Object
   inc_id++;
   var to_id = inc_id+id;  
   containers[id].ret_id = to_id;
   h.open("POST", rpc_host + "?id="+to_id, true);
   if (message != "" && message != null) {
     notify (message);
   }
   h.onreadystatechange = function () {
     if (h.readyState == 4) {
       results = h.responseText;
       moveNotifyDown();
       rpcParseResponse (results, id);

     }

   }
   h.send(xml);
}
// }}}
// container class -- Stores the html / dom of for a HTML container {{{
function container (id) {
  this.id = id;
  this.to_id = id;
  this.ret_id = "";
  this.parent_id = "";
  this.src = "";
  this.nodeName = "";
  this.globals = new Array( new Array() );
  this.has_children = false;
  this.num_rows = 0;
  this.rows_loaded = 0;
  this.load_completed = false;
  this.innerHTML = "";
  this.processed = false;
  this.processedHTML = "";
  this.domNode;
  this.storeHTML = storeHTML;
}

function storeHTML () {
	//this.innerHTML = this.nodeValue;
	//return;	
	//window.alert(this.nodeName);
	//window.alert(this.nodeName + "stored");
  if (this.nodeName.toUpperCase() == "DIV") {
    this.innerHTML = document.getElementById(this.id).innerHTML;
    return;
  }
  if (this.nodeName.toUpperCase() == "TABLE") {
  //window.alert(document.getElementById(this.id).parentNode.nodeName=="BODY");
  	if(document.getElementById(this.id).parentNode.nodeName!="BODY") {
	  	this.innerHTML = document.getElementById(this.id).parentNode.innerHTML;
  	} else {
	  	this.innerHTML = document.getElementById(this.id).innerHTML;
  	}
    return;
  }
  if (this.nodeName.toUpperCase() == "TR") {

	  	this.innerHTML = document.getElementById(this.id).innerHTML;

    //this.innerHTML = document.getElementById(this.id).parentNode.innerHTML;
    return;
  } 
}
// }}}
// loadCall (call) -- process the src tag, put it into an array and call buildXML() {{{
function loadCall (call, id) {
  var call_arr = new Array();
  var params   = new Array();
  var func     = "";
  var i        = 0;
  call = unescape (call);
  call = call.replace ("(", " ");
  call = call.replace (")", " ");
  call = call.replace (",", " ");
  call_arr = call.split (" ");
  for (i = 0; i < call_arr.length; i++) {
    call_arr[i] = call_arr[i].replace (" ", "");
    if (i == 0) { 
      func = call_arr[i];
    } else {
      if (call_arr[i] != "") {
        params.push ( call_arr[i] );
      }
    }
  }
  if (func != "") {
    return buildXML(func, params, id);
  }
}
// }}}
// buildXML (func, params) -- builds and returns the xml-rpc methodCall string {{{
function buildXML (func, params, id) {
  var i = 0;
  var xml = "<?xml version=\"1.0\"?>\n" +
            "<methodCall>\n" +
            "  <methodName>" + func + "</methodName>\n" +
            "   <params>\n";
  for (i = 0; i < params.length; i++) {
    value = containers[id].globals[params[i]];
    xml+=   "    <param>\n" +
            "     <value><string>" + value + "</string></value>\n" +
            "    </param>\n";
  }             
  xml+=     "   </params>\n"+
            "</methodCall>\n";
  return xml;

}
// }}}
// rpcParseResponse (xml_response, id) {{{
function rpcParseResponse (xml_response, id) {
  var xmlDoc = (new DOMParser()).parseFromString(xml_response, "text/xml");
//  alert (xml_response);
  var name, value, html, to_id = "";
  var root = xmlDoc.getElementsByTagName("struct");
  var strings = xmlDoc.getElementsByTagName("string");
  var num_rows = root.length;
  var row = new Array();
  var i, j, g = 0;
  var members, member = null;
  global_index++;

  try {
    to_id = strings.item(0).firstChild.nodeValue;
  } catch (e) {
    to_id = "";
  }
  if (hasParent(id)) {
    parent_id = containers[id].parent_id;
    // need to do some regex here, some browsers strip the quotes, which sucks...
    containers[parent_id].processedHTML = containers[parent_id].processedHTML.replace ('id='+id, 'id='+to_id);
    document.getElementById(parent_id).innerHTML = document.getElementById(parent_id).innerHTML.replace ('id='+id, 'id='+to_id);
    containers[parent_id].processedHTML = containers[parent_id].processedHTML.replace ('id="'+id, 'id="'+to_id);
    document.getElementById(parent_id).innerHTML = document.getElementById(parent_id).innerHTML.replace ('id="'+id, 'id="'+to_id);
    containers[id].to_id = to_id;
  }
  containers[id].num_rows = num_rows;
  for (i = 0; i < root.length; i++) {
    members = root[i].childNodes;
    row = new Array();
    for (j = 0; j < members.length; j++) {
      if (members.item(j).nodeName == "member") {
        try {
          member = members.item(j);
          if (member.childNodes.item(0).firstChild) {
            name = member.childNodes.item(0).firstChild.nodeValue;
            value = member.childNodes.item(1).firstChild.firstChild.nodeValue;
          } else {
            name = member.childNodes.item(1).firstChild.nodeValue;
            value = member.childNodes.item(3).firstChild.firstChild.nodeValue;
          }
          if (name == "faultString") {

             notify (value + "<br><br>Click <a href=\"/index.php\">here</a>.", 0, true);
             notifyStop =  true;
             return;
          }
          row.push(new Array(name, value));
        } catch (e) {
          // like... whatever.
        }
      }
    }
    global_index++;
    globals["_storage"][global_index] = new Array();
    for (j = 0; j < row.length; j++) {
      globals["_storage"][global_index][row[j][0]] = row[j][1]; 
      containers[id].globals[row[j][0]] = row[j][1];
    } 
//    containers[id].globals = globals["_storage"][global_index];
    html = containers[id].innerHTML;
    for (g in containers[id].globals) {
      if (g != "") {
        var str = "\\{"+g+"\\}";
        var re = new RegExp(str, "g");
        html = html.replace(re, containers[id].globals[g]);
      }
    }
//    globals["_storage"][global_index] = containers[id].globals;
    html = html.replace ("{globals}", global_index);
    containers[id].rows_loaded++;
    containers[id].processedHTML+= html;
    if (containers[id].rows_loaded >= containers[id].num_rows) {

      if (containers[id].has_children) {
        setChildrenNotLoaded(id);
        parseChildren(id);
      } else {
      }
      parseLoop();
      if (hasParent(id)) {
        parent_id = containers[id].parent_id;
        containers[parent_id].processedHTML = document.getElementById(containers[parent_id].to_id).innerHTML;
        containers[id].processedHTML = "";
      }
      containers[id].rows_loaded = 0;
      break;
    } else {
      if (containers[id].has_children) {
        setChildrenNotLoaded(id);
        parseChildren(id);
      }
      parseLoop();
    }  

    
  }
 
}
// }}}

function alterContainerID (id, new_id) {
  document.getElementById (id).id = new_id;

}
function setAllNotLoaded () {
  var c = "";
  for (c in containers) {
    containers[c].load_completed = false;
    containers[c].processedHTML = "";
  }
}


function setChildrenNotLoaded (parent_id) {
  var c = "";
  for (c in containers) {
    if (containers[c].parent_id == parent_id) {
       containers[c].load_completed = false;
    }
  }
}

function parseChildren (parent_id) {
  var c = "";
  var xml = "";
  for (c in containers) {
    if (containers[c].parent_id == parent_id) {
       if (containers[c].load_completed != true) {
         containers[c].load_completed = true;
         xml = loadCall (containers[c].src, c);
         rpc (xml, c);
         break;
       }
    }
  }
}
function initRPC () {
  //window.alert("Initializing RPC");
  //window.alert("RPC Host: "+rpc_host);
  createNotifyHtml ();
  //window.alert("NOTIFY HTML CREATED");
  parseContainers(document.body, globals);
  //window.alert("CONTAINERS PARSED");
  parseLoop();
  //window.alert("LOOP PARSED");
  //window.alert("Finished initializing");
}
  function parseLoop (message) {


    var c = "";
    var xml = "";
    for (c in containers) {
       //window.alert("PRC Container:" +containers[c].id+"("+containers[c].parent_id+"), hasParent/hasChildren:" + hasParent(c)+"/"+containers[c].has_children);    
       if (containers[c].load_completed != true && (!hasParent (c) || containers[c].has_children == true)) {
		 //window.alert("Processing container:" + containers[c].id + "source "+ containers[c].src +"\n" + containers[c].innerHTML);
         containers[c].load_completed = true;
         xml = loadCall (containers[c].src, c);
         rpc (xml, c, message);
         break;
       }
     }
     isAllDone();
  }
  function isAllDone() {
    var c = "";
    for (c in containers) {
      if (containers[c].load_completed != true) {  // first check of all containers have been loaded
        return false;
      } 
    }
    for (c in containers) {  // now load the html
		//window.alert(containers[c].nodeName); 

      if(containers[c].nodeName.toUpperCase() == "TABLE") {
        if (document.getElementById(containers[c].to_id)) {
          document.getElementById(containers[c].to_id).innerHTML = containers[c].processedHTML;
          document.getElementById(containers[c].to_id).style.display = "block";
		}      
      } 
      
      if (containers[c].nodeName.toUpperCase() == "DIV") {
        if (document.getElementById(containers[c].to_id)) {
          document.getElementById(containers[c].to_id).innerHTML = containers[c].processedHTML;
          document.getElementById(containers[c].to_id).style.display = "block";
		}
      }
       if (containers[c].nodeName.toUpperCase() == "TR") { 
          if (containers[c].processedHTML != "") {
             var p = document.getElementById(containers[c].to_id).parentNode;

             var new_tr = null;

             document.getElementById(containers[c].to_id).style.display = "block";
             var string = "<table>\r" + containers[c].processedHTML + "\r</table>\r";
             var xml = (new DOMParser()).parseFromString(string, "text/xml");

             
             var tds = xml.getElementsByTagName("*");
             var i = 0;
             var j = 0;
             var cols = null;
             p.deleteRow (0);
             for (i = 0; i < tds.length; i++) {
               new_tr = p.insertRow(-1);
               cols = tds[i].childNodes;
               for (j = 0; j < cols.length; j++) {
                  if (cols.item(j).nodeName.toUpperCase() == "TD") {
                    new_tr.appendChild(cols.item(j)); 
                  }
               }
             }
//        var serializer = new XMLSerializer();
//        text = serializer.serializeToString(p);
//alert (text);

          }
        }
      
    }
   
  }
  function hasParent (id) {
    if (containers[id].parent_id == null || containers[id].parent_id == "") {
      return false;
    }
    return true;
  }


  var winWidth  = 0;
  var winHeight = 0;
  var notifyScrollSpeed = 10;
  var notifyScrollPixels = 4; // how many pixels to move at a time
  var notifyStop = false;
  function notify (message, timespan, is_error) {
    if (notifyStop == true) { return; }
    if (timespan == "" || timespan == null) {
      timespan = 0;
    }
    if (is_error == "" || is_error == null) {
      is_error = false;
    }
    if (self.innerWidth) {
      winWidth = self.innerWidth;
      winHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientWidth) {
      winWidth = document.documentElement.clientWidth;
      winHeight = document.documentElement.clientHeight;
    } else if (document.body) {
      winWidth = document.body.clientWidth;
      winHeight = document.body.clientHeight;
    }
    document.body.style.overflow = "hidden";
    var top  = winHeight - 100;
    var left = winWidth - 200;
    var n    = document.getElementById('notify');
    n.innerHTML     = '<br><b>'+message+'</b>';
    n.style.top     = winHeight;
    n.style.left    = left - 20;
    n.style.display = "block";
    moveNotifyUp (top - 20, timespan * 1000, is_error);
  }
  function moveNotifyUp (stop_at, timespan, is_error) {
    var n = document.getElementById('notify');
    var top = n.style.top.replace ("px", "");
    if (top > stop_at) {
      n.style.top = parseInt(top) - notifyScrollPixels;
      setTimeout( 'moveNotifyUp('+stop_at+', '+timespan+')', notifyScrollSpeed);
    } else {
      if (timespan > 0 && is_error == false) {
        setTimeout (moveNotifyDown, timespan);
      } else {
        document.body.style.overflow = "auto";
      }
    }
  }
  function moveNotifyDown () {
    if (notifyStop == true) { return; }
    var n = document.getElementById('notify');
    var top = n.style.top.replace ("px", "");
    if (top < winHeight) {
      n.style.top = parseInt(top) + notifyScrollPixels;
      setTimeout( moveNotifyDown, notifyScrollSpeed);
    } else {
      n.style.display = "none";
      document.body.style.overflow = "auto";
    }
  }
  function createNotifyHtml () {
    var html = '<div id="notify" z-index="99" style="background-color:#DFE7F0;border:4px solid;height:100;width:200;display:none;position:absolute;text-align:center;';
    html = html + '"></div>';
    //var divToAdd = document.createElement('div');
    //divToAdd.setAttribute('style', 'background-color:#DFE7F0;border:4px solid;height:100;width:200;display:none;position:absolute;text-align:center;');
    //document.getElementByTag("body").appendChild(divToAdd);
    document.body.innerHTML = document.body.innerHTML+html;
  }

