function GetEventSource(e)
{
	if(window.event != null)
		return e.srcElement;
	return e.target;
}
function GetPressedKey(e)
{
	if(window.event != null)
		return e.keyCode;

	return e.which;
}
function loadXML(url, handler) 
{
    if (document.implementation && document.implementation.createDocument) {
        var xmldoc = document.implementation.createDocument("", "", null);
        xmldoc.onload = function(  ) { handler(xmldoc); }
        xmldoc.load(url);
    }
    else if (window.ActiveXObject) { 
        var xmldoc = new ActiveXObject("Microsoft.XMLDOM");   
        xmldoc.onreadystatechange = function(  ) {              
            if (xmldoc.readyState == 4) handler(xmldoc);
        }
        xmldoc.load(url);                                     
    }
}
function CommandResult(command, error)
{
	if(typeof(CustomCommandResult) == "function")
		CustomCommandResult(command, error);
	else
	{
		if(error == null)
			window.alert("Succeeded");
		else
			window.alert(error);
	}
}
function IsIE()
{
	return (window.navigator.userAgent.indexOf("MSIE") != -1);
}