//顶部一级、二级菜单
var OutNavigationTimer ;
var OutSubNavigationTimer ;
var IsIE = navigator.userAgent.toUpperCase().indexOf("MSIE")>=0;
var IsIE6 = navigator.userAgent.toUpperCase().indexOf("MSIE 6")>=0;
function OverNavigation(obj,index){
	var navigation = document.getElementById("navigation");
	var left = 0;
	if(IsIE6 != 6)
		var left = navigation.parentNode.parentNode.offsetLeft + (IsIE?1:0);
	else
		var left = navigation.offsetLeft + navigation.parentNode.parentNode.offsetLeft + (IsIE?1:0);
	var top = navigation.offsetTop + 31;
	clearTimeout(OutNavigationTimer);
	clearTimeout(OutSubNavigationTimer);
	
	var subNavigation = document.getElementById("subNavigation");
	if(subNavigation.index > 0){ 
		var lastNavigation = document.getElementById("navigation"+subNavigation.index);
		lastNavigation.src = lastNavigation.src.replace("_S","_U");
	}
	obj.src = obj.src.replace("_U","_S");	
	var content = document.getElementById("subNavigation"+index).innerHTML;
	if(content!=""){
		subNavigation.innerHTML = content;
		subNavigation.className = "subNavigation";
		subNavigation.style.left= left + "px";
		subNavigation.style.top = top + "px";
	}else{
		subNavigation.innerHTML = "";
		subNavigation.className = "hidden";		
	}
	subNavigation.index = index;
}
function OutNavigation(obj){
	OutNavigationTimer = setTimeout(function(){
		var subNavigation = document.getElementById("subNavigation");
		obj.src = obj.src.replace("_S","_U");		
		subNavigation.className = "hidden";
		subNavigation.index = 0;
	},10);
}
function OverSubNavigation(){
	clearTimeout(OutNavigationTimer);
	clearTimeout(OutSubNavigationTimer);
}
function OutSubNavigation(obj){
	OutSubNavigationTimer = setTimeout(function(){
		var navigation = document.getElementById("navigation"+obj.index);
		navigation.src = navigation.src.replace("_S","_U");
		obj.className = "hidden";		
		obj.index = 0;
	},10);
}
//首页Traval
function OverTrval(obj){
	obj.src = obj.src.replace("_U","_S");
}
function OutTrval(obj){
	obj.src = obj.src.replace("_S","_U");
}
//查询表单
var DEFAULT_KEYWORD = "--- Key Words ---";
function FocusKeyword(keyword){
	keyword.select();
}
function BlurKeyword(keyword){
	if(keyword.value=="") keyword.value = DEFAULT_KEYWORD;
}
function SubmitKeyword(){
	var keyword = document.getElementById("keyword");
	if(keyword.value==DEFAULT_KEYWORD||keyword.value=="") return;
	keyword.parentNode.submit();
}
