function initRollovers() {
	if (!document.getElementById) return

	var aPreLoad = new Array();
	var sTempSrc;
	var sTempBg;
	var aBg = 'url(/common/images/lnav_bg_03_o.gif) repeat-y' ;
	var aImages = document.getElementsByTagName('img');
	var aInput = document.getElementsByTagName('input');
	var aList = document.getElementsByTagName('li');
	var aDt = document.getElementsByTagName('dt');
	var aSpan = document.getElementsByTagName('span');

	//各コンテンツのbodyのid名をセット
	var gContents = ['home','about','news','ir','csr','company'];
	//body要素のidを取得
	var cId = document.getElementsByTagName('body')[0].id;
	if (cId.indexOf('-') == '-1') {
		var cPage = new Array();
		cPage[0] = cId;
	} else {
		var cPage = cId.split('-');
	}
	var cLocal = cId.substring(cId.indexOf('-')+1, cId.indexOf('-')+3);
	var cLocalSecond = cId.substring(cId.lastIndexOf('-')+1, cId.lastIndexOf('-')+3);

	for (var i = 0; i < aSpan.length; i++) {
		if (aSpan[i].className == 'lastitem02') {
			aSpan[i].parentNode.style.backgroundRepeat = 'no-repeat';
		}
	}

	//全てのimage要素を洗い出す
	for (var i = 0; i < aImages.length; i++) {
		//image要素のclass名がimgoverの場合処理をする
		if (aImages[i].className.match('imgover')) {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var itype = src.substring(src.lastIndexOf('nav')-1, src.lastIndexOf('nav')+3);
			var inom = src.substring(src.lastIndexOf('.')-2, src.lastIndexOf('.'));
			var cnom = parseInt(inom,10);
			var hsrc = src.replace(ftype, '_o'+ftype);

			if (itype == 'gnav') {
				if (gContents[cnom] == cPage[0]) {
					aImages[i].setAttribute('src', hsrc);
				}
			}

			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('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
	//全てのinput要素を洗い出す
	for (var i = 0; i < aInput.length; i++) {
		//image要素のclass名がimgoverの場合処理をする
		if (aInput[i].className.match('imgover')) {
			var src = aInput[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var itype = src.substring(src.lastIndexOf('nav')-1, src.lastIndexOf('nav')+3);
			var inom = src.substring(src.lastIndexOf('.')-2, src.lastIndexOf('.'));
			var cnom = parseInt(inom,10);
			var hsrc = src.replace(ftype, '_o'+ftype);

			if (itype == 'gnav') {
				if (gContents[cnom] == cPage[0]) {
					aInput[i].setAttribute('src', hsrc);
				}
			}

			aInput[i].setAttribute('hsrc', hsrc);

			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;

			aInput[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	

			aInput[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}

	//全てのdt要素を洗い出す
	for (var i = 0; i < aDt.length; i++) {
		var cName = aDt[i].className;
		//dt要素のclass名にitemがある場合処理をする
		if (cName.substring(0,4) == 'item') {
				if (cName.substring(4,6) == cPage[1]) {
					aDt[i].style.background = aBg;
				}

			aDt[i].onmouseover = function() {
				sTempBg = this.className;
				this.className = 'stay';
			}
			aDt[i].onmouseout = function() {
				this.className = sTempBg;
			}
		}
	}

	//全てのli要素を洗い出す
	for (var i = 0; i < aList.length; i++) {
		var cName = aList[i].className;
		//li要素のclass名にitemがある場合処理をする
		if (cName.substring(0,4) == 'item') {
			if (cName.substring(4,6) == cPage[1]) {
				aList[i].style.background = aBg;
			}

			aList[i].onmouseover = function() {
				sTempBg = this.className;
				this.className = 'stay';
			}
			aList[i].onmouseout = function() {
				this.className = sTempBg;
			}
		}

		//li要素のclass名にtypeがある場合処理をする
		if (cName.match('type')) {
			if (cPage[1] == cName.substring(4,6)) {
				aList[i].parentNode.parentNode.style.display = 'block';
				if (navigator.appName.match('Internet Explorer')) {
					if (aList[i].parentNode.parentNode.parentNode.childNodes[0].firstChild.className == 'lastitem01') {
						aList[i].parentNode.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].style.background = 'url(/common/images/lnav_bg_05.gif) no-repeat bottom';
						aList[i].parentNode.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].style.paddingBottom = '5px';
					}
				} else {
					if (aList[i].parentNode.parentNode.parentNode.childNodes[1].firstChild.className == 'lastitem01') {
						aList[i].parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].style.background = 'url(/common/images/lnav_bg_05.gif) no-repeat bottom';
						aList[i].parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].style.paddingBottom = '5px';
					}
				}
			} else {
				aList[i].parentNode.parentNode.style.display = 'none';
				if (navigator.appName.match('Internet Explorer')) {
					if (aList[i].parentNode.parentNode.parentNode.childNodes[0].firstChild.className == 'lastitem01') {
						aList[i].parentNode.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].style.background = 'none';
					}
				} else {
					if (aList[i].parentNode.parentNode.parentNode.childNodes[1].firstChild.className == 'lastitem01') {
						aList[i].parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].style.background = 'none';
					}
				}
			}
			aList[i].onmouseover = function() {
				sTempBg = this.style.backgroundColor;
				this.style.backgroundColor = '#e7e7e7';
			}
			aList[i].onmouseout = function() {
				if (sTempBg != '#fff') {
					this.style.backgroundColor = sTempBg;
				} else {
					this.style.backgroundColor = '#e7e7e7';
				}
			}
		}

		//li要素のclass名内に'type'があり、class番号とbody番号が一致すれば処理をする
		if ((cName.substring(0,4) == 'type') && (cName.substring(4,6) == cPage[1])) {
			var cSecondNo = cName.substring(7,9);
			if (cSecondNo == cPage[2]) {
				aList[i].style.backgroundColor = '#e7e7e7';
			}
		}
	}
}



/*---------------------------------------------
ページ読み込みの際の処理
---------------------------------------------*/
//IE6での背景画像ちらつき解消
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

//function initRollovers();呼び出し
try{
	window.addEventListener("load",initRollovers,false);
}catch(e){
	window.attachEvent("onload",initRollovers);
}

