<!-- hide script from old browsers

window.status = "Welcome to Madison Avenue Presbyterian Church";


var worship = "03_worship";
var education = "04_education";
var outreach = "05_outreach";
var life = "06_life";
var sermons = "07_sermons";


var d = document;
var title = d.title.substring(37,100);;
var url = d.location.href;
var endChar = url.substr(url.length-1);



function getPage(whichPage){
			var isIndex = url.indexOf("index");
		if (endChar == "/" || isIndex >= 0){
			var directory = "html/" + whichPage + "/";
			}else if(endChar == "p"){
				directory = "../html/" + whichPage + "/";
				}else{
				directory = "../" + whichPage + "/";
				}
	var whichPage = whichPage.replace("_", "a_");
	window.location = directory + whichPage + "-home.htm";
	}




// Main nav change tab colors
function changeProperty(element, color){
	var activetab = document.getElementById(element);
	activetab.style.backgroundColor = color;
//	document.getElementById('rule').style.backgroundColor = color;
}

	var mainNav = new Array()
		mainNav[0] = "worship"
		mainNav[1] = "education"
		mainNav[2] = "outreach"
		mainNav[3] = "congregation"
		mainNav[4] = "sermons"

// Determine size of main nav tabs
function sizeTabs() {
	if(window.innerWidth){
		var screenW = parseInt(window.innerWidth);
		var screenH = parseInt(window.innerHeight);
		}else if(document.all){
			var screenW = parseInt(document.body.clientWidth);
			var screenH = parseInt(document.body.clientHeight);
//			var tabWidth = parseInt((screenW-132)/5);
//			for (each in mainNav)
//				document.getElementById(mainNav[each]).style.width = tabWidth + "px";
//				document.getElementById(mainNav[each]).style.display = "block";
			}
		
		}










// end hiding script from old browsers -->