//读取相关连接
function loadlinks()
{   
    var xml = new ActiveXObject("Msxml2.DOMDocument");
	xml.async=false; 
	xml.load("./xml/links.xml"); 
	                                                                                            
    var root = xml.documentElement;                 
    try     
    {                                            
                                                              
    var str = "";
    str += "<br/><br/><br/>";
                                      
        for(i=0; i < root.childNodes.length; i++)        
        {          
        	if (root.childNodes.item(i).childNodes.length == 3)
        	{
        	  str +="<img src=images/bullet-g.jpg>&nbsp;&nbsp;";
        	  str += "<style>a{TEXT-DECORATION:none}</style><a href='"+root.childNodes.item(i).childNodes.item(1).text+"' onclick='showdiv(4)'>";
        	  if (root.childNodes.item(i).childNodes.item(2).text != "")
        	  {
        	  	str += "<img src='"+root.childNodes.item(i).childNodes.item(2).text+"' /><br/>";
        	  }
        	  str += root.childNodes.item(i).childNodes.item(0).text+"</a><br/>";
        	}              
        } 
        str += " ";
        document.getElementById("div_content").innerHTML=str;
        
    }
    catch(e)
    {
        alert(e+e.description);
    }   
}


//读取新闻
function loadnews()
{
    var xml = new ActiveXObject("Msxml2.DOMDocument");
	xml.async=false; 	
	xml.load("./xml/News.xml"); 
	
    var root = xml.documentElement;                         
    try     
    {                                            
                                                              
    var str = "";
    str += "<br/><br/><br/>";                                                          
        for(i=0; i < root.childNodes.length; i++)        
        {          
//        	if (root.childNodes.item(i).childNodes.length == 3)
//        	{
              //content = root.childNodes.item(i).childNodes.item(1).text;
              str +="<img src=images/bullet-g.jpg>&nbsp;&nbsp;";
        	  str += "<style>a{TEXT-DECORATION:none}</style><a href='#' onclick='showdiv(1," + i + ")'>";
        	  if (root.childNodes.item(i).childNodes.item(1).text != "")
        	  {
//        	  	str += "<img src='"+root.childNodes.item(i).childNodes.item(2).text+"' />";
        	  }
        	  str += root.childNodes.item(i).childNodes.item(1).text+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        	  str += "<font size=1pt;font color=#b2b2b2>" + root.childNodes.item(i).childNodes.item(0).text+"</font><br/>";
//        	}               
        } 
        str += " ";
        document.getElementById("div_content").innerHTML=str;
    }
    catch(e)
    {
        alert(e+e.description);
    }  
}


//读取说明
function loadexplain()
{
    var xml = new ActiveXObject("Msxml2.DOMDocument");
	xml.async=false; 	
	xml.load("./xml/Explain.xml"); 
	
    var root = xml.documentElement;                        
    try     
    {                                            
                                                              
    var str = "";
    str += "<br/><br/><br/>";                                                          
        for(i=0; i < root.childNodes.length; i++)        
        {          
//        	if (root.childNodes.item(i).childNodes.length == 3)
//        	{
              str +="<img src=images/bullet-g.jpg>&nbsp;&nbsp;";
        	  str += "<style>a{TEXT-DECORATION:none}</style><a href='#' onclick='showdiv(2," + i + ")'>";
//        	  if (root.childNodes.item(i).childNodes.item(1).text != "")
//        	  {
//        	  	//str += "<img src='"+root.childNodes.item(i).childNodes.item(2).text+"' />";
//        	  }
        	  str += root.childNodes.item(i).childNodes.item(1).text+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        	  str += "<font size=1pt;font color=#b2b2b2>" + root.childNodes.item(i).childNodes.item(0).text+"</font><br/>";
//        	}               
        } 
        str += " ";
        document.getElementById("div_content").innerHTML=str;
    }
    catch(e)
    {
        alert(e+e.description);
    }  
}


//读取参考资讯
function loadReference()
{
    var xml = new ActiveXObject("Msxml2.DOMDocument");
	xml.async=false; 	
	xml.load("./xml/Reference.xml"); 
	
    var root = xml.documentElement;                        
    try     
    {                                            
                                                              
    var str = "";
    str += "<br/><br/><br/>";                                                          
        for(i=0; i < root.childNodes.length; i++)        
        {          
//        	if (root.childNodes.item(i).childNodes.length == 3)
//        	{
              str +="<img src=images/bullet-g.jpg>&nbsp;&nbsp;";
        	  str += "<style>a{TEXT-DECORATION:none}</style><a href='#' onclick='showdiv(3," + i + ")'>";
        	  if (root.childNodes.item(i).childNodes.item(1).text != "")
        	  {
//        	  	str += "<img src='"+root.childNodes.item(i).childNodes.item(2).text+"' />";
        	  }
        	  str += root.childNodes.item(i).childNodes.item(1).text+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        	  str += "<font size=1pt;font color=#b2b2b2>" + root.childNodes.item(i).childNodes.item(0).text+"</font><br/>";
//        	}               
        } 
        str += " ";
        document.getElementById("div_content").innerHTML=str;
    }
    catch(e)
    {
        alert(e+e.description);
    }  
}

