function ontop(selfObj){
	var ul=document.getElementById("navigation").getElementsByTagName("li");
	var ullength = ul.length;
	for(i=0; i<ullength; i++){
		ul[i].className = "";
	}
	    selfObj.parentNode.className = "navigation_selected";
}
function ontop_b(selfObj){
	var ul=document.getElementById("navigation").getElementsByTagName("li");
	var ullength = ul.length;
	for(i=0; i<ullength; i++){
		ul[i].className = "";
	}
	    selfObj.parentNode.className ="navigation_selected";
}
var showLiUL = null;
function displaySubMenu(li) { 
     var subMenu = li.getElementsByTagName("ul")[0];
     if(subMenu!=null&&subMenu.style!=null){
     	subMenu.style.display = "block";
     }
     var posB = getElementPos(document.getElementById("li_"+li.tp_tg));
     var posEnd = getElementPos(document.getElementById("end_navigate"));
     	if(showLiUL!=null&&showLiUL.style.display=="block"&&subMenu!=showLiUL){
	   		showLiUL.style.display="none";
	   	}
		if(posB[0]>posEnd[0]){ 
			if(document.getElementById("ul_"+li.tp_tg)!=null&&document.getElementById("ul_"+li.tp_tg).style!=null){
	   			document.getElementById("ul_"+li.tp_tg).style.left = "-"+(posB[0]-posEnd[0]+50)+"px";
	   		}
	   	}
	   	
 }
 function hideSubMenu(li) {
     	var pos = getElementPos(document.getElementById("ul_"+li.tp_tg));
     	if(document.getElementById("ul_"+li.tp_tg)!=null&&document.getElementById("ul_"+li.tp_tg).style!=null){
			document.getElementById("ul_"+li.tp_tg).style.left = "-5px";
		} 
		if(showLiUL!=null&&showLiUL.style!=null&&showLiUL.style.display=="none"){
	   		showLiUL.style.display="block"; 
	   	}		
     	var subMenu = li.getElementsByTagName("ul")[0];
     	if(subMenu!=null&&subMenu.style!=null){
     		subMenu.style.display = "none";
     	}     	
 }

function focus_selectTag(showContent,selfObj){
	var tag = document.getElementById("focus_tags").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "focus_selectTag";
	for(i=0; j=document.getElementById("focus_tagContent"+i); i++){
		if(j.style!=null){
			j.style.display = "none";
		}
	}
	if(document.getElementById(showContent)!=null&&document.getElementById(showContent).style!=null){
		document.getElementById(showContent).style.display = "block";	
	}
}

function news_selectTag(showContent,selfObj){ 
	var tag = document.getElementById("news_tags").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "news_selectTag";
	
	for(i=0; j=document.getElementById("news_tagContent"+i); i++){
		if(j.style!=null){
			j.style.display = "none";
		}
	}
	
	if(document.getElementById(showContent).style!=null){
		document.getElementById(showContent).style.display = "block";
	}
	
}  

function getElementPos(obj) {
	try{
	var curleft = curtop = 0;
	if (obj!=null&&obj.offsetParent!=null) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
	}catch(Exception){}
}
