if(document.images){	
	p78 = new Image();
	p78.src = "images/bt_arrow.gif";
	rp78 = new Image();
	rp78.src = "images/bt_cross.gif";
	
	p79 = new Image();
	p79.src = "images/bt_show_all.gif";
	rp79 = new Image();
	rp79.src = "images/bt_close_all.gif";
}

/* changeArrowImage function modified to work with the open/close images on the schedule page */
/* DONT REMOVE THIS FUNCTION! */
function changeArrowImage(row,s,sched){
	var h = (s==1)?"r":"";
	var row_src = (parseInt(sched)>=1)?'p'+sched:row;

	if(document.images){
		document.images[row].src = eval(h + row_src + ".src");
	}
}

/* Function to show or hide the schedule text when one of the 'day' images is clicked (IE 4+ Win && IE5+ Mac) */
function displaySchedule(day,clicked){
	if(document.all){
		scheduleObject = eval('document.all.schedLyr'+day+'.style');
		scheduleBtn = 'schedLyrBtn'+day;
		if(scheduleObject.display=='none'||scheduleObject.display==''){
			scheduleObject.display = 'block';
			changeArrowImage(scheduleBtn,1,'78');
		}else if(clicked!='top'){
			scheduleObject.display = 'none';
			changeArrowImage(scheduleBtn,0,'78');
		}
	}
}

var tidx, tend, tthisImgVis, tshowAllID;
function toggleImages(idx, end, thisImgVis, tidx2, showAllID){
	tidx = idx;
	tend = end;
	tthisImgVis = thisImgVis;
	tshowAllID = showAllID;
	
	if(arguments[3] == null){
		setTimeout('toggleImages(tidx, tend, tthisImgVis, tidx, tshowAllID)', 10);
	}else{
		if(idx <= end){
			scheduleBtn = 'schedLyrBtn'+idx;
			lastScheduleBtn = 'schedLyrBtn'+(idx-1);
			imgID = '78';
			if(idx != 1 && eval('document.images.'+lastScheduleBtn+'.readyState') == 'complete'){
				tidx++;
				changeArrowImage(scheduleBtn, tthisImgVis, imgID);
			}
			if(idx == 1){
				tidx++;
				changeArrowImage(scheduleBtn, thisImgVis, imgID);
				thisShowAllImg = 'showAllImg' + tshowAllID;
				changeArrowImage(thisShowAllImg, tthisImgVis, '79');
			}
			setTimeout('toggleImages(tidx, tend, tthisImgVis, tidx, tshowAllID)', 10);
		}
	}
}

var action = 0;
/* action tells us whether we are about to show all or hide all. if action = 1, then hide, otherwise show */
/* Function to show/hide all|a range of the items */
function toggleAll(from,to,id){
	if (from == 0)
	{
		scheduleObject = eval('document.all.schedLyr'+from+'.style');
		scheduleBtn = 'schedLyrBtn'+from;
		if(action == 1){
			scheduleObject.display = 'none';
		} else {
			scheduleObject.display = 'block';
		}
		thisImgVis = (scheduleObject.display=='none'||scheduleObject.display=='')?0:1;
		changeArrowImage(scheduleBtn,thisImgVis,'78');
	}
	else
	{
		if(!arguments[1]){
			to = from;
			from = 1;
			id = '';
		}

		thisImgState = (action)?0:1;

		thisImgVis = (action)?0:1;
		toggleImages(from, to, thisImgVis, null, id);

		for(i=from;i<=to;i++){
			scheduleObject = eval('document.all.schedLyr'+i+'.style');
			if(action == 1){
				scheduleObject.display = 'none';
			} else {
				scheduleObject.display = 'block';
			}
		}

	}
	if(action == 0){
		action = 1;
	} else {
		action = 0;
	}

	thisShowAllLink = eval('document.all.showAllLink'+id);
	thisShowAllLink.innerText = (scheduleObject.display=='none'||scheduleObject.display=='')?'Show All':'Hide All';
}