// type 1显示主菜单  
function showdiv(type,id)
{   
    if (type ==1 )
    {
        var xml = new ActiveXObject("Msxml2.DOMDocument");
        xml.async=false; 	
        xml.load("./xml/News.xml"); 

        var root = xml.documentElement;  
                    
        try     
        {        
            var str = "";   
            str += "<br/><br/><br/>";                                                                                                                                                                                       	          
//            str += "<img src='"+root.childNodes.item(id).childNodes.item(2).text + " />"
            str += "<font size=4pt><strong><center>" + root.childNodes.item(id).childNodes.item(1).text+"</center></strong></font><br/>";
            str += "<center>" + root.childNodes.item(id).childNodes.item(0).text+"</center><br/>";
            str += root.childNodes.item(id).childNodes.item(3).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(4).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(5).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(6).text+"<br/>";
            
            str += "<br/>";
            str += " <center><img src=images/back.jpg onclick=loadnews() ></center>";
            str += " ";
            document.getElementById("div_content").innerHTML=str;
        }
        
        catch(e)
        {
            alert(e+e.description);
        }  
        
        return;
    
    }

    if (type ==2 )
    {
        var xml = new ActiveXObject("Msxml2.DOMDocument");
        xml.async=false; 	
        xml.load("./xml/Explain.xml"); 

        var root = xml.documentElement;  
                               
        try     
        {   
            var str = "";      
            str += "<br/><br/><br/>";                                                                                                                                                                                         	          
//            str += "<img src='"+root.childNodes.item(id).childNodes.item(2).text+"' />";
            str += "<font size=4pt><strong><center>" + root.childNodes.item(id).childNodes.item(1).text+"</center></strong></font><br/>";
            str += "<center>" + root.childNodes.item(id).childNodes.item(0).text+"</center><br/>";
            str += root.childNodes.item(id).childNodes.item(3).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(4).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(5).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(6).text+"<br/>";
            str += "<br/>";
            str += " <center><img src=images/back.jpg onclick=loadexplain() ></center>";
            str += " ";
            document.getElementById("div_content").innerHTML=str;
        }
        
        catch(e)
        {
            alert(e+e.description);
        }  
        
        return;
    
    }
    
    
    if (type ==3 )
    {
        var xml = new ActiveXObject("Msxml2.DOMDocument");
        xml.async=false; 	
        xml.load("./xml/Reference.xml"); 

        var root = xml.documentElement;  
                               
        try     
        {   
            var str = "";       
            str += "<br/><br/><br/>";                                                                                                                                                                                        	          
//            str += "<img src='"+root.childNodes.item(id).childNodes.item(2).text+"' />";
            str += "<font size=4pt><strong><center>" + root.childNodes.item(id).childNodes.item(1).text+"</center></strong></font><br/>";
            str += "<center>" + root.childNodes.item(id).childNodes.item(0).text+"</center><br/>";
            str += root.childNodes.item(id).childNodes.item(3).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(4).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(5).text+"<br/>";
            str += root.childNodes.item(id).childNodes.item(6).text+"<br/>";
            str += "<br/>";
            str += " <center><img src=images/back.jpg onclick=loadReference() ></center>";
            str += " ";
            document.getElementById("div_content").innerHTML=str;
        }
        
        catch(e)
        {
            alert(e+e.description);
        }  
        
        return;
    
    }    
}


//添加首页
function loadmain(flag)
{      
    if (flag==1)
    {
        loadnews();
    }
    
    else
    {
        if (flag==2)
        {
            loadexplain();
        } 
        
        else
        {
            if (flag==3)
            {
                loadReference();
            }  
            
            else
            {
                if (flag==4)
                {
                    loadlinks();
                }  
                
                else
                {
                    var str;
                    str = "";
                    str += "<iframe frameborder=0 scrolling=no width=100% height=100% src=default.htm></iframe>";
                    document.getElementById("div_content").innerHTML=str;
                    return;
                }
            }
        }
    }

}


function loadtest()
{   
    var str;
    str = document.getElementById("form1").innerHTML;
    alert(str);
}