<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->


var XMLHttpReq;
var showcon;

function createXMLHttpRequest() {
       if(window.XMLHttpRequest) {
              XMLHttpReq = new XMLHttpRequest();
       }
       else if (window.ActiveXObject) {
              try {
                     XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
              } catch(e){
                     try{
                          XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
                     } catch (e) {}
              }
       }
}

function processMatchResponse()
{
    if (XMLHttpReq.readyState == 4) 
    {
        if (XMLHttpReq.status == 200) 
        {
           displayInfo(XMLHttpReq.responseText,showcon);
        }
        else 
        {
           window.alert("页面请求异常。");
        }
    }
}

function displayInfo(sText,id) 
{
    var divInfo = document.getElementById(id);
    divInfo.innerHTML = sText;
}

function showcontent(id,obj,toshow,tab,pid)
{
//alert('ok2');
    showcon = toshow;
    var tt = document.getElementById(obj);
    if(tt != null){tt.style.display = "";}
    
   if (obj == "t1") 
   {
     document.getElementById("t2").style.display = "none";
     document.getElementById("t3").style.display = "none";
     //document.getElementById("t4").style.display = "none";
   }
   if (obj == "t2")
   {
     document.getElementById("t3").style.display = "none";
     //document.getElementById("t4").style.display = "none";
   }
   if (obj == "t3")
   {

     //document.getElementById("t4").style.display = "none";
   }
   
    createXMLHttpRequest();
    
    if (obj == "t1") var url = "SubMenu_Expand.aspx?SubMenuPart=t1&ID=" + id + "&pid=" + pid + "&tab=" + tab;
    if (obj == "t2") var url = "SubMenu_Expand.aspx?SubMenuPart=t2&ID=" + id + "&pid=" + pid + "&tab=" + tab;
    if (obj == "t3") var url = "SubMenu_Expand.aspx?SubMenuPart=t3&ID=" + id + "&pid=" + pid + "&tab=" + tab;
    if (obj == "t4")
    {
        document.getElementById("a4").style.display = "";
       if (pid == "m1") {var url = "Indicator_Frame.aspx?IndicatorGUID=" + id;}
       if (pid == "m2") {var url = "Chart_Frame.aspx?ChartGUID=" + id;}
       document.getElementById("hidbak").value=pid+id
    }
    if(obj == "t5") 
    {
        var content = document.getElementById('textarea').value;
        var url = "SubMenu_Expand.aspx?SubMenuPart=t5&ID="+id+"&pid="+pid+"&content="+content;
    }   
    if (pid == "m3") 
    {
       document.getElementById("t1").style.display = "none";
       document.getElementById("t2").style.display = "none";
       document.getElementById("t3").style.display = "none";
       var url = "Indicator_Pub_Frame.aspx";
    }
       
    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = processMatchResponse;
    XMLHttpReq.send(null);  
}

function showcontent2(Fid,Sid,obj,toshow,tab,pid)
{
    showcon = toshow;
   if (obj == "k1") 
   {
    var tt = document.getElementById("t1");
    if(tt != null){tt.style.display = "";}
     document.getElementById("t2").style.display = "none";
     document.getElementById("t3").style.display = "none";
     document.getElementById("a4").style.display = "none";//因为文库没有具体文章，所有下面位置不需要
     document.getElementById("bakDIV").style.display = "none";//因为文库没有备份，所有下面位置不需要
   }
   if (obj == "k2")
   {
    var tt = document.getElementById("t2");
    if(tt != null){tt.style.display = "";}
     document.getElementById("t3").style.display = "none";
     document.getElementById("a4").style.display = "none";//因为文库没有具体文章，所有下面位置不需要
     document.getElementById("bakDIV").style.display = "none";//因为文库没有备份，所有下面位置不需要
     //document.getElementById("t4").style.display = "none";
   }
   if (obj == "k3")
   {
    var tt = document.getElementById("t3");
    document.getElementById("a4").style.display = "none";//因为文库没有具体文章，所有下面位置不需要。
    document.getElementById("bakDIV").style.display = "none";//因为文库没有备份，所有下面位置不需要
    if(tt != null){tt.style.display = "";}
     //document.getElementById("t4").style.display = "none";
   }
   
    createXMLHttpRequest();
    if (obj == "k1") var url = "SubMenu_Expand.aspx?SubMenuPart=k1&FID=" + Fid + "&SID=" + Sid + "&pid=" + pid + "&tab=" + tab;
    if (obj == "k2") var url = "SubMenu_Expand.aspx?SubMenuPart=k2&FID=" + Fid + "&SID=" + Sid + "&pid=" + pid + "&tab=" + tab;
    if (obj == "k3") var url = "SubMenu_Expand.aspx?SubMenuPart=k3&FID=" + Fid + "&SID=" + Sid + "&pid=" + pid + "&tab=" + tab;
       
    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = processMatchResponse;
    XMLHttpReq.send(null);  
}


