try {
document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
function subNavigation(){
	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.shim;
	
	this.drillDownFlag = true;
	
	this.maxWidth = 945;
	this.elemWidth = 235;

}

subNavigation.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.subNavi.setup = {
			tabs : JLJS_snavi.$('rnHeadNav0102').getElementsByTagName('ul')
		};
		
		this.subNavi.init();
	},
	
	subNavi : {	
		init : function(){
			var parent = this.setup.tabs;
			var link = parent[0].childNodes;
	
			for(var i=0; i<link.length; i++){
				if((link[i].tagName == 'LI') || (link[i].tagName == 'li')){
					link[i].onmouseover = function(){ JLJS_snavi.subNavi.show(this); return false; };
					link[i].onmouseout = function(){ JLJS_snavi.subNavi.hide(this); return false; };
				}
			}
		},

		show : function(obj){
			var ele = obj.childNodes;
			for(var i=0; i<ele.length; i++){
				if(JLJS.classAttr.check(ele[i], 'rnHeadNav0103')){
					
					var elem_left = parseInt(obj.offsetLeft);
					
					if ((elem_left + JLJS_snavi.elemWidth) > JLJS_snavi.maxWidth){
						JLJS.classAttr.add(ele[i], "rnHeadNav0103Expansion");
					}
					ele[i].style.display = 'block';
					JLJS_snavi.shimToggle(ele[i],'hidden','visible');
					obj.style.backgroundColor = JLJS_snavi.bgColorO;
					return true;
				}
			}
		},
		
		hide : function(obj){
			if(JLJS_snavi.subNavi.isIE5x || JLJS_snavi.subNavi.isIE6x){
				if(!(obj.contains(window.event.toElement))){
					var ele = obj.childNodes;
					for(var i=0; i<ele.length; i++){
						if(JLJS.classAttr.check(ele[i], 'rnHeadNav0103')){
							JLJS_snavi.shimToggle(ele[i],'visible','hidden');
							obj.style.backgroundColor = JLJS_snavi.bgColorN;
							if(JLJS.classAttr.check(ele[i], 'rnHeadNav0103Expansion')){
								JLJS.classAttr.remove(ele[i], "rnHeadNav0103Expansion");
							}
							ele[i].style.display = 'none';
							return true;
						}
					}
				}
			}else{
				var ele = obj.childNodes;
				for(var i=0; i<ele.length; i++){
					if(JLJS.classAttr.check(ele[i], 'rnHeadNav0103')){
							JLJS_snavi.shimToggle(ele[i],'visible','hidden');
							obj.style.backgroundColor = JLJS_snavi.bgColorN;
							if(JLJS.classAttr.check(ele[i], 'rnHeadNav0103Expansion')){
								JLJS.classAttr.remove(ele[i], "rnHeadNav0103Expansion");
							}
							ele[i].style.display = 'none';
							return true;
					}
				}
			}
		}
	},
	
	shimToggle : function(obj, select, iframe){
		if(JLJS_snavi.isIE50){
			var sele = document.getElementsByTagName('select');
			for(var j=0; j<sele.length; j++){
				sele[j].style.visibility = select;
			}
		}else if(JLJS_snavi.isIE5x || JLJS_snavi.isIE6x){
			var shim = this.$('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);
	}
}

var JLJS_snavi = new subNavigation;
JLJS.addOnload(function(){if(JLJS_snavi.drillDownFlag){JLJS_snavi.init();}});
