Event.observe(window, 'load', function() {
	$$('a[href^=#]:not([href=#])').each(function(element) {
		element.observe('click', function(event) {
			new Effect.ScrollTo(this.hash.substr(1));
			Event.stop(event);
		}.bindAsEventListener(element))
	})
})

function rollover() {
	var image = document.getElementsByTagName("img");
	for (i=0; i<image.length; i++) {
		if (image[i].getAttribute("src").match(/_off\./)){
	 		image[i].onmouseover = function() {
	 			this.setAttribute("src", this.getAttribute("src").replace("_off.","_ov."));
	 		}
	 		image[i].onmouseout = function() {
	 			this.setAttribute("src", this.getAttribute("src").replace("_ov.","_off."));
	 		}
		}
	}
}
Event.observe(window, 'load', rollover, false);


function makeChild (url, windowname, width, height) {
	var features = "location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
	if (width) {
		if (window.screen.width > width)
		features += ", left=" + (window.screen.width-width)/2;
		else width = window.screen.width;
		features += ", width=" + width;
	}
	if (height) {
		if (window.screen.height > height)
		features += ", top=" + (window.screen.height-height)/2;
		else height = window.screen.height;
		features += ", height=" + height;
	}
	var newWindow = window.open (url, windowname, features);
	newWindow.focus();
}
