//基金净值
function selNavContent(td,hid,sign)
  {	
  	var navvalue = document.getElementById(hid).value;
  	var menvValue="";
        if(document.getElementById("tdfund1")!=null)document.getElementById("tdfund1").className="fund";
        if(td=="tdfund1"){menvValue="开放式基金净值";}
        if(document.getElementById("tdfund2")!=null)document.getElementById("tdfund2").className="fund";
        if(td=="tdfund2"){menvValue="封闭式基金净值";}
        if(document.getElementById("tdfund3")!=null)document.getElementById("tdfund3").className="fund";
        if(td=="tdfund3"){menvValue="股票型基金净值";}
        if(document.getElementById("tdfund4")!=null)document.getElementById("tdfund4").className="fund";
        if(td=="tdfund4"){menvValue="债券型基金净值";}
        if(document.getElementById("tdfund5")!=null)document.getElementById("tdfund5").className="fund";
        if(td=="tdfund5"){menvValue="股债平衡型基金净值";}
        if(document.getElementById(td)!=null)document.getElementById(td).className="selfund";
        if(document.getElementById("tdNavContent")!=null)document.getElementById("tdNavContent").innerHTML=navvalue;
        if(document.getElementById("hidtype")!=null)document.getElementById("hidtype").value=sign;
        try{
        var obj=document.getElementById("tdmenu");
        if(obj!=null)
        {
        	obj.innerHTML="您现在的位置：基金排行 &gt;&gt; 基金净值 &gt;&gt; "+menvValue;
        }
}catch(E){}
  }
 //净值回报
  function selhbContent(td,hid,sign)
  {
  	var navvalue = document.getElementById(hid).value;
  	var menvValue="";
        if(document.getElementById("tdhbfund1")!=null)document.getElementById("tdhbfund1").className="fund";
        if(td=="tdhbfund1"){menvValue="开放式基金净值回报";}
        if(document.getElementById("tdhbfund2")!=null)document.getElementById("tdhbfund2").className="fund";
        if(td=="tdhbfund2"){menvValue="封闭式基金净值回报";}
        if(document.getElementById("tdhbfund3")!=null)document.getElementById("tdhbfund3").className="fund";
        if(td=="tdhbfund3"){menvValue="股票型基金净值回报";}
        if(document.getElementById("tdhbfund4")!=null)document.getElementById("tdhbfund4").className="fund";
        if(td=="tdhbfund4"){menvValue="债券型基金净值回报";}
        if(document.getElementById("tdhbfund5")!=null)document.getElementById("tdhbfund5").className="fund";
        if(td=="tdhbfund5"){menvValue="股债平衡型基金净值回报";}
        if(document.getElementById(td)!=null)document.getElementById(td).className="selfund";
        if(document.getElementById("tdhbContent")!=null)document.getElementById("tdhbContent").innerHTML=navvalue;
        
        if(document.getElementById("hidtype")!=null)document.getElementById("hidtype").value=sign;
        try{
        var obj=document.getElementById("tdmenu");
        if(obj!=null)
        {
        	obj.innerHTML="您现在的位置：基金排行 &gt;&gt; 基金净值 &gt;&gt; "+menvValue;
        }
        }catch(E){}
        
  }
   //基金分类
  function selstypeContent(td,hid,sign)
  {
  	var navvalue = document.getElementById(hid).value;
  	var menvValue="";
        if(document.getElementById("tdhbfund1")!=null)document.getElementById("tdhbfund1").className="fund";
        if(td=="tdhbfund1"){menvValue="股票型基金";}
        if(document.getElementById("tdhbfund2")!=null)document.getElementById("tdhbfund2").className="fund";
        if(td=="tdhbfund2"){menvValue="混合型基金";}
        if(document.getElementById("tdhbfund3")!=null)document.getElementById("tdhbfund3").className="fund";
        if(td=="tdhbfund3"){menvValue="债券型基金";}
        if(document.getElementById("tdhbfund4")!=null)document.getElementById("tdhbfund4").className="fund";
        if(td=="tdhbfund4"){menvValue="保本型基金";}
        if(document.getElementById("tdhbfund5")!=null)document.getElementById("tdhbfund5").className="fund";
        if(td=="tdhbfund5"){menvValue="货币式基金";}
        if(document.getElementById(td)!=null)document.getElementById(td).className="selfund";
        if(document.getElementById("tdhbContent")!=null)document.getElementById("tdhbContent").innerHTML=navvalue;
        if(document.getElementById("hidtype")!=null)document.getElementById("hidtype").value=sign;
        try{
        var obj=document.getElementById("tdmenu");
        if(obj!=null)
        {
        	obj.innerHTML="您现在的位置：基金分类 &gt;&gt; "+menvValue;
        }
        }catch(E){}
        
  }
 //封闭式基金涨跌幅排名
 function selzdContent(td,hid,sign)
  {
     if(document.getElementById(hid)!=null){
  	var navvalue = document.getElementById(hid).value;
        if(document.getElementById("tdzdfund1")!=null)document.getElementById("tdzdfund1").className="fund";
        if(document.getElementById("tdzdfund2")!=null)document.getElementById("tdzdfund2").className="fund";
        if(document.getElementById(td)!=null)document.getElementById(td).className="selfund";
        if(document.getElementById("tdzdContent")!=null)document.getElementById("tdzdContent").innerHTML=navvalue;
        if(document.getElementById("hidtype")!=null)document.getElementById("hidtype").value=sign;
      }
  }
  
   //封闭式基金涨跌幅及折价率排名
 function selzjzdContent(td,hid,sign)
  {
      if(document.getElementById(hid)!=null){
  	var navvalue = document.getElementById(hid).value;
  	var menvValue="";
        if(document.getElementById("tdzdfund")!=null)document.getElementById("tdzdfund").className="fund";
        if(td=="tdzdfund"){menvValue="封闭式基金折价率排名";}
        if(document.getElementById("tdzjfund")!=null)document.getElementById("tdzjfund").className="fund";
        if(td=="tdzjfund"){menvValue="封闭式基金涨跌幅排名";}
        if(document.getElementById(td)!=null)document.getElementById(td).className="selfund";
        if(document.getElementById("tdNavzjzdContent")!=null)document.getElementById("tdNavzjzdContent").innerHTML=navvalue;
        if(document.getElementById("hidtype")!=null)document.getElementById("hidtype").value=sign;
        try{
        var obj=document.getElementById("tdmenu");
        if(obj!=null)
        {
        	obj.innerHTML="您现在的位置：基金排行 &gt;&gt; "+menvValue;
        }
        }catch(E){}
      }
  }
  
 var isInSubMenu = false;
function popMenu(sourceObj,targetObjName)
{
 var targetObj = document.getElementById(targetObjName); 
 if(targetObj!=null){
 targetObj.style.top=getIEPosY(sourceObj) + sourceObj.offsetHeight;
 targetObj.style.left=getIEPosX(sourceObj);
 targetObj.style.display="";
}
}
function leaveMenu(targetObjName)
{
 if(isInSubMenu)return;
 var targetObj = document.getElementById(targetObjName);
 if(targetObj!=null)
   targetObj.style.display="none";
}
function getIEPosX(elt)
{
 return getIEPos(elt,"Left"); 
}

function getIEPosY(elt)
{
 return getIEPos(elt,"Top");
}

function getIEPos(elt,which) 
{
 var iPos = 0;
 while (elt!=null)
 {
  iPos += elt["offset" + which];
  elt = elt.offsetParent;
 }
 return iPos;
}

function hideSubMenu(sourceObject)
{
isInSubMenu = false;
 sourceObject.style.display="none";
}
function showSubMenu(sourceObject)
{
 isInSubMenu = true;
 sourceObject.style.display="";
}
