function refresh() {
//	document.location.href = 'index.php';
	window.location.href = '';
}

function fetchURL(url, divchange, divchangevalue, divresult) {
	//alert('Fetching URL :' + url);
	var xmlhttp=false;
	var ticks=0;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp = false;
	  }
	 }
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	
//	document.getElementById(divchange).innerHTML = divchangevalue;
	document.getElementById(divchange).innerHTML = '<div><img src="animatedprogressbar.gif" border="0" /> <small>Mohon tunggu...</small></div>';

	xmlhttp.open("GET", url ,true);
	xmlhttp.onreadystatechange=function() {
	  if (xmlhttp.readyState==4) {
	            result = xmlhttp.responseText;
				//alert('Result: ' +result);
				if (result != "") {
					document.getElementById(divresult).innerHTML = result;
					if (divchangevalue == "refresh") {
						//alert('Logging out');
						//ticks = setTimeOut("refresh()", 3000);
						window.location.href = '';
					}
				}
	  }
	}
    xmlhttp.send(null)

}

