// mYm global.js 2.0 - by brent@mimoYmima.com - edited April 7, 2007

// Add page load events ~ by Simon Willison
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
// Functions added at bottom of this document


// Any Anchor With the Class of "Popup" will open in a new window ~ by Jeremy Keith
function makePopUp() {
	if (!document.getElementsByTagName) return false;
	var lnks = document.getElementsByTagName("a");
	for (var i=0; i<lnks.length; i++) {
		if (lnks[i].getAttribute("class") == "Popup") {
			lnks[i].onclick = function() {
				popUp(this.getAttribute("href"));
				return false;
			}
		}
	}
}
// Add Attributes to the PopUp
function popUp(winURL) {
  window.open(winURL,"Popup","width=800,height=600,scrollbars,resizable");
}

// preload these images on all pages
//function preLoadImages() {
//	if(document.images) {
//		image1 = newImage(“/images/test.jpg”);
//	}
//}

// Add Load Events
addLoadEvent(makePopUp);