/**********************************************************
* onload */

function addEvent(elm,listener,fn){
	try{
		elm.addEventListener(listener,fn,false);
	}catch(e){
		elm.attachEvent("on"+listener,fn);
	}
}




/**********************************************************
* MM */

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.subwin = window.open(theURL,winName,features);
  subwin.focus();
}




/**********************************************************
* rollover */

function initOvers() {
	initRollovers('header-navi');
	initRollovers('global-navi');
}

function initRollovers(idName) {
	if(document.getElementsByTagName) {
	
		var aPreLoad = new Array();
		var sTempSrc;
		var aImages = document.getElementById(idName).getElementsByTagName('img');

		for (var i = 0; i < aImages.length; i++) {
			if (aImages[i].className == 'rollover') {
				var src = aImages[i].getAttribute('src');
				var ftype = src.substring(src.lastIndexOf('.'), src.length);
				var hsrc = src.replace(ftype, '_over'+ftype);

				aImages[i].setAttribute('hsrc', hsrc);
				
				aPreLoad[i] = new Image();
				aPreLoad[i].src = hsrc;
				
				aImages[i].onmouseover = function() {
					sTempSrc = this.getAttribute('src');
					this.setAttribute('src', this.getAttribute('hsrc'));
				}	
				
				aImages[i].onmouseout = function() {
					if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype);
					this.setAttribute('src', sTempSrc);
				}

			}
		}

	}
}

addEvent(window,"load",function(){initOvers()});