	var xmlhttp = false;
	var currentPos = null;
	
	if(window.XMLHttpRequest)
	{
		xmlhttp = new XMLHttpRequest();
		if (xmlhttp.overrideMimeType) {
			xmlhttp.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) 
	{
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	function sendRequest(url) {

		if (!xmlhttp) { 
			window.alert("出现错误，请更换浏览器再试。");
			return false;
		}
		xmlhttp.open("GET", url, true);
		xmlhttp.onreadystatechange = processRequest;
		xmlhttp.send(null);
	}

	function processRequest()
	{
        if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
				document.getElementById('result').innerHTML = '保存成功！';
            } else {
				document.getElementById('result').innerHTML = '保存失败！';
            }
        }
    }

	function save_notebook( )
	{
		var text = document.getElementById('beiwanglu').innerHTML;
		document.getElementById('result').innerHTML = '正在保存...';
		sendRequest("save_notebook.php?text="+text);
	}