function showknowledget3(Fid,Sid,obj,toshow,tab,pid)
{
    showcon = toshow;
    var tt = document.getElementById(obj);
    tt.style.display = "";
    var url = "SubMenu_Expand.aspx?SubMenuPart=t3&FID=" + Fid + "&SID=" + Sid + "&pid=" + pid + "&tab=" + tab;
    XMLHttpReq.open("GET",url,true);
    XMLHttpReq.onreadystatechange = processMatchResponse;
    XMLHttpReq.send(null);
}

function showcontent4(id,obj,toshow,tab,pid)
{
    showcon = toshow;
    var tt = document.getElementById(obj);
    if(tt != null){tt.style.display = "";}
    
   if (obj == "t1") 
   {
     document.getElementById("t2").style.display = "none";
     document.getElementById("t3").style.display = "none";
     //document.getElementById("t4").style.display = "none";
   }
   if (obj == "t2")
   {
     document.getElementById("t3").style.display = "none";
     //document.getElementById("t4").style.display = "none";
   }
   if (obj == "t3")
   {

     //document.getElementById("t4").style.display = "none";
   }
   
    createXMLHttpRequest();
    
    if (obj == "t1") var url = "SubMenu_Expand.aspx?SubMenuPart=t1&ID=" + id + "&pid=" + pid + "&tab=" + tab;
    if (obj == "t2") var url = "SubMenu_Expand.aspx?SubMenuPart=t2&ID=" + id + "&pid=" + pid + "&tab=" + tab;
    if (obj == "t3") var url = "SubMenu_Expand.aspx?SubMenuPart=t3&ID=" + id + "&pid=" + pid + "&tab=" + tab;
    if (obj == "t4")
    {
        document.getElementById("a4").style.display = "";
       if (pid == "m1") {var url = "Indicator_Frame.aspx?IndicatorGUID=" + id;}
       if (pid == "m2") {var url = "Chart_Frame.aspx?ChartGUID=" + id;}
       document.getElementById("hidbak").value=pid+id
    }
    if(obj == "t5") 
    {
        var content = document.getElementById('textarea').value;
        var url = "SubMenu_Expand.aspx?SubMenuPart=t5&ID="+id+"&pid="+pid+"&content="+content;
    }   
    if (pid == "m3") 
    {
       document.getElementById("t1").style.display = "none";
       document.getElementById("t2").style.display = "none";
       document.getElementById("t3").style.display = "none";
       var url = "Indicator_Pub_Frame.aspx";
    }
       
    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = processMatchResponse;
    XMLHttpReq.send(null);  
}

lastarea1 = null;
lastarea2 = null;
lastarea3 = null;
lastarea4 = null;

