/*
函数功能：通过输入数据，获取fuuid为输入uuid的字节点数据信息，并将获取的节点数据信息
添加到树上。
输入：service——服务名称；
     uuid——选中节点唯一标志；
	 nid——选中节点id；
	 tkid——对应题库唯一标志。
输出：无
*/
function refresh(id,URL)
{	
	//alert("id="+id+",URL="+URL);
	var xmlDoc = new ActiveXObject("MSXML.DOMDocument");
	//var a=xmlDoc.createElement("a");
	//xmlDoc.appendChild(a);
	//a.text="test";
	var http = xmlhttp();
	http.open("get",URL,false);
	http.setRequestHeader("context-type","text/xml");
	http.setRequestHeader("charset","utf-8");
	http.send();
	var str=http.responseText;
	//alert(str);
	var div=document.getElementById(id);
	if (div!=null) div.innerHTML=str; 	
}
/*
函数功能：创建一个XMLHTTP对象
输入：无
输出：一个XMLHTTP对象
*/
function xmlhttp()
{
    var A=null;
    try {
        A=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e) {
        try {
            A=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(oc) {
            A=null
        }
    }
    if ( !A && typeof XMLHttpRequest != "undefined" ) {
        A=new XMLHttpRequest();
    }
    return A;
}

function donothing() {}

function showwindow(url,width,height) {
    if (typeof(width)=="undefined") width="600";
    if (typeof(height)=="undefined") height="600";
    window.showModalDialog(url,window,"dialogWidth="+width+"px;dialogHeight="+height+"px;help:no;status:no");
}

function replacehtml(str) {
	var str;
  str=str.replace(/\&lt;/g, "<");
  str=str.replace(/\&gt;/g, ">");
  str=str.replace(/\&amp;/g, "&");
  str=str.replace(/\\\"/g, "\"");
  return str;
}

function replacexml(str) {
    var str;
    str=str.replace(/\&/g, "&amp;");
    return str;
}

function replaceand(str) {
    var str;
    str=str.replace(/\&amp;/g, "&");
    return str;
}