try {
document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
function globalNavigation(){
	this.msecShow = 500;
	this.msecHide = 1000;
	this.bgColorN = "";
	this.bgColorO = "#e7e7e7";
	this.ua = navigator.userAgent;
	this.ver = navigator.appVersion;
	this.isIE50  = (this.ver.indexOf('MSIE 5.0') != -1) ? true : false;
	this.isIE5x  = (this.ver.indexOf('MSIE 5.') != -1) ? true : false;
	this.isIE6x  = (this.ver.indexOf('MSIE 6.') != -1) ? true : false;
	this.showTimer;
	this.hideTimer;
	this.shim;
	
	this.drillDownFlag = true;
}

globalNavigation.prototype = {
	init : function(){
		if(!document.getElementById){
			return false;
		}
		if(this.isIE5x || this.isIE6x){
			var iframe = document.createElement('iframe');
			iframe.id = 'shim';
			iframe.src = 'javascript:false;';
			iframe.style.position = 'absolute';
			iframe.style.top = '0px';
			iframe.style.left = '0px';
			iframe.style.visibility = 'hidden';
			iframe.style.backgroundColor = '#ffffff';
			this.$('rnHeadNav0102').appendChild(iframe);
			this.shim = this.$('shim');
		}
		
		this.globalNavi.setup = {
			tabs : this.$('rnHeadNav0101').getElementsByTagName('img'),
			pages : this.$('rnHeadNav0102').getElementsByTagName('ul')
		};
		
		this.subNavi.setup = {
			tabs : this.$('rnHeadNav0102').getElementsByTagName('ul')
		};
		
		this.globalNavi.init();
		
		if(this.drillDownFlag){
			this.subNavi.init();
		}
	},
	
	globalNavi : {
		init : function(){
			var parent = this.setup.tabs;
			var menu = this.setup.pages;
			var spacer = JLJS_gnavi.$('menuskip');
	
			for(i=0; i<menu.length; i++){
				if(menu[i] == spacer){
					break;
				}
				parent[i].onmouseover = function(){
					if(this.src.indexOf('_s.') == -1){
						JLJS_gnavi.changeImage(this, '_o.');
					}
					JLJS_gnavi.globalNavi.check(this,'show');
					return false;
				};
				parent[i].onmouseout = function(event){
					if(this.src.indexOf('_s.') == -1){
						JLJS_gnavi.changeImage(this, '_n.');
					}
					clearTimeout(JLJS_gnavi.showTimer);
					return false;
				};
				if(JLJS_gnavi.$('rnHeadNav01')){
					JLJS_gnavi.$('rnHeadNav01').onmouseover = function(){
						clearTimeout(JLJS_gnavi.hideTimer);
						return false;
					};
					JLJS_gnavi.$('rnHeadNav01').onmouseout = function(){
						clearTimeout(JLJS_gnavi.showTimer);
						JLJS_gnavi.globalNavi.check(this,'hide');
						return false;
					};
				}
			}
		},
		
		check : function(obj, toggle){
			var parent = this.setup.tabs;
			var menu = this.setup.pages;
			var spacer = JLJS_gnavi.$('menuskip');
			var area = JLJS_gnavi.$('rnHeadNav01');
			
			if(toggle == 'show'){
				JLJS_gnavi.showTimer = setTimeout(function(){
					for(i=0; i<parent.length; i++){
						if(obj == parent[i]){
							JLJS_gnavi.changeImage(obj, '_s.');
							JLJS_gnavi.globalNavi.show(menu[i]);
							menu[i].style.position = 'static';
							JLJS_gnavi.globalNavi.hide(spacer);
							if(menu[i] == JLJS_gnavi.$('rnHeadCrdMenu')){
								JLJS_gnavi.globalNavi.show(JLJS_gnavi.$('rnHeadNavCard02'));
							}
						}else{
							JLJS_gnavi.changeImage(parent[i], '_n.');
							if(menu[i]){
								menu[i].style.position = 'absolute';
								menu[i].style.top = '0px';
								menu[i].style.left = '0px';
								JLJS_gnavi.globalNavi.hide(menu[i]);
								if(menu[i] == JLJS_gnavi.$('rnHeadCrdMenu')){
									JLJS_gnavi.globalNavi.hide(JLJS_gnavi.$('rnHeadNavCard02'));
								}
							}
						}
					}
				},JLJS_gnavi.msecShow);
			}else if(toggle == 'hide'){
				JLJS_gnavi.hideTimer = setTimeout(function(){
					for(i=0; i<parent.length; i++){
						JLJS_gnavi.changeImage(parent[i], '_n.');
						JLJS_gnavi.globalNavi.hide(menu[i]);
						if(menu[i] == JLJS_gnavi.$('rnHeadCrdMenu')){
							JLJS_gnavi.globalNavi.hide(JLJS_gnavi.$('rnHeadNavCard02'));
						}
						if(menu[i] == spacer){
							menu[i].style.position = 'absolute';
							menu[i].style.top = '0px';
							menu[i].style.left = '0px';
						}
						JLJS_gnavi.globalNavi.show(spacer);
					}
				},JLJS_gnavi.msecHide);
			}
			
			spacer.style.position = '';
		},
		
		show : function(obj){
			if(!obj){
				return false;
			}
			if(obj != JLJS_gnavi.$('menuskip')){
				obj.style.visibility = "visible";
			}else{
				obj.style.display = "block";
			}
		},
		
		hide : function(obj){
			if(!obj){
				return false;
			}
			if(obj != JLJS_gnavi.$('menuskip')){
				obj.style.visibility = "hidden";
			}else{
				obj.style.display = "none";
			}
		}
	},
	
	subNavi : {
		init : function(){
			var parent = this.setup.tabs;
			var link = new Array;
	
			for(i=0; i<parent.length; i++){
				link[i] = new Array();
				link[i] = parent[i].childNodes;
				for(j=0; j<link[i].length; j++){
					if((link[i][j]) && (link[i][j].tagName == 'LI' || link[i][j].tagName == 'li')){
						link[i][j].onmouseover = function(){ JLJS_gnavi.subNavi.show(this); return false; };
						link[i][j].onmouseout = function(){ JLJS_gnavi.subNavi.hide(this); return false; };
					}
				}
			}
		},
		
		show : function(obj){
			var ele = obj.childNodes;
			for(i=0; i<ele.length; i++){
				if(ele[i].className == 'rnHeadNav0103'){
					JLJS_gnavi.shimToggle(ele[i],'hidden','visible');
					ele[i].style.visibility = 'visible';
					obj.style.backgroundColor = JLJS_gnavi.bgColorO;
					return true;
				}
			}
		},
		
		hide : function(obj){
			if(JLJS_gnavi.isIE5x || JLJS_gnavi.isIE6x){
				if(!(obj.contains(window.event.toElement))){
					var ele = obj.childNodes;
					for(i=0; i<ele.length; i++){
						if(ele[i].className == 'rnHeadNav0103'){
							JLJS_gnavi.shimToggle(ele[i],'visible','hidden');
							ele[i].style.visibility = 'hidden';
							obj.style.backgroundColor = JLJS_gnavi.bgColorN;
							return true;
						}
					}
				}
			}else{
				var ele = obj.childNodes;
				for(i=0; i<ele.length; i++){
					if(ele[i].className == 'rnHeadNav0103'){
						JLJS_gnavi.shimToggle(ele[i],'visible','hidden');
						ele[i].style.visibility = 'hidden';
						obj.style.backgroundColor = JLJS_gnavi.bgColorN;
						return true;
					}
				}
			}
		}
	},
	
	shimToggle : function(obj, select, iframe){
		if(this.isIE50){
			var sele = document.getElementsByTagName('select');
			for(j=0; j<sele.length; j++){
				sele[j].style.visibility = select;
			}
		}else if(this.isIE5x || this.isIE6x){
			var shim = JLJS_gnavi.$('shim');
			shim.style.top = obj.offsetTop + 'px';
			shim.style.left = obj.offsetLeft + 'px';
			shim.style.width = obj.offsetWidth + 'px';
			shim.style.height = obj.offsetHeight + 'px';
			shim.style.zIndex = obj.style.zIndex;
			shim.style.visibility = iframe;
		}
	},
	
	$ : function(id){
		return document.getElementById(id);
	},
	
	changeImage : function(img, chgStat){
		var states = '';
		if(img.src.indexOf('_s.') != -1){
			states = '_s.';
		}else if(img.src.indexOf('_n.') != -1){
			states = '_n.';
		}else if(img.src.indexOf('_o.') != -1){
			states = '_o.';
		}
		
		if(states){
			img.setAttribute('src', img.src.replace(states, chgStat));
		}
	}
}

var JLJS_gnavi = new globalNavigation;
JLJS.addOnload(function(){JLJS_gnavi.init();});