function changecolor(id,obj)
{
    if(id == "area1")
    {
      if(lastarea1) lastarea1.style.color = '#00b2eb';
      obj.style.color = '#ffffff';
	  //obj.className = 'HIGHLIGHTC';
      lastarea1 = obj;
    }
    if(id == "area2")
    {
      if(lastarea2) lastarea2.style.color = '#00b2eb';
      obj.style.color = '#ffffff';
	  //obj.className = 'HIGHLIGHTC';
      lastarea2 = obj;
    }
    if(id == "area3")
    {
      if(lastarea3) lastarea3.style.color = '#00b2eb';
      obj.style.color = '#ffffff';
	  //obj.className = 'HIGHLIGHTC';
      lastarea3 = obj;
    }    
    if(id == "area4")
    {
      if(lastarea4) lastarea4.style.color = '#00b2eb';
      obj.style.color = '#ffffff';
	  //obj.className = 'HIGHLIGHTC';
      lastarea4 = obj;
    }  
}

function change_menu(id,obj)
{
  if (obj == 1)
  {
	  if (id == "menu_vertical")
	  {
		$("menu_vertical").style.display = "none" ? "block" : "none";
		$("menu_horizontal").style.display = "block" ? "none" : "block";
		$("menu_vertical_off").style.display = "none";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_horizontal', 1);\" class='cursor_hand'>指标分层路径</a>";
		$("menu_vertical_text").innerText = "指标类别全景";
	  }
	  if (id == "menu_horizontal")
	  {
		$("menu_vertical").style.display = "block" ? "none" : "none";
		$("menu_horizontal").style.display = "none" ? "block" : "block";
		$("menu_vertical_off").style.display = "block";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_vertical', 1);\" class='cursor_hand'>指标类别全景</a>";
		$("menu_vertical_text").innerText = "指标分层路径";
	  }
  }
  if (obj == 2)
  {
	  if (id == "menu_vertical")
	  {
		$("menu_vertical").style.display = "none" ? "block" : "none";
		$("menu_horizontal").style.display = "block" ? "none" : "block";
		$("menu_vertical_off").style.display = "none";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_horizontal', 2);\" class='cursor_hand'>图表分层路径</a>";
		$("menu_vertical_text").innerText = "图表类别全景";
	  }
	  if (id == "menu_horizontal")
	  {
		$("menu_vertical").style.display = "block" ? "none" : "none";
		$("menu_horizontal").style.display = "none" ? "block" : "block";
		$("menu_vertical_off").style.display = "block";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_vertical', 2);\" class='cursor_hand'>图表类别全景</a>";
		$("menu_vertical_text").innerText = "图表分层路径";
	  }
  }

  if (obj == 3)
  {
	  if (id == "menu_vertical")
	  {
		$("menu_vertical").style.display = "none" ? "block" : "none";
		$("menu_horizontal").style.display = "block" ? "none" : "block";
		$("menu_vertical_off").style.display = "none";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_horizontal', 3);\" class='cursor_hand'>评论分层路径</a>";
		$("menu_vertical_text").innerText = "评论类别全景";
	  }
	  if (id == "menu_horizontal")
	  {
		$("menu_vertical").style.display = "block" ? "none" : "none";
		$("menu_horizontal").style.display = "none" ? "block" : "block";
		$("menu_vertical_off").style.display = "block";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_vertical', 3);\" class='cursor_hand'>评论类别全景</a>";
		$("menu_vertical_text").innerText = "评论分层路径";
	  }
  }
  if (obj == 4)
  {
	  if (id == "menu_vertical")
	  {
		$("menu_vertical").style.display = "none" ? "block" : "none";
		$("menu_horizontal").style.display = "block" ? "none" : "block";
		$("menu_vertical_off").style.display = "none";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_horizontal', 4);\" class='cursor_hand'>文库分层路径</a>";
		$("menu_vertical_text").innerText = "文库类别全景";
	  }
	  if (id == "menu_horizontal")
	  {
		$("menu_vertical").style.display = "block" ? "none" : "none";
		$("menu_horizontal").style.display = "none" ? "block" : "block";
		$("menu_vertical_off").style.display = "block";
		$("menu_horizontal_text").innerHTML = "<a onclick=\"change_menu('menu_vertical', 4);\" class='cursor_hand'>文库类别全景</a>";
		$("menu_vertical_text").innerText = "文库分层路径";
	  }
  }
}

