/* Must init all functions for each page */

window.onload = function()
{
	createWindow();
	breadcrumbs()
	getTime();
	showBetween();
}

/* JAVASCRIPT FUNCTIONS */

/* Make a new window */
function createWindow(cUrl,cName,cFeatures) 
{
	var xWin = window.open(cUrl,cName,cFeatures)
}

/* Makes a trail of breadcrumbs */
function breadcrumbs()
{
	sURL = new String;
	bits = new Object;
	var x = 0;
	var stop = 0;
	var output = "<A HREF=\"/\"</A> &#62; ";
	sURL = location.href;
	sURL = sURL.slice(8,sURL.length);
	chunkStart = sURL.indexOf("/");
	sURL = sURL.slice(chunkStart+1,sURL.length)
	while(!stop){
	chunkStart = sURL.indexOf("/");
	if (chunkStart != -1){
		bits[x] = sURL.slice(0,chunkStart)
		sURL = sURL.slice(chunkStart+1,sURL.length);
}	else{
		stop = 1;
}
	x++;
}
	for(var i in bits){
		output += "<A HREF=\"";
	for(y=1;y<x-i;y++){
		output += "../";
}
		output += bits[i] + "/\">" + bits[i] + "</A> &#62; ";
}
		document.write(output + document.title);
}


/* Gets the current time */
// getTime()
// Returns: Text containing the time in the format HH:MM
function getTime()
{       
	var now = new Date();
	var minutes = now.getMinutes();
	var divider = ":";

	if (minutes<10)
		divider = ":0";

	return( now.getHours() + divider + minutes );
}

/* Shows certain text between two times */
function showBetween (theText, altText, startAt, stopAt)
{
	var now = new Date();
	var h = now.getHours();

	if (startAt <= stopAt)
	{
		if ( h >= startAt & h <= stopAt)
			return(theText)
		else
			return (altText);
	}
	return ('** ERROR in JavaScript showBetween **');
}



