var xmlhttp;
var myhandler;

function loadXMLDoc(url,handler)
{
	myhandler=handler;
	xmlhttp=null;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if (xmlhttp!=null)
	{
	
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	{
		// if "OK"
		if (xmlhttp.status==200)
		{
			//pause();
			myhandler(xmlhttp.responseText);
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp.statusText);
		}
	}
}


function pause()
{
	alert('1');
	setTimeout("loadXMLDoc('note.xml',state_Change,doAlert)",1000);
	alert('2');
}

function doAlert(p1)
{
	alert(p1);
}


function clear()
{
	var vElement = document.getElementById('xmlvalue');
	vElement.innerHTML = "clear";
	
	setTimeout("loadXMLDoc('note.xml')",1000);
}
