// SHOW BACKGROUND BEFORE HTML
function preloadBGImage(){
	//window.document.getElementById('field-outter').style.opacity = 1;
	//window.document.getElementById('field-outter').style.filter = "alpha(opacity=100)";
	/*
	if(document.getElementById){
		var divObj = window.document.getElementById('field-outter');
		if(divObj){
			divObj.style.visibility = 'visible';
		}
	} else {
		var divVis = document.field-outter.visibility;
		if(divVis){
			divVis = 'visible';
		} else {
			divVis = document.all.field-outter.style.visibility;
			 if(divVis) divVis = 'visible';
		}
	}*/
}

var subMenuActiveBtn = false;
var subMenuCatchLifespan = 1000;
var subMenuCatch = false;

function showDropDown(arKey, btnObj){
	keepSubNavAlive();
	if(subMenuActiveBtn) subMenuActiveBtn.className = subMenuActiveBtn.className.replace(' tmpSubNavActive', '');
	var container = window.document.getElementById('subnav');
	container.style.height = '0';
	container.style.display = 'block';
	var containerULs = container.getElementsByTagName('ul');
	var count = containerULs.length;
	for(var i = 0; i < count; i++){
		containerULs[i].style.display = 'none';
	}
	var objId = 'subnav_pId_'+arKey;
	objId = window.document.getElementById(objId);
	if(objId){
		container.style.height = 'auto';
		objId.style.display = 'block';
		subMenuActiveBtn = btnObj;
		subMenuActiveBtn.className = btnObj.className + ' tmpSubNavActive';
		//btnObj.onmouseout = function(){
		//	subMenuCatch = setTimeout("hideSubNav()", subMenuCatchLifespan);
		//}
	}
}

function hideSubNav(){
	if(subMenuCatch){
		var container = window.document.getElementById('subnav');
		container.style.display = 'none';
		clearTimeout(subMenuCatch);
		if(subMenuActiveBtn.className) subMenuActiveBtn.className = subMenuActiveBtn.className.replace(' tmpSubNavActive', '');
	}
}

function keepSubNavAlive(){
	clearTimeout(subMenuCatch);
	subMenuCatch = false;
}

function killSubNav(){
	subMenuCatch = setTimeout("hideSubNav()", subMenuCatchLifespan);
}
