﻿function getdata(Url,DivValue)
{

   //此判断可测试 DivValue 同一次页面，只加载一次 减少与数据的查询
   //非常奇怪，Firefox 为空，但长度是 37
   //IE测试则为 0;
   //可能是两种浏览器的问题
   
   if(!document.getElementById(DivValue)){
     return;
   }
   
   var txt="";
   txt=document.getElementById(DivValue).innerHTML;
   //alert(txt.length);
   txtlength=txt.length
   //0  在IE下使用
   //37 在Firefox 使用
   if (txtlength==0 || txtlength==37)
   {
     //document.write(document.getElementById(DivValue));
     //alert('执行一次');
     $.get(Url,null,function getResult(data)
    {
    $("#"+DivValue).html(data);
     }
    );
    }

}

function StyleDisplay(DivValue)
{
  
  //document.write(document.getElementById(DivValue).innerHTML);
  //DivValue=#DivValue;
  //alert(DivValue.style.display);
  
  if (document.getElementById(DivValue).style.display=="")
    document.getElementById(DivValue).style.display="none";
  else
    document.getElementById(DivValue).style.display="";    
  
}

function ChangeImg(imgObj)
{
  
  //改变图片状态,图片必须使用绝对路径
  ImgTxt=document.getElementById(imgObj).src;
  
  if (ImgTxt.indexOf("+.gif")>0)
  {
     
     ImgTxt=ImgTxt.replace("+.gif","-.gif");
     //alert(ImgTxt);
     document.getElementById(imgObj).src=ImgTxt;
  }
  else
  {
     ImgTxt=ImgTxt.replace("-.gif","+.gif");
     document.getElementById(imgObj).src=ImgTxt;
  }
  
}

function show(DivValue)
{
   //显示  
    document.getElementById(DivValue).style.display="";    
  
}

function vis(DivValue)
{
  //隐藏  
  document.getElementById(DivValue).style.display="none";    
  
}


 function TopCs()
    {
    
        var pagename = window.location.href.match(/.+\/([^?]*)/)[1].toLowerCase();
        
        var menuid=pagename.replace(".aspx","");
        
        if(menuid.indexOf("detail")!=-1){
            menuid=menuid.replace("_detail","");
        }
        
        menuid=menuid+"457683233";

       if(menuid!=""){
            if(document.getElementById(menuid)){
            document.getElementById(menuid).style.backgroundImage = "url(/Cn/images/nav_bg2.gif)";
            }
       }
      
 }
  
$(document).ready(function(){
	TopCs();	
});