
/* ----------------------------------------------------------- */

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() {
		
	// initialize the P7 PMM menus
	P7_initPM(1, 0, 1, -20, 10);
	
	// on all pages except the homepage, make the masthead clickable! (the logo, actually)
	if (!$('homepage')) {
		var h = $('header').getElementsByTagName('H1')[0];
		h.onclick = function() { window.location='/index.asp'; };
		h.style.cursor='pointer';
		h.title='Return to Homepage';
	}

	// new window function
	var links = document.getElementsByTagName ('a');
	for (var i=0;i < links.length;i++) {
		if (links[i].className == 'new-window') {
			links[i].onclick = function() {
				window.open(this.href);
				return false;
			};
		}
	}
		
};











/* ----------------------------------------------------------- */
// OPTIONAL KDS PROGRAMMING SECTION:

// 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 || { $ : document.getElementById };


// Declare individual apps as "inline" functions and invoke!
KDS.Page = function() {
	// privates?
	//
	//
	// public return!
	return {
		
		init : function() {
			//
			//
		}

	};

}();