function tab_click(id, obj)
{
	for ( i = 1; i < 8; i++ )
	{
		$( "tab_" + i ).className = (i == id) ? "on":"";

		if (obj == 1) IndicatorList(0, id);
		if (obj == 2) ChartList(0, id);
		if (obj == 3) TimeList(0, id);
		if (obj == 4) DiscussList(0, id);
		if (obj == 5) KnowledgeList(0,id);
	}
}

function tab_click2(id,obj)
{
    if (obj == 1) IndicatorList(0, id);
	if (obj == 2) ChartList(0, id);
	if (obj == 3) TimeList(0, id);
	if (obj == 4) DiscussList(0, id);
	if (obj == 5) KnowledgeList(0,id);
	for ( i = 1; i < 8; i++ )
	{
		$( "tab_" + i ).className = (i == id) ? "on":"";
	}
}

function menu_click(id)
{
	if (id == "XiYou")
	{
		document.getElementById('XiYou').style.display="";
		document.getElementById('HongLou').style.display="none";
		document.getElementById('SanGuo').style.display="none";
	}
	
	if (id == "HongLou")
	{
		document.getElementById('HongLou').style.display="";
		document.getElementById('XiYou').style.display="none";
		document.getElementById('SanGuo').style.display="none";
	}
	
	if (id == "SanGuo")
	{
		document.getElementById('SanGuo').style.display="";
		document.getElementById('HongLou').style.display="none";
		document.getElementById('XiYou').style.display="none";
	}
}

function changepic(src, alt)    
{    
    var imgsrc="/Images/Net/"+src;        
	document.getElementById('PImg').src = imgsrc;
	document.getElementById('PImgtext').value = imgsrc;
	document.getElementById('PImg').alt = alt;
	document.getElementById('PImg_select').style.display = "none";
	document.getElementById('PImg_chk').value = '0';
	//document.getElementById('PImg_span').innerHTML = "<input type='file' id='PImg_file' runat='server' class='btn_browse' />"
}    

function IndicatorList(value, tab)
{
    if(value == "0")
    {
        if(parent.document.getElementById("hidtab") != null)
        {
            parent.document.getElementById("hidtab").value = tab;
        }
    }
    else
    {
        if(parent.document.getElementById("hidparent_guid") != null)
        {
            parent.document.getElementById("hidparent_guid").value = value;
        }
    }
    
    var hidparent_guid = "0";
    if(parent.document.getElementById("hidparent_guid") != null)
    {
        hidparent_guid = parent.document.getElementById("hidparent_guid").value
    }
    else
    {
        hidparent_guid = value;
    }
    var hidtab = "1";
    if(parent.document.getElementById("hidtab") != null)
    {
        hidtab = parent.document.getElementById("hidtab").value;
    }
    else
    {
        hidtab = tab;
    }
    indicatorlist.document.getElementById("container").style.display = "none";//做跳转页面的效果.
    indicatorlist.location.href="indicatorlist.aspx?parent_guid="+hidparent_guid+"&tab="+hidtab;
}

function IndicatorView(value)
{
    indicatorlist.location.href="Indicator_Embody.aspx?IndicatorGUID="+value;
}

function ChartList(value, tab)
{
    if(value == "0")
    {
        if(parent.document.getElementById("hidtab") != null)
        {
            parent.document.getElementById("hidtab").value = tab;
        }
    }
    else
    {
        if(parent.document.getElementById("hidparent_guid") != null)
        {
            parent.document.getElementById("hidparent_guid").value = value;
        }
    }
    
    var hidparent_guid = "0";
    if(parent.document.getElementById("hidparent_guid") != null)
    {
        hidparent_guid = parent.document.getElementById("hidparent_guid").value
    }
    else
    {
        hidparent_guid = value;
    }
    var hidtab = "1";
    if(parent.document.getElementById("hidtab") != null)
    {
        hidtab = parent.document.getElementById("hidtab").value;
    }
    else
    {
        hidtab = tab;
    }
    chartlist.document.getElementById("container").style.display = "none";//做跳转页面的效果.
    chartlist.location.href="chartlist.aspx?parent_guid="+hidparent_guid+"&tab="+hidtab;
}

