// variables
	// user-agent identity
	var version = parseInt(navigator.appVersion);
	var isNS  = (navigator.appName.indexOf("Netscape") >= 0);
	var isNS4 = (isNS && version == 4);
	var isNS5 = (isNS && version > 4);
	var isFF  = (navigator.appName.indexOf("Firefox") >= 0);
	var isIE  = !(isNS || isFF);
	var isIE4 = (isIE && version == 4);
	var isIE5 = (isIE && version > 4);
	var isMac = (navigator.appVersion.indexOf("Macintosh") >= 0);
	var isWin = !(isMac);
	var isAOL = (navigator.userAgent.indexOf("AOL") >= 0);
	var menuDelay = 0;

// event capturing
	if (isNS4)
	{
		window.captureEvents(Event.ONLOAD);
		window.onLoad = pageLoad;
	}

	if (isNS5)
	{
		window.addEventListener('load', pageLoad, false);
	}

	if (isIE)
	{
		window.attachEvent('onload', pageLoad);
	}
	
	function pageLoad()
	{
		if (window.advancePanel) advancePanel();
	}
		
// mouseovers; incompatible with NS4
	//
	// Usage:
	// <a href="LINK"><img src="IMAGE.EXT" onload="mouseLoad(this);" width="WIDTH" height="HEIGHT" border="0" title="ALT" /></a>
	// 
	// Note: mouseover image must be named IMAGE_over.EXT
	//
	function mouseLoad(obj)
	{
		if (isNS4 || obj.out) return;
		
		obj.out = new Image();
		obj.out.src = obj.src;
		obj.over = new Image();
		obj.over.src = obj.src.replace(/.gif$/, "_over.gif").replace(/.jpg$/, "_over.jpg");
		if (isNS5)
		{
			obj.addEventListener("mouseover", mouseOver, false);
			obj.addEventListener("mouseout", mouseOut, false);
		}
		if (isIE)
		{
			obj.attachEvent("onmouseover", mouseOver);
			obj.attachEvent("onmouseout", mouseOut);
		}
	}

	function mouseOver(evt)
	{
		obj = (evt.target) ? evt.target : evt.srcElement;
		if (obj.disabled) return;
		obj.src = obj.over.src;
	}

	function mouseOut(evt)
	{
		obj = (evt.target) ? evt.target : evt.srcElement;
		if (obj.disabled) return;
		if (obj.out) obj.src = obj.out.src;
	}

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
		
var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


function showSelections(thenumber, child1, child2, child3, child4, child5){
	if (document.getElementById) {
		my_div1 = document.getElementById(child1).style;
		my_div2 = document.getElementById(child2).style;
		my_div3 = document.getElementById(child3).style;
		my_div4 = document.getElementById(child4).style;
		my_div5 = document.getElementById(child5).style;
		
		switch(thenumber) {		
			case "1":	
				my_div1.display = "inline";
				my_div2.display = "none";		
				my_div3.display = "none";
				my_div4.display = "none";
				my_div5.display = "none";	
				break;
			case "2":
				my_div1.display = "inline";
				my_div2.display = "inline";		
				my_div3.display = "none";
				my_div4.display = "none";
				my_div5.display = "none";	
				break;
			case "3":
				my_div1.display = "inline";
				my_div2.display = "inline";		
				my_div3.display = "inline";
				my_div4.display = "none";
				my_div5.display = "none";
				break;
			case "4":
				my_div1.display = "inline";
				my_div2.display = "inline";		
				my_div3.display = "inline";
				my_div4.display = "inline";
				my_div5.display = "none";
				break;
			case "5":
				my_div1.display = "inline";
				my_div2.display = "inline";		
				my_div3.display = "inline";
				my_div4.display = "inline";
				my_div5.display = "inline";
				break
			}
					
			return false;
		}
		else {				
			return true;
		}
}

	function pageLoad()
	{
		if (window.advancePanel) advancePanel();
	}
	
	
	function getCopyright(){
	var date = new Date();
	document.write("© Roseland Christian School ");
	document.write(date.getFullYear());
}

