// requires prototype.js

Event.observe(window, "load", function () {
	$A(document.getElementsByClassName("top-index")).each( function (top_index) {
		$A(top_index.getElementsByClassName("introswf")).each( function (introswf) {
			var anchors = introswf.getElementsByTagName("a");
			for (var i = 0; i < anchors.length; ++i) {
				var anchor = anchors[i];
				var className = anchor.getAttribute("class") || anchor.getAttribute("className");
				if (className == "link_to_introswf") {
					anchor.onclick = function () {
						var href = this.getAttribute("href");
						var w = window.open(href, "introswf", "width=840, height=525, menubar=no, toolbar=no, scrollbar=yes");
						if (w) {
							w.focus();
						}
						return !w;
					};
				}
			}
			$A(introswf.getElementsByClassName("introswf-image")).each( function (image) {
				image.onmouseover = function () {
					this.src = this.src.replace(/\.png$/, "_rollover.png");
				};
				image.onmouseout = function () {
					this.src = this.src.replace(/_rollover\.png$/, ".png");
				};
				// prefetch
				var rollover_image = document.createElement("img");
				rollover_image.src = image.src.replace(/\.png$/, "_rollover.png");
			});
		});
	});
});