function ChartView(value)
{
    chartlist.location.href="Chart_Embody.aspx?ChartGUID="+value;
}

function TimeList(value, tab)
{
    if(value == "0")
    {
        if(parent.document.getElementById("hidtab") != null)
        {
            parent.document.getElementById("hidtab").value = tab;
        }
    }
    else
    {
        if(parent.document.getElementById("hidparent_guid") != null)
        {
            parent.document.getElementById("hidparent_guid").value = value;
        }
    }
    
    var hidparent_guid = "0";
    if(parent.document.getElementById("hidparent_guid") != null)
    {
        hidparent_guid = parent.document.getElementById("hidparent_guid").value
    }
    else
    {
        hidparent_guid = value;
    }
    var hidtab = "1";
    if(parent.document.getElementById("hidtab") != null)
    {
        hidtab = parent.document.getElementById("hidtab").value;
    }
    else
    {
        hidtab = tab;
    }
    timelist.document.getElementById("container").style.display = "none";//做跳转页面的效果.
	timelist.location.href="timelist.aspx?parent_guid="+hidparent_guid+"&tab="+hidtab;
}

function DiscussList(value, tab)
{
    if(value == "0")
    {
        if(parent.document.getElementById("hidtab") != null)
        {
            parent.document.getElementById("hidtab").value = tab;
        }
    }
    else
    {
        if(parent.document.getElementById("hidparent_guid") != null)
        {
            parent.document.getElementById("hidparent_guid").value = value;
        }
    }
    
    var hidparent_guid = "0";
    if(parent.document.getElementById("hidparent_guid") != null)
    {
        hidparent_guid = parent.document.getElementById("hidparent_guid").value
    }
    else
    {
        hidparent_guid = value;
    }
    var hidtab = "1";
    if(parent.document.getElementById("hidtab") != null)
    {
        hidtab = parent.document.getElementById("hidtab").value;
    }
    else
    {
        hidtab = tab;
    }
    discusslist.document.getElementById("container").style.display = "none";//做跳转页面的效果.
	discusslist.location.href="discusslist.aspx?parent_guid="+hidparent_guid+"&tab="+hidtab;
}

function KnowledgeList(value,tab)
{
   
    if(value == "0")
    {
        if(parent.document.getElementById("hidtab") != null)
        {
            parent.document.getElementById("hidtab").value = tab;
        }
    }
    else
    {
        if(parent.document.getElementById("hidparent_guid") != null)
        {
            parent.document.getElementById("hidparent_guid").value = value;
        }
    }
    
    var hidparent_guid = "0";
    if(parent.document.getElementById("hidparent_guid") != null)
    {
        hidparent_guid = parent.document.getElementById("hidparent_guid").value
    }
    else
    {
        hidparent_guid = value;
    }
    var hidtab = "1";
    if(parent.document.getElementById("hidtab") != null)
    {
        hidtab = parent.document.getElementById("hidtab").value;
    }
    else
    {
        hidtab = tab;
    }
    
//    alert(hidparent_guid);
//    alert(hidtab);
    if(document.getElementById("knowledgelist") != null)
    {
            knowledgelist.document.getElementById("container").style.display = "none";//做跳转页面的效果.
            knowledgelist.location.href="KnowledgeList.aspx?parent_guid="+hidparent_guid+"&tab="+hidtab+"";
//            document.getElementById("knowledgelist").document.getElementById("container").style.display = "none";//做跳转页面的效果.
//            document.getElementById("knowledgelist").location.href="KnowledgeList.aspx?parent_guid="+value+"&tab="+tab+"";
    }
}

