	
	function xGetElementById(e)
	{
		if(typeof(e)=='string') {
			if(document.getElementById) e=document.getElementById(e);
			else if(document.all) e=document.all[e];
			else e=null;
		}
		return e;
	}
	
	function xGetElementById2(doc, e)
	{
		if(typeof(e)=='string') {
			if(doc.getElementById) e=doc.getElementById(e);
			else if(doc.all) e=doc.all[e];
			else e=null;
		}
		return e;
	}
	
	function trim(str)
	{ 
		str = str.replace(/^\s*/, '').replace(/\s*$/, ''); 
		return str;
	} 
	
	function loadXMLDoc(dname, async) 
	{
		try // Internet Explorer
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		}
		catch(e)
		{
			try // Firefox, Mozilla, Opera, etc.
			{
				xmlDoc = document.implementation.createDocument("", "", null);
			}
			catch(e)
			{
				alert(e.message)
			}
		}
		try 
		{
			if (async == true)
				xmlDoc.async = true;
			else
				xmlDoc.async = false;
			
			xmlDoc.load(dname);
			return(xmlDoc);
		}
		catch(e)
		{
			alert(e.message)
		}
		return null;
	}
