
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

//addLoadEvent(function() {
	// Pop Menus -- thank you, projectseven!
	//P7_initPM(1, 0, 1, -20, 10);
//});

//addLoadEvent(function() {
	// Equal Columns -- thank you, projectseven!
	//P7_equalCols2(1, 'pageleafheightdiv', 'DIV', 'pagediv', 'DIV');

//});



function $(n) {
	return document.getElementById(n);
}

function KDS_INIT() {
	// calculate the desired height for our pageleafdiv,
	// and use the handy P7 equalcolumns function to animate the height.
	if ($('pageleafdiv')) {
		var leaftop = $('pageleafdiv').offsetTop;
		var cleartop = $('pagecleardiv').offsetTop;
		var desiredheight = (cleartop - leaftop) + 20;
		P7_eqA2('pageleafdiv', 0, desiredheight);
	}
	if ($('homepage')) {
		// equalize the height of the three homepage custom panels
		P7_equalCols2(1, 'homepaneldiv1', 'P', 'homepaneldiv2', 'P', 'homepaneldiv3', 'P');
	}
	if (!$('homepage')) {
		// on all pages except the homepage, make the headerdiv clickable!
		$('headerdiv').onclick = function() { window.location='/'; };
		$('headerdiv').style.cursor='pointer';
		$('headerdiv').title='Return to Homepage';
	}
	// on homepage, make the panel H3s clickable
	if ($('homepage')) {
		var h;
		
		///////////////////////////
		h = $('homepaneldiv1').getElementsByTagName('H3')[0];
		h.onclick = function() {
			window.location='/who_we_are/index.asp';
		};
		h.style.cursor='pointer';
		h.title='Who We Are';
		
		///////////////////////////
		h = $('homepaneldiv2').getElementsByTagName('H3')[0];
		h.onclick = function() {
			window.location='/what_we_do/index.asp';
		};
		h.style.cursor='pointer';
		h.title='What We Do';
		
		///////////////////////////
		h = $('homepaneldiv3').getElementsByTagName('H3')[0];
		h.onclick = function() {
			window.location='/how_to_help/online_donation.asp';
		};
		h.style.cursor='pointer';
		h.title='How to Contribute';
		
		
	}
}


