

var Title = [ "Homepage","Worship","Trinity's Leadership","Our Youth Family","Pastor Kris' Corner","Events Calendar","About Us", "Contact Us","Sitemap","Previous Page","" ];
var Alt = [ "Return to our homepage","Trinity Worship","Our Leadership & Council","The Youth Family","Pastor Kris\' Corner", "The calendar of Trinity events","A little bit about us","Feel free to contact us anytime","Lost?  You\'ll find it in our sitemap!", "Return to the previous page","" ];
var Links = [ "./index.php","./worship.php","./leadership.php","./youth.php","./kcorner.php","./calendar.php","./about.php", "./contact.php","./sitemap.php","javascript: window.history.back()","javascript: window.history.back()" ];
var taupe = "#C0BD7E", darkTaupe = "#708A4B", lightGray = "#C0C0C0", white = "#FFFFFF";

function initlz(complete, pageNumber, textColor, pageColor, shadowColor)
{
	document.write(
	"<div id=frame>"+
		"<div id=row1 style='background-image: url(./images/gfx3.bmp)'>"+
			"<div id=ico>"+
				"<img height=51 width=51 src=\"./images/gfx13.gif\">"+
			"</div>"+
			"<div id=row1a>"+
				"<img height=32 width=305 src=\"./images/gfx6.gif\" alt=\"Trinity Lutheran Church of Hovland, MN\">"+
			"</div>"+
		"</div>"+
		"<div id=row2>");
	for(var i=0; i<Title.length; i++)
		document.write(
			"<a href=\""+Links[i]+"\">"+
				"<div id=btn"+i+" onmouseover=\"mouseEvent(0,'btn"+i+"'); window.status=location\" onmouseout=\"mouseEvent(1,'btn"+i+
				"')\" onmousedown=\"mouseEvent(2,'btn"+i+
				"')\" title=\""+Alt[i]+"\">"+Title[i]+
			"</div></a>");
	if(pageNumber != 5)
		document.write(
		"</div>"+
		"<div id=row3>"+
			"<div id=row3a style=\"color: "+shadowColor+"\">"+((pageNumber >= 0)? Title[pageNumber] : "Webside Administrator")+
			"</div>"+
			"<div id=row3b>"+((pageNumber >= 0)? Title[pageNumber] : "<font style='color: #000066'>Webside Administrator</font>")+
			"</div><br><br>");
	if(!complete)
		return false;
	var element = document.getElementById("row3");
	element.style.backgroundColor = pageColor;
	element.style.color = textColor;
}

function linkBar()
{
	var data = [ 66,54,110,100,108,96,60,66,54,88 ];
	document.write("<div id='frame2_row2' style='position: absolute; width: 852; height: 25'>");
	var j = 23;
	for(var i=0; i<Title.length; i++)
	{
		document.write(
			"<a href=\""+Links[i]+"\">"+
				"<div id=btn"+i+" style='left: "+j+"; width: "+data[i]+
				"' onmouseover=\"mouseEvent(0,'btn"+i+"'); window.status=location\" onmouseout=\"mouseEvent(1,'btn"+i+"')\" onmousedown=\"mouseEvent(2,'btn"+i+
				"')\" title=\""+Alt[i]+"\">"+Title[i]+
				"</div></a>");
		j += data[i];
	}
}

function finishUp(hgt)
{
	document.write("</div></div><div id=row4>");
	if(hgt)
	{
		var e = document.getElementById("row4");
		e.style.position = "absolute";
		e.style.top = 30+hgt+"px";
	}
	for(i=0; i<Title.length; i++)
	{
		document.write("&nbsp;<a href=\""+Links[i]+"\" style='text-decoration: none; color: #808080' title=\""+Alt[i]+"\">"+Title[i]);
		document.write(((i == Title.length-1)?"</a>&nbsp;":"</a>&nbsp;|"));
	}
	document.write("<br>Last edit: " + document.lastModified+"<div id='row5'></div></div>");
}

function setCookie(name, value) 
{
	var thisMoment = new Date();
	thisMoment.setFullYear(thisMoment.getFullYear()+1);
  document.cookie = name + "=" + escape(value) + "; expires=" + thisMoment.toGMTString() + "; path=/";
}

var name = "admin";
function deleteCookie(name) 
{
  if (getCookie(name)) 
		document.cookie = name + "=0; expires=Sat, 01 Jan 2000 00:00:01 GMT";
}

function getCookie(name) 
{
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) 
	{
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function getCookieVal(offset)
{
	var str = document.cookie.indexOf(";", offset);
	if(str==-1) str = document.cookie.length;
	return unescape(document.cookie.substring(offset, str));
}

function mouseEvent(eventNum, eventID)
{
	var e = document.getElementById(eventID);
	switch(eventNum)
	{
		case 0:
			e.style.backgroundImage = "url(images/hover.bmp)";
			e.style.cursor = "pointer";
			break;
		case 1:
			e.style.backgroundImage = "none";
			e.style.cursor = "default";
			break;
		case 2:
			e.style.backgroundImage = "url(images/pressed.bmp)";
			break;
	}
}

function pageMap(num)
{
	if(num)
	{
		var newwin = window.open("","_blank","width=640,height=480,scrollbars=yes");
		var s="<font style='font-family:arial;font-size:12px;color:#0000FF'>These links a used on this page...</font><br><br>";
		for(var i=0; i<document.links.length; i++)
		{
			var p = document.links[i];
			if(p.title == "")
				p.title = "undefined";
			s += "<a href=\""+p.href+"\"><font style='font-family:arial;font-size:12px;color:#000080'>"+p.title+"</font></a><br>\n";
		}
		newwin.document.write(s);
		newwin.window.title = "hello";
		newwin.document.bgColor = "#f0f0f0";
	}	
}
