
function showsubmenu(sid) //控制菜单的显示
{
	whichEl = document.getElementById("subMenu" + sid);
	imgmenu = document.getElementById("MainMenu" + sid);
	if (whichEl.style.display == "none")
	{
		whichEl.style.display="block";
		imgmenu.background="images/Systemimages/menuup.gif";
	}
	else
	{
		whichEl.style.display="none";
		imgmenu.background="images/Systemimages/menudown.gif";
	}
}
function subTree(sid)//控制区域树状菜单
{

	var	which=document.getElementsByName("sub"+sid);

	//var img1 = eval("img1" + sid);
	//var img2 = eval("img2" + sid );
	//var img1 = document.getElementsByName("img1" + sid);
	//var img2 = document.getElementsByName("img2" + sid );	
	  var img1=document.getElementById("img1"+sid);
	  var img2=document.getElementById("img2"+sid);
		for(var i=0;i<which.length;i++)
	    {
	        if(which[i].style.display == "none")
	        {	
	            which[i].style.display="block";
	            img1.src = "../images/nofollow.gif";
	            img2.src = "../images/icon-folder-open.gif";
	        }
	         else
	        {
	            which[i].style.display="none";
	            img1.src = "../images/plus.gif";
	            img2.src = "../images/icon-folder-close.gif";	
	        }	        
	    }
	
}

function openTreeJG()//打开机构树
{
	window.open("../JGManage/TreeJG.ashx","JG","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=260,height=360,top=200,left=600");				
}
function openTreeJG2() //含下一级
{
    	window.open("../JGManage/TreePxd.ashx","JG","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=260,height=360,top=200,left=600");				

}
function openTreePxd()//打开机构树(含培训点)
{
	window.open("../Class/Treeclass.ashx","JG","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=260,height=360,top=200,left=600");				
}

function openTreeJGpx()//打开机构树
{
	window.open("../JGManage/TreeJGtwo.ashx","JG","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=260,height=360,top=200,left=600");				
}
function WriteJGName(strJgName,strJgNo)
{
    if(window.opener.document.form1.txtJg)
    {
        window.opener.document.form1.txtJg.value=strJgName;
        window.opener.document.form1.TxtJgNo.value=strJgNo;
    }
    window.close();
}
function WriteJGNamePxd(strJgName,strJgNo)
{
    if(window.opener.document.form1.txtJg)
    {
        window.opener.document.form1.txtJg.value=strJgName;
        window.opener.document.form1.TxtJgNo.value=strJgNo;
        var para=(document.all)?1:0;
        if(para)
        {
            var oServerXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else
        {
        
            var oServerXmlHttp = new XMLHttpRequest();
        }
        
          oServerXmlHttp.open("post","../Class/LoadTeacther.ashx?FNo="+strJgNo,false);
		  //alert(oServerXmlHttp.readyState); 
          oServerXmlHttp.send("");
                
        //alert(oServerXmlHttp.readyState); 
        var strErr = oServerXmlHttp.responseText;
        //alert(strErr);
        //分析返回的字符串
        //strErr.
        adv=strErr.split("|");
        SeNa=adv[1].split(",");
        SeId=adv[0].split(",");
        dd=SeId.length-1;
        ssd=SeNa.length-1;

       window.opener.document.form1.drpTeacher.length = 0;
        for(var i=0;i<dd;i++)
        {
            var op = window.opener.document.createElement("OPTION");
            op.value=SeId[i];
            op.innerHTML=SeNa[i];
            window.opener.document.form1.drpTeacher.appendChild(op);
        } 
        
        //写返回值
    }
    window.close();
}
