

var $ = function(n) {
	return document.getElementById(n);
};


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() {
	KDS_INIT();
});


/* ----------------------------------------------------------- */



function KDS_INIT() {
		
	// on all pages except the homepage, make the masthead H1 clickable!
	if (!$('homepage')) {
		//var e = $('masthead').getElementsByTagName('h1')[0];
		var e = $('masthead');
		e.onclick = function() { window.location='../index.asp'; };
		e.style.cursor='pointer';
		e.title='Return to Homepage';
	}

	//KDS_SETCOLS();
	
};


function KDS_SETCOLS() {
	
	// Set colums to equal heights. use the P7 script after determining dimensions manually.
	// To animate, set second parameter to 0.  For no animation, set to desired final height.
	
	// Here, we are only setting the height of the "#decoration" div to match the total content region.
	var theDesiredHeight = $('masthead-container').offsetHeight + $('content-container').offsetHeight;

	// it may be possible that the navigation height exceeds all content height!
	var theNavigationHeight = $('navigation').offsetHeight;
	if (theNavigationHeight > theDesiredHeight) {
		theDesiredHeight = theNavigationHeight;
	}
	
	// use P7 function to set desired heights
	P7_eqA2('decoration', theDesiredHeight, theDesiredHeight);
	
};








// Create our namespace! and provide common function references!
//var KDS = KDS || { $E : YAHOO.util.Event , $D : YAHOO.util.Dom , $G : YAHOO.util.Dom.get , $ : YAHOO.util.Dom.get };
var KDS = KDS || {};



// Declare individual apps as "inline" functions and invoke!
KDS.Page = function() {
	// privates?
	//
	//
	// return!
	// public return!
	return {
		
		init : function() {
			//
			//
		}


	};

}();

