	var myMenu;
	var historyCount=0;
	
	function getparastr(strname)
	  {
	   var hrefstr,pos,parastr,para,tempstr;
	   hrefstr = window.location.href;

	   pos = hrefstr.indexOf("?");

	   parastr = hrefstr.substring(pos+1);
	   para = parastr.split("&");
	   tempstr="";
	   for(i=0;i<para.length;i++)
	   {
	    tempstr = para[i];
	    pos = tempstr.indexOf("=");
	    if(tempstr.substring(0,pos) == strname)
	    {	tempstr = tempstr.substring(pos+1);
	    	if(tempstr.indexOf("#job")>0){
	    		var pos2 = tempstr.indexOf("#job");
	    		return tempstr.substring(0,pos2);
	    	}else{
	     		return tempstr;
	     	}
	     }
	   }
	   return '';
	  }
	  
	  function isNews(){
	  	var hrefStr = window.location.href;
	  	var lk = hrefStr.indexOf("showDetails.action");
		if(lk>0){
			return false;
		}else{
			return true;
		}
	  }
	  
	  function isJob(){
	  	var hrefStr = window.location.href;
	  	var lk = hrefStr.indexOf("#job");
	  	if(lk>0){
			return false;
		}else{
			return true;
		}
	  }
	  
	  function getjobId(){
	  	var hrefStr = window.location.href;
	  	var pos = hrefStr.indexOf("#job");
		return hrefStr.substring(pos+4);
	  }		
	
	function loadPage() {
		myMenu = new SDMenu("my_menu");
		myMenu.init();
		var subitem_str,treeid_str,tabid;
		var ajaxTreeid='';
		if(isNews()){
			treeid_str =  getparastr("treeid");
			tabid = getparastr("tabid");

			if(treeid_str!=''){
				
				ajaxTreeid = parseajaxTreeid();
				//alert("ajaxTreeid="+ajaxTreeid);
			}
			var selectId;
			if(tabid=='4' && treeid_str!='330'){
				if(isJob()){
					myMenu.loadContent(treeid_str);
					selectId = treeid_str;
				}else{
					var jobid = getjobId();
					myMenu.loadJobContent(jobid);
					selectId = jobid;
				}
				// selectId = treeid_str;
			}else if((treeid_str!=null && treeid_str.length>0)&&(ajaxTreeid!=null && ajaxTreeid.length>0)){
				myMenu.loadContent(ajaxTreeid);
				selectId = ajaxTreeid;
			}else if(treeid_str!=null && treeid_str.length>0){
				myMenu.loadContent(treeid_str);
				selectId = treeid_str;
			}else if(ajaxTreeid!=null && ajaxTreeid.length>0){
				myMenu.loadContent(ajaxTreeid);
				selectId = ajaxTreeid;
			}
			// alert("selectId=="+selectId);
			var arrSpanFlag = myMenu.menu.getElementsByTagName("span");
			for(var i=0;i<arrSpanFlag.length;i++){
				//alert(arrAFlag[i].parentNode.innerHTML);
				//var tmp = arrAFlag[i].getElementsByTagName("span")[0].getAttribute("treeid");
				var tmp = arrSpanFlag[i].getAttribute("treeid");
				//alert("tmp=="+tmp);
				if(tmp==selectId){
					myMenu.expandMenu(arrSpanFlag[i].parentNode);
					return ;
				}
			}
	
		
			var arrAFlag = myMenu.menu.getElementsByTagName("a");
			for(var i=0;i<arrAFlag.length;i++){
				//alert(arrAFlag[i].parentNode.innerHTML);
				//var tmp = arrAFlag[i].getElementsByTagName("span")[0].getAttribute("treeid");
				var tmp = arrAFlag[i].getAttribute("treeid");
				//alert("tmp=="+tmp);
				if(tmp==selectId){
					myMenu.expandMenu(arrAFlag[i].parentNode);
					return ;
				}
			}
		}	
	}

		function addHistory(){
		  dhtmlHistory.add(
		    parseajaxTreeid(),
		    getTreeAndContent()
		  );
		  historyCount++;
		}
		
		function getTreeAndContent(){
			var content = $("mid_content").innerHTML;
			//alert("content==="+content);
			return content;
		}
		
		function setTreeAndContent(data){
			//alert("setTreeAndContent=="+data);
			//alert("setTreeAndContent2=="+document.body.innerHTML);
			$("mid_content").innerHTML= data;
		}
		
	function submitNavMenuAction(index,tabid){
		if(index!= null){
			window.location.href = "showMenuContent.action?leftMenuIndex="+index+"&treeid="+index+"&tabid="+tabid;
		}
	}
	
	function loadNavMenu(tabid){
		var menuitems=document.getElementById("ddtabs3").getElementsByTagName("a");
		ddtabmenu.showsubmenu("ddtabs3", menuitems[tabid]);
	}

function parseajaxTreeid(){
	//alert(window.location.href);
	var curHref = window.location.href;
	var pos;
	var ajaxTreeid="";
	if(curHref.indexOf("#")>-1){
		pos = curHref.indexOf("#");
		ajaxTreeid = curHref.substring(pos+1);
	}
	return ajaxTreeid;
}

function parseOpenTreeid(){
	//alert(window.location.href);
	var curHref = window.location.href;
	var pos;
	var ajaxTreeid="";
	if(curHref.indexOf("!")>-1){
		pos = curHref.indexOf("!");
		ajaxTreeid = curHref.substring(pos+1);
	}
	return ajaxTreeid;
}

	function isIE()
	{
		if (window.navigator.userAgent.indexOf("MSIE")>=1)
		{
			// alert("IE");
			try
			{
				document.execCommand( 'BackgroundImageCache', false, true ) ;
			}
			catch (e)
			{
				// We have been reported about loading problems caused by the above
				// line. For safety, let's just ignore errors.
			}
			return true;
		}
		else 
		{
			if (window.navigator.userAgent.indexOf("Firefox")>=1)
			{
				//alert("Fixfox");
			}
			return false;
		}
	}
	


