// mYm global.js 2.1 - by brent@mimoYmima.com - edited Sept 28, 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=840,height=555,scrollbars,resizable");
}



// Any Anchor With the Class of "Popup2" will open in a new window ~ by Jeremy Keith
function makePopUp2() {
	if (!document.getElementsByTagName) return false;
	var lnks = document.getElementsByTagName("a");
	for (var i=0; i<lnks.length; i++) {
		if (lnks[i].getAttribute("class") == "Popup2") {
			lnks[i].onclick = function() {
				popUp2(this.getAttribute("href"));
				return false;
			}
		}
	}
}
// Add Attributes to the PopUp
function popUp2(winURL) {
  window.open(winURL,"Popup2","width=550,height=250,scrollbars,resizable");
}



// Add Load Events
addLoadEvent(makePopUp);
addLoadEvent(makePopUp2);


//jQuery Stuff - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// custom show-hide script in jQuery

$(document).ready(function() {
	// hides stuff with the class of 'Hide' as soon as the DOM is ready
	$('.Hide').hide();
	
	// add the class to make the headings look like links
	$('.Toggle').addClass('MakeLink');
	
	// toggles the Hidden content upon clicking the link 
	$('.Toggle').click(function() {
    	$(this).next().slideToggle('normal');
	});
});
