(function (){

	var idList = new Array('g_navi'); //ロールオーバーさせる部分をidで指定
	var imgList = new Array();
	
	//現在のカテゴリーのボタン色を変更
	var imgActive = document.getElementById('g_navi').getElementsByTagName('img');
	
	if(siteCategory == 'top'){
		imgActive[0].src = imgActive[0].getAttribute('src').replace('_off.','_act.');
	} else 	if(siteCategory == 'company'){
		imgActive[1].src = imgActive[1].getAttribute('src').replace('_off.','_act.');
	} else 	if(siteCategory == 'service'){
		imgActive[2].src = imgActive[2].getAttribute('src').replace('_off.','_act.');
	} else 	if(siteCategory == 'faq'){
		imgActive[3].src = imgActive[3].getAttribute('src').replace('_off.','_act.');
	} else 	if(siteCategory == 'contact'){
		imgActive[4].src = imgActive[4].getAttribute('src').replace('_off.','_act.');
	}
	
	//ロールオーバー
	for( var n1=0 ; n1<idList.length ; n1++ ){
		if( document.getElementById(idList[n1]) != null ){
			imgList[n1] = document.getElementById(idList[n1]).getElementsByTagName('img');
			
			for( var n2=0 ; n2<imgList[n1].length ; n2++ ){ //img要素の数で繰り返し
				imgList[n1][n2].onmouseover = function mOver(){
					this.src = this.getAttribute('src').replace('_off.','_on.');
				}
				imgList[n1][n2].onmouseout = function mOut(){
					this.src = this.getAttribute('src').replace('_on.','_off.');
				}
			}
		}
	}
})();