function showPlanOptions(plan) {
	my_div1 = document.getElementById('full').style;
	my_div2 = document.getElementById('half').style;
	my_div3 = document.getElementById('10month').style;
	my_div4 = document.getElementById('9month').style;
	
	switch(plan) {		
			case "full":	
				my_div1.display = "inline";
				my_div2.display = "none";	
				my_div3.display = "none";	
				my_div4.display = "none";	
				break;
			case "half":
				my_div1.display = "none";
				my_div2.display = "inline";	
				my_div3.display = "none";	
				my_div4.display = "none";	
				break;
			case "10month":
				my_div1.display = "none";
				my_div2.display = "none";	
				my_div3.display = "inline";
				my_div4.display = "none";		
				break;
			case "9month":
				my_div1.display = "none";
				my_div2.display = "none";	
				my_div3.display = "none";
				my_div4.display = "inline";	
	}
	return false;
}

function showPlanOptions2(plan) {
	my_div1 = document.getElementById('busfull1').style;
	my_div2 = document.getElementById('bushalf1').style;
	my_div3 = document.getElementById('bus10month1').style;
	my_div4 = document.getElementById('bus9month1').style;
	
	switch(plan) {		
			case "busfull1":	
				my_div1.display = "inline";
				my_div2.display = "none";	
				my_div3.display = "none";	
				my_div4.display = "none";	
				break;
			case "bushalf1":
				my_div1.display = "none";
				my_div2.display = "inline";	
				my_div3.display = "none";	
				my_div4.display = "none";	
				break;
			case "bus10month1":
				my_div1.display = "none";
				my_div2.display = "none";	
				my_div3.display = "inline";
				my_div4.display = "none";		
				break;
			case "bus9month1":
				my_div1.display = "none";
				my_div2.display = "none";	
				my_div3.display = "none";
				my_div4.display = "inline";	
	}
	return false;
}

function showPlanOptions3(plan) {
	my_div1 = document.getElementById('busfull2').style;
	my_div2 = document.getElementById('bushalf2').style;
	my_div3 = document.getElementById('bus10month2').style;
	my_div4 = document.getElementById('bus9month2').style;
	
	switch(plan) {		
			case "busfull2":	
				my_div1.display = "inline";
				my_div2.display = "none";	
				my_div3.display = "none";	
				my_div4.display = "none";	
				break;
			case "bushalf2":
				my_div1.display = "none";
				my_div2.display = "inline";	
				my_div3.display = "none";	
				my_div4.display = "none";	
				break;
			case "bus10month2":
				my_div1.display = "none";
				my_div2.display = "none";	
				my_div3.display = "inline";
				my_div4.display = "none";		
				break;
			case "bus9month2":
				my_div1.display = "none";
				my_div2.display = "none";	
				my_div3.display = "none";
				my_div4.display = "inline";	
	}
	return false;
}

function showZone(zone) {
	my_div1 = document.getElementById('zone1').style;
	my_div2 = document.getElementById('zone2').style;
	
	switch(zone) {		
			case "zone1":	
				my_div1.display = "inline";
				my_div2.display = "none";
				break;
			case "zone2":
				my_div1.display = "none";
				my_div2.display = "inline";
				break;
	}
	return false;
}

function showTuition(thechildren,start){
	if (document.getElementById) {
		var mySplits = thechildren.split(",");
		var myPlan = mySplits[0];
		var myChildren = mySplits[1];
		var end=start+5;
	
		for(var s=start;s<end;s++){
			document.getElementById(myPlan+s).style.display = "none";
		}			
			document.getElementById(myPlan+myChildren).style.display = "inline";
					
			return false;
		}
		else {				
			return true;
		}
}

function showMonthTuition(theChoice,thePlan,theRow,theStart){
	if (document.getElementById) {
		var theEnd=theStart+5;
		var theFullChoice = theChoice+'_'+thePlan+theRow;
		
		for(var q=theStart;q<theEnd;q++){
			document.getElementById('recurring_'+thePlan+q).style.display = "none";
			document.getElementById('onetime_'+thePlan+q).style.display = "none";
		}			
			document.getElementById(theFullChoice).style.display = "inline";	
			
			return false;
		}
		else {				
			return true;
		}
}
//KEEP THESE
function showTuitionRecurring(value) {
	if ((value=='10month') || (value=='9month')) {
		document.getElementById('tuitrecurp').style.display = "inline";	
	} else {
		document.getElementById('tuitrecurp').style.display = "none";	
	}
}

