function ajaxFetchUrl(furl, callback)
{
	advAJAX.get({
	  url : furl,
	  onSuccess : function(obj) {
	  	callback(obj.responseXML);
		return obj.responseXML;
	  },
          onError : function(obj) {}
	});
}

function addLoadEvent(func) {
	if(document.addEventListener && navigator.userAgent.indexOf('Gecko/') != -1) {
		document.addEventListener("DOMContentLoaded", function(){func()}, false);
	}
	//Only MSIE defers execution of scripts until DOM loaded
	else if(/MSIE/.test(navigator.userAgent) && !window.opera) {
		var name = Math.random();
		window[name] = function(){func()};

		var script = document.createElement('script');
		script.type = 'text/javascript';
		script.src = "javascript:window[" + name + "](); " + 
			"window[" + name + "] = null; void(0);";
		script.defer = true;
		document.getElementsByTagName('head')[0].appendChild(script);			
	}
	//fall back to using onload (original Behaviour code)
	else {
		var oldonload = window.onload;
		
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
	}
}
