$(document).ready(function() {
	$('img.menuItem').mouseover(function() {
		$(this).each(function() {
			this.srcOut = this.src;
			this.srcOver = this.src.substring(0, this.src.lastIndexOf('.png')) + '_over' + '.png';
			this.src = this.srcOver;
		});
	});
		$('img.menuItem').mouseout(function() {
		$(this).each(function() {
			 this.srcOut  = this.src.substring(0, (this.src.lastIndexOf('.png')-5)) + '.png';
			 this.src = this.srcOut;
		});
	});
});

/* makes links with attribute rel="external" open in a new window */
function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i = 0; i < anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank"; 
		}
	}
}

if (window.addEventListener) {
	window.addEventListener('load', externalLinks, false); 
} else if (window.attachEvent) { 
	window.attachEvent('onload', externalLinks);
}

String.prototype.trim = function () {
    return this.replace(/^\s*/,'')
                     .replace(/\s*$/,'');
};