function KnowledgeView(value)
{
    if(document.getElementById("knowledgelist") != null)
    {
        knowledgelist.location.href="knowledge_Embody.aspx?knowledgeID="+value;
    }
    //document.getElementById("knowledgelist").location.href="knowledge_Embody.aspx?knowledgeID="+value;
}

function do_favorite(id, favorite)
{
    //alert(id);

	var url = "/Library/NET/Favorite.aspx?id="+ id +"&favorite="+ favorite +"&r="+ Math.random();
	createXMLHttpRequest();

    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = do_favorite_req;
    XMLHttpReq.send(null);  
}

function do_favorite_req()
{
    if (XMLHttpReq.readyState == 4) 
    {
        if (XMLHttpReq.status == 200) 
        {
		    if (XMLHttpReq.responseText == "sccuess")
		    {
				alert("收藏成功。");
		    }
			else
			{
				if (XMLHttpReq.responseText == "delete")
				{
					location.reload();
				}
				else
				{
					alert("请先登录。");
				}
			}
        }
        else 
        {
     	   //alert(XMLHttpReq.responseText);
           alert("页面请求异常。");
        }
    }
}


function do_discuss(id, discuss)
{
    //alert(id);

	var url = "/Library/NET/Discuss.aspx?id="+ id +"&discuss="+ discuss +"&r="+ Math.random();
	createXMLHttpRequest();

    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = do_discuss_req;
    XMLHttpReq.send(null);  
}

function do_discuss2(id, discuss,reviewobject)
{

	var url = "/Library/NET/Discuss.aspx?id="+ id +"&discuss="+ discuss +"&r="+ Math.random()+"&reviewobject="+reviewobject;
	createXMLHttpRequest();

    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = do_discuss_req;
    XMLHttpReq.send(null);  
}

function do_userdiscuss(id)
{//alert('start');
	var url = "/Library/NET/UserDiscuss.aspx?id="+ id +"&r="+ Math.random();
	//alert('test1');
	createXMLHttpRequest();
	//alert('test2');
    XMLHttpReq.open("GET", url, true);
    //alert('test3');
    XMLHttpReq.onreadystatechange = do_discuss_req;
    //alert('test4');
    XMLHttpReq.send(null);  
    //alert('end');
}

function do_discuss_req()
{
    if (XMLHttpReq.readyState == 4) 
    {
        if (XMLHttpReq.status == 200) 
        {
		    if (XMLHttpReq.responseText == "sccuess")
		    {
				location.reload(true);
				//window.opener.location.href=window.opener.location.href
		    }
			else
			{
				//alert(XMLHttpReq.responseText);
				alert("页面请求异常。");
			}
        }
        else 
        {
     	   //alert(XMLHttpReq.responseText);
           alert("页面请求异常。");
        }
    }
}
function showbak(content)
{
    document.getElementById("bakDIV").style.display="";
    document.getElementById("textareabak").value = content;
}

function closebak()
{
    var bakdiv = document.getElementById("bakDIV");
    var textareabak = document.getElementById("textareabak");
    if(bakdiv != null){bakdiv.style.display="none";}
    if(textareabak != null){textareabak.value = "";}
}

function do_Knowledge(_id,_Knowledge)
{
    var id = _id;
    var Knowledge = _Knowledge;
    var url = "/Library/NET/Knowledge.aspx?id="+ id +"&r="+ Math.random()+"&Knowledge="+ Knowledge;
    createXMLHttpRequest();
    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = do_Knowledge_req;
    XMLHttpReq.send();
}

