function viewrules(){ 
	var url = "/onlineregistration/help/schoolrules.htm";
	ruleswindow = window.open(url, "ruleswindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=720,height=550");
	if (window.print) ruleswindow.focus();
}

function checkLoginForm() {
	if (!(loginform.schoolrules.checked)) {
		alert("School Rules checkbox must be checked!");
		return false;
	}

	return true;
	
}

function viewinputchinese(){ 
	var url = "/onlineregistration/help/chinese_input.htm";
	inputchinesewindow = window.open(url, "inputchinesewindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=790,height=550");
	if (window.print) inputchinesewindow.focus();
}

function openNewWindow(url, winName){
	if (winName == "schoolrules") {
		ruleswindow = window.open(url, "ruleswindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=720,height=550");
		if (window.print) ruleswindow.focus();
	}
	else if (winName == "inputchinese") {
		inputchinesewindow = window.open(url, "inputchinesewindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=790,height=550");
		if (window.print) inputchinesewindow.focus();
	}
	else if (winName == "classlist") {
		classlistwindow = window.open(url, "classlistwindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=790,height=550");
		if (window.print) classlistwindow.focus();
	}
	else if (winName == "onlineregistrationguide") {
		onlineregistrationguidewindow = window.open(url, "onlineregistrationguidewindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=790,height=550");
		if (window.print) onlineregistrationguidewindow.focus();
	}
	else if (winName == "registrationform") {
		registrationformwindow = window.open(url, "registrationformwindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=790,height=550");
		if (window.print) registrationformwindow.focus();
	}
	else if (winName == "classintroduction") {
		classintroductionwindow = window.open(url, "classintroduction", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=600,height=350");
		if (window.print) classintroductionwindow.focus();
	}
	else {
		otherwindow = window.open(url, "otherwindow", "toolbar=yes,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,width=790,height=550");
		if (window.print) otherwindow.focus();
	}
}

function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = true;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    //var oddColor = arguments[2] ? arguments[2] : "#f2d0d0";
    var oddColor = arguments[2] ? arguments[2] : "#E9E8CA";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {
		trs[i].style.backgroundColor = even ? evenColor : oddColor;
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
}