﻿var g_IndexNode = 0;
var g_bTencentIP = 0;
var CGI_TXC = 'cgi/txc?';

function crm_creat_head(inode)
{
    g_IndexNode = inode;
    var sContent = "<div id=div_head name=div_head style='height:56px;'></div>";
    document.write (sContent) ; 
    crm_creat_head_act(g_IndexNode);   
    if(g_IndexNode ==0 &&　(window.location.href == "http://bizapp.qq.com/index.htm" || window.location.href == "http://bizapp.qq.com/") )
    {
        TXC_Sumit();
    }
}

function crm_creat_head_act(inode)
{
    var i=0;
    var sHead_Array = new Array(
    ["首    页", "/index.htm"],
    ["最新动态", "/newest.htm"],
    ["站长资源", "/home_webpres.htm"],
    ["帮助中心", "/home_intro.htm"],
    ["论    坛", "http://bizapp.qq.com/home_space.htm"],
    ["统    计", "http://bizapp.oa.com/abcde.htm"]
    );
    
    var iLength = sHead_Array.length - 1 ;
    if(inode ==0 )
    {
        iLength += g_bTencentIP;
    }
    
    var sWidth = "33%";
    if(g_bTencentIP ==1)
    {
        sWidth = "22%"
    }
   
    
    var sContent = "<table width='760' border='0' align='center' cellpadding='0' cellspacing='0'><tr>";
    sContent += "<td width='"+sWidth+"' height='56' valign='top'><img src='/img/logo.jpg' width='187' height='51' border='0' /></td>";

    for(i = 0; i < iLength; i++)
    {
        if(inode == i)
        {
            sContent += "<td width='13%' align='center' class='NonceMenu'>";
            sContent += sHead_Array[i][0];
            sContent += "</td>";
        }
        else
        {
            sContent += "<td width='13%' align='center' class='NavPd'><a href='"
            sContent += sHead_Array[i][1];
            sContent += "' class='NavLink'>";
            sContent += sHead_Array[i][0];
            sContent += "</a></td>";
       }
    }
    sContent += "</tr></table>";
    document.all.div_head.innerHTML = sContent;
}



function TXC_Sumit()
{
	var sURL="";
	SendAJAXRequest(CGI_TXC,"POST", TXC_OnSumitReturn,sURL);  
}

function TXC_OnSumitReturn(xmlobj)
{
	var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 
	xmlDoc.async = false ;
	xmlDoc.loadXML(xmlobj.responseText);
	
	var value = xmlDoc.selectSingleNode("//root/r");
	var r=parseInt(value.text);
	if(r==0)
	{
	    g_bTencentIP = 1;
	}
    crm_creat_head_act(g_IndexNode);
}
