
_gObjByID2 = function(id) {
    return document.getElementById(id);
}

function ShowOrHideList_login(Status)
{
    _gObjByID2("divLoginMask").style.left = '1px';
    if(typeof(_gObjByID2("Top1_ddlBigType"))!="undefined" && _gObjByID2("Top1_ddlBigType")!=null)
    {
        _gObjByID2("Top1_ddlBigType").style.display=Status;
    }
    if(typeof(_gObjByID2("Filter1_ddlTimeSpan"))!="undefined" && _gObjByID2("Filter1_ddlTimeSpan")!=null)
    {
        _gObjByID2("Filter1_ddlTimeSpan").style.display=Status;
    }
    if(typeof(_gObjByID2("Filter1_ddlRegionSpan"))!="undefined" && _gObjByID2("Filter1_ddlRegionSpan")!=null)
    {
        _gObjByID2("Filter1_ddlRegionSpan").style.display=Status;
    }
}
function showLoginMask_login()
{
    _gObjByID2("divLoginMask").style.left = '1px';
    _gObjByID2("divLoginMask").style.top = '1px';
    _gObjByID2("divLoginMask").style.height=getbodyheight() +'px';
    _gObjByID2("divLoginMask").style.display="block";
}
function GetElementTopValue(obj)
{
var height=obj.offsetTop; 
while( obj.offsetParent.tagName.toUpperCase() != "BODY")
{
    obj = obj.offsetParent;
    height+=obj.offsetTop;
}
return height;
}
function showForm_login(obj)
{
    showLoginMask_login();
    ShowOrHideList_login("none");
    var left = (parseInt(getbodywidth())-parseInt(_gObjByID2("divLoginform").style.width))/2;
    _gObjByID2("divLoginform").style.left = left + 'px';
    var top = GetElementTopValue(obj);
    if(top<230){top = 230;}
    _gObjByID2("divLoginform").style.top = top + 'px';
    _gObjByID2("divLoginform").style.display="block";
}
function closeForm_login()
{
    ShowOrHideList("");
    _gObjByID2("divLoginMask").style.display="none";
    _gObjByID2("divLoginform").style.display="none";
}
function getbodyheight(){
    var height1=document.body.clientHeight;
    var height2=document.documentElement.clientHeight;
    if(height1==0 && height2==0){
        return 1000;}
    else{
        if(height1>height2)
        {
	        return height1;
        }
        else
        {
	        return height2;
        }
    }
}
function getbodywidth(){
    var width1=document.body.clientWidth;
    var width2=document.documentElement.clientWidth;
    if(width1==0 && width2==0){
	    return 1000;
    }
    else
    {
	    if(width1>width2)
	    {
		    return width1;
	    }
	    else		
	    {
	    	return width2;
	    }
    }
}

function changebg(obj)
  {
	  
    GetEvent("dh_01").style.background='url(/top/topimages/dh_01.gif)';
	GetEvent("dh_01").style.color='#0078AD';
	GetEvent("dh_01").style.fontWeight='';	
    obj.style.background='url(/top/topimages/dh.gif)';
	obj.style.color='#ffffff';
	obj.style.fontSize="14px";
	obj.style.fontWeight ="bold" ;
	if(event.srcElement.tagName=="A")event.srcElement.style.cssText='color:#ffffff;'
	
  }

  function unchangebg(obj)
  {
    obj.style.background='url(/top/topimages/dh_01.gif)';
	obj.style.color='#0078AD';
	obj.style.fontWeight='';
    if(event.srcElement.tagName=="A")event.srcElement.style.cssText='color:#0078AD;'
	GetEvent("dh_01").style.background='url(/top/topimages/dh.gif)';
	GetEvent("dh_01").style.color='#ffffff';
	GetEvent("dh_01").style.fontSize="14px";
	GetEvent("dh_01").style.fontWeight ="bold" ;
	
  }
function GetEvent(id)
    {
	if(document.getElementById)
	
	{
	
		return document.getElementById(id);
	}
	else if(document.all)
	{
		return document.all[id];
	}
	else if(document.layers)
	{
		return document.layers[id];
	}
    }

 function del()
 {
 GetEvent("k").value="";
 }
  function AddFavorite(sURL, sTitle)
{
    try
    {
         window.external.addFavorite(sURL, sTitle);
     }
    catch (e)
    {
        try
        {
             window.sidebar.addPanel(sTitle, sURL, "");
         }
        catch (e)
        {
             alert("加入收藏失败，请使用Ctrl+D进行添加");
         }
     }
}
function SetHome(obj,vrl){
        try{
                 obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
            }
        catch(e)
		     {
                if(window.netscape)
				{
                        try
						{
                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
                         }  
                        catch (e)
						{ 
                           alert("此操作被浏览器拒绝！请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");  
                         }
         var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
              prefs.setCharPref('browser.startup.homepage',vrl);
                  }
         }
}