function showBusRecurring(value) {
	if ((value=='10month') || (value=='9month')) {
		document.getElementById('busrecurp').style.display = "inline";	
	} else {
		document.getElementById('busrecurp').style.display = "none";	
	}
}

function showCareRecurring(value) {
	if ((value=='10month') || (value=='9month')) {
		document.getElementById('carerecurp').style.display = "inline";	
	} else {
		document.getElementById('carerecurp').style.display = "none";	
	}
}

function showRecurring(value) {
	if ((value=='10month') || (value=='9month')) {
		document.getElementById('recurp').style.display = "block";	
	} else {
		document.getElementById('recurp').style.display = "none";	
	}
}

// This script is (c) copyright 2006 Jim Tucek under the
// GNU General Public License (http://www.gnu.org/licenses/gpl.html)
// For more information, visit www.jracademy.com/~jtucek/email/ 
// Leave the above comments alone!

var decryption_cache = new Array();

function decrypt_string(crypted_string,n,decryption_key,just_email_address) {
	var cache_index = "'"+crypted_string+","+just_email_address+"'";

	if(decryption_cache[cache_index])					// If this string has already been decrypted, just
		return decryption_cache[cache_index];				// return the cached version.

	if(addresses[crypted_string])						// Is crypted_string an index into the addresses array
		var crypted_string = addresses[crypted_string];			// or an actual string of numbers?

	if(!crypted_string.length)						// Make sure the string is actually a string
		return "Error, not a valid index.";

	if(n == 0 || decryption_key == 0) {					// If the decryption key and n are not passed to the
		var numbers = crypted_string.split(' ');			// function, assume they are stored as the first two
		n = numbers[0];	decryption_key = numbers[1];			// numbers in crypted string.
		numbers[0] = ""; numbers[1] = "";				// Remove them from the crypted string and continue
		crypted_string = numbers.join(" ").substr(2);
	}

	var decrypted_string = '';
	var crypted_characters = crypted_string.split(' ');

	for(var i in crypted_characters) {
		var current_character = crypted_characters[i];
		var decrypted_character = exponentialModulo(current_character,n,decryption_key);
		if(just_email_address && i < 7)				// Skip 'mailto:' part
			continue;
		if(just_email_address && decrypted_character == 63)	// Stop at '?subject=....'
			break;
		decrypted_string += String.fromCharCode(decrypted_character);
	}
	
	decryption_cache[cache_index] = decrypted_string;			// Cache this string for any future calls

	return decrypted_string;
}

function decrypt_and_email(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;

	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,false);
	parent.location = decrypted_string;
}

function decrypt_and_echo(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;

	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,true);
	document.write(decrypted_string);
	return true;
}

// Finds base^exponent % y for large values of (base^exponent)
function exponentialModulo(base,exponent,y) {
	if (y % 2 == 0) {
		answer = 1;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	} else {
		answer = base;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	}
	return answer;
}


function ticketamt(sel) {	
	switch(sel) {		
			case "0":
      	alert('Please choose an amount of tickets');
      	return false;
      	break;
      case "1":
      	document.getElementById('item_name').value='Online Ticket Purchase - 1 Ticket';
      	document.getElementById('amount').value='10'; 
      	return true;
      	break;
      case "2":
      	document.getElementById('item_name').value='Online Ticket Purchase - 2 Tickets';
      	document.getElementById('amount').value='20';
      	return true;
      	break;
      case "3":
      	document.getElementById('item_name').value='Online Ticket Purchase - 3 Tickets';
      	document.getElementById('amount').value='25';
      	return true;
      	break;
      case "4":
      	document.getElementById('item_name').value='Online Ticket Purchase - 4 Tickets';
      	document.getElementById('amount').value='25';
      	return true;
      	break;
      case "5":
      	document.getElementById('item_name').value='Online Ticket Purchase - 5 Tickets';
      	document.getElementById('amount').value='25';
      	return true;
      	break;
      case "6":
      	document.getElementById('item_name').value='Online Ticket Purchase - 6 Tickets';
      	document.getElementById('amount').value='25';  
      	return true;
      	break;
   } 
	
}
// -->