function do_sendpassmessage(Kid,InputBy)
{
    //var id = _id;
    //var Knowledge = _Knowledge;
    //alert(KTitle);
    var url = "/Library/NET/SendKnowledgePassMessage.aspx?Kid="+ Kid +"&r="+ Math.random()+"&InputBy="+ InputBy;
    createXMLHttpRequest();
    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = do_Knowledge_req;
    XMLHttpReq.send();
}
function OneKnowledgeEditState(Kid,KTitle,InputBy,Starte)
{
    do_Knowledge(Kid,Starte);
    if(Starte == 1)
    {
        do_sendpassmessage(Kid,InputBy);
    }
}
function do_Knowledge2(_id,_Knowledge)
{
    var id = _id;
    var Knowledge = _Knowledge;
    var url = "/Library/NET/Knowledge.aspx?id="+ id +"&r="+ Math.random()+"&Knowledge="+ Knowledge;
    createXMLHttpRequest();
    XMLHttpReq.open("GET", url, true);
    XMLHttpReq.onreadystatechange = do_Knowledge_req2;
    XMLHttpReq.send();
}

function do_Knowledge_req2()
{
    if (XMLHttpReq.readyState == 4) 
    {
        if (XMLHttpReq.status == 200) 
        {
		    if (XMLHttpReq.responseText == "sccuess")
		    {
				//location.reload(true);
				//window.opener.location.href=window.opener.location.href
		    }
			else
			{
				//alert(XMLHttpReq.responseText);
				//alert(XMLHttpReq.status);
				//alert("页面请求异常。");
			}
        }
        else 
        {
     	   //alert(XMLHttpReq.responseText);
           //alert("页面请求异常。");
           //alert(XMLHttpReq.status);
        }
    }
}

function LotKnowledgeEditState()
{
   var gvObject = document.getElementById("Knowledgetable");
    for(i = 0;i<gvObject.rows.length;i++)
    {
        if(gvObject.rows[i].cells[0].getElementsByTagName("INPUT")[0] != null)
        {
            if(gvObject.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked)
            {
                var Knowledgeid = gvObject.rows[i].cells[0].getElementsByTagName("INPUT")[0].value;
                //alert(gvObject.rows[i].cells[0].getElementsByTagName("INPUT")[1].value)
                var InputBy = gvObject.rows[i].cells[0].getElementsByTagName("INPUT")[1].value;
                do_Knowledge2(Knowledgeid,1);
                do_sendpassmessage(Knowledgeid,InputBy);
            }
        }
    } 
    location.reload(true);
}

function do_Knowledge_req()
{
    if (XMLHttpReq.readyState == 4) 
    {
        if (XMLHttpReq.status == 200) 
        {
		    if (XMLHttpReq.responseText == "sccuess")
		    {
				location.reload(true);
				//window.opener.location.href=window.opener.location.href
		    }
			else
			{
				alert(XMLHttpReq.responseText);
				alert(XMLHttpReq.status);
				//alert("页面请求异常。");
			}
        }
        else 
        {
     	   alert(XMLHttpReq.responseText);
           //alert("页面请求异常。");
           alert(XMLHttpReq.status);
        }
    }
}

function Type_Bind(TypePath,TypeID,level)
{
    if(document.getElementById("hidTypeID") !=null)
    {
        if(level == "lv1")
        {
            document.getElementById("typelv3checked").innerHTML = "";
            document.getElementById("typelv2checked").innerHTML = "";
            document.getElementById("typelv1checked").innerHTML = TypePath;
            document.getElementById("hidTypeID").value = TypeID;
            document.getElementById("hidTypePath").value = TypePath;
        }
        else if(level == "lv2")
        {
            document.getElementById("typelv3checked").innerHTML = "";
            document.getElementById("typelv2checked").innerHTML = TypePath;
            document.getElementById("hidTypeID").value = document.getElementById("hidTypeID").value.substring(0,6) + TypeID;
            document.getElementById("hidTypePath").value = document.getElementById("typelv1checked").innerHTML+">>" +TypePath;
        }
        else if(level =="lv3")
        {
            document.getElementById("typelv3checked").innerHTML = TypePath;
            document.getElementById("hidTypeID").value = document.getElementById("hidTypeID").value.substring(0,12) + TypeID;
             document.getElementById("hidTypePath").value = document.getElementById("typelv1checked").innerHTML +" >> " +document.getElementById("typelv2checked").innerHTML +" >> " +TypePath;
        }
    }
}