// JavaScript Document

document.write("<img src='/cgi-bin/analysis/acc_ngo/acclog.cgi?" + "referrer=" + document.referrer + "&" + "width=" + screen.width + "&" + "height=" + screen.height + "&" + "color=" + screen.colorDepth + "' alt='' width='1' height='1' id='acclog' style='display:block;position:absolute;left=0;top=0;visibility:hidden'>");

/*
*	Licensed under the MIT License:
*	http://www.opensource.org/licenses/mit-license.php
*/

(function(){
	function rollover(){
		var targetClassName = "imgov";
		var suffix = "_ov";

		var overReg = new RegExp("^(.+)(\\.[a-z]+)$");
		var outReg = new RegExp("^(.+)" + suffix + "(\\.[a-z]+)$");

		var preload = new Array();
		var images = document.getElementsByTagName("img");

		for (var i = 0, il = images.length; i < il; i++) {
			var classStr = images[i].getAttribute("class") || images[i].className;
			var classNames = classStr.split(/\s+/);
			for(var j = 0, cl = classNames.length; j < cl; j++){
				if(classNames[j] == targetClassName){

					//preload
					preload[i] = new Image();
					preload[i].src = images[i].getAttribute("src").replace(overReg, "$1" + suffix + "$2");

					//mouseover
					images[i].onmouseover = function() {
						this.src = this.getAttribute("src").replace(overReg, "$1" + suffix + "$2");
					}

					//mouseout
					images[i].onmouseout = function() {
						this.src = this.getAttribute("src").replace(outReg, "$1$2");
					}
				}
			}
		}
		
		
		//form type=image
		var typeimg = document.getElementsByTagName("input");

		for (var i = 0, il = typeimg.length; i < il; i++) {
			var classStr = typeimg[i].getAttribute("class") || typeimg[i].className;
			var classNames = classStr.split(/\s+/);
			for(var j = 0, cl = classNames.length; j < cl; j++){
				if(classNames[j] == targetClassName){

					//preload
					preload[i] = new Image();
					preload[i].src = typeimg[i].getAttribute("src").replace(overReg, "$1" + suffix + "$2");

					//mouseover
					typeimg[i].onmouseover = function() {
						this.src = this.getAttribute("src").replace(overReg, "$1" + suffix + "$2");
					}

					//mouseout
					typeimg[i].onmouseout = function() {
						this.src = this.getAttribute("src").replace(outReg, "$1$2");
					}
				}
			}
		}
		
	}

	function addEvent(elem,event,func){
		if(elem.addEventListener) {
			elem.addEventListener(event, func, false);
		}else if(elem.attachEvent) {
			elem.attachEvent("on" + event, func);
		}
	}
	addEvent(window,"load",rollover);
})();

