function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var aInputs = document.getElementsByTagName('input');

	doRollover(aImages);
	doRollover(aInputs);

	function doRollover(array) {
		for (var i = 0; i < array.length; i++) {
			if (array[i].className == 'rollover') {
				var src = array[i].getAttribute('src');
				var ftype = src.substring(src.lastIndexOf('.'), src.length);
				var hsrc = src.replace(ftype, '_2' + ftype);

				array[i].setAttribute('hsrc', hsrc);
				
				aPreLoad[i] = new Image();
				aPreLoad[i].src = hsrc;
				
				array[i].onmouseover = function() {
					sTempSrc = this.getAttribute('src');
					this.setAttribute('src', this.getAttribute('hsrc'));
				}
				
				array[i].onmouseout = function() {
					if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_2'+ftype, ftype);
					this.setAttribute('src', sTempSrc);
				}
			}
		}
	}
	initSelectMenu();
}
function initSelectMenu() {
	var num = 1;
	if (location.href.indexOf("/product/") > 0) {
		num = 2;
	} else if (location.href.indexOf("/service/") > 0) {
		num = 3;
	} else if (location.href.indexOf("/case/") > 0) {
		num = 4;
	} else if (location.href.indexOf("/company/") > 0) {
		num = 5;
	} else if (location.href.indexOf("/recruit/") > 0) {
		num = 6;	
	}
	var menu = document.getElementById("menu" + num);
	var src = menu.getAttribute('src');
	var ftype = src.substring(src.lastIndexOf('.'), src.length);
	var hsrc = src.replace(ftype, '_2' + ftype);
	if (num> 0) {
		menu.setAttribute("src", hsrc);
	}
}

window.onload = initRollovers;
///window.onload = initSelectMenu;