<!--
function checksubmit(submitbtn){
submitbtn.form.submit()
checksubmit=blocksubmit
return false
}

function blocksubmit(){
if (typeof formerrormsg!="undefined")
alert(formerrormsg)
return false
}

function open_window(url) {
popup = window.open(url,"popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=480,height=410");
    if (!popup.opener)
        popup.opener=self;
    popup.focus();
} 

counter=0;
function monitor() {
counter++;
if(counter>1) {return false;}
return true;
} 
function open_window2(url) {
popup = window.open(url,"popup","toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=yes,resizable=yes,width=510,height=410");
popup.focus();
}

function openramosus(url, name, width, height)
{  popupWin = window.open(url,name,'width=' + width + ',height=' + height + ',scrollbars=yes,toolbar=no,resizable=yes,menubar=no,location=no,status=yes,screenX=50,screenY=50,top=50,left=50')
    if (!popupWin.opener)
        popupWin.opener=self;
    popupWin.focus();
}
function openpopup(url, name, width, height)
{  popupWin = window.open(url,name,'width=' + width + ',height=' + height + ',scrollBars=yes,toolbar=no,resizable=yes,location=0,status=0,screenX=50,screenY=50,top=50,left=50')
    if (!popupWin.opener)
        popupWin.opener=self;
    popupWin.focus();
}

function openpopup2(url, name, width, height, toolbar)
{  popupWin = window.open(url,name,'width=' + width + ',height=' + height + ',scrollBars=auto,toolbar='+toolbar+',resizable=yes,location=0,status=0,screenX=150,screenY=50,top=50,left=150')
    if (!popupWin.opener)
        popupWin.opener=self;
    popupWin.focus();
}


function openpopup3(mylink, name, percent, toolbar){
    var w = 650, h = 450; // default sizes
    var winleft = 50
    var winUp = 50
    if (window.screen) {
        w = window.screen.availWidth * percent / 100;
        h = window.screen.availHeight * percent * 1.5/ 100;
        winleft = (window.screen.availWidth - w) / 2;
        winUp = (window.screen.availHeight - h) / 2;
    }
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
       
    popupWin3 = window.open(href,name,'width=' + w + ',height=' + h + ',scrollBars=yes,toolbar='+toolbar+',resizable=yes,location=0,status=0,screenX='+winleft+',screenY='+winUp+',top='+winUp+',left='+winleft+'')
    if (!popupWin3.opener)
        popupWin3.opener=self;
    popupWin3.focus();

}

/*ex. submitjs.inc*/
function setFocus() {
    if (document.activity)
    if (document.activity.elements[0].type == "text" || document.activity.elements[0].type == "textarea")
    document.activity.elements[0].focus();
}
var thechoice = null;
function checkresponse(form){
    var msg;
    var noErrors=true;
    if(thechoice==""||thechoice==null||thechoice=="0"){
    msg="Please choose an option\nfrom the dropdown box\nbefore clicking.";
        noErrors=false;}
    if(noErrors){
        return true;}
    else{
        alert(msg);
        return false;}
}
function checkselectstudent(form){
    var msg;
    var noErrors=true;
    if(thechoice==""||thechoice==null||thechoice=="0"){
    msg="You must select at least\none student's name\nbefore clicking.";
        noErrors=false;}
    if(noErrors){
        return true;}
    else{
        alert(msg);
        return false;}
}


function checkFaults(form){
if ((document.activity.theemail.value == "") || (document.activity.theemail.value == null)) { 
    if  (!confirm("You have not entered a return email address.\nWhile this is OK, are you sure that you have provided\nthe recipient of this message sufficient information\nto contact you if required?\n\nPress OK to send your message as is."))
        return false; 
        }        

}
// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

function expandEditbox(poButton, pcEditboxID, pnMaxRows)
{
	var loEditbox = document.getElementById(pcEditboxID);
	if(!loEditbox.disabled)
	{
		loEditbox.rows = Math.min(loEditbox.rows + 5, pnMaxRows);
	
		if(loEditbox.rows == pnMaxRows)
		{
			poButton.style.display = "none";
		}
	}
	return true;
}

function setLanguage(s) {
    target = 'switchLang'
    url = 'scripts/language.asp?id=' + s 
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.open("GET", url, false);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.open("GET", url, true);
            req.send();
        }
    }
}    


// end hiding scripting -->
