
function create_XMLHttpRequest()
{
	if (window.XMLHttpRequest)
	{
		return new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		return false;
		/*
		document.getElementById('p_status').innerHTML = 
		'Status: Cound not create XmlHttpRequest Object.' +
		'Consider upgrading your browser.';
		*/
	}
}

function xml_get_field(xmldoc, field_name)
{                   
	var xml_array = xmldoc.getElementsByTagName(field_name);
	
	if( xml_array.length > 0 )
	{
		if( xml_array[0].firstChild != null )
		{
			return xml_array[0].firstChild.nodeValue;
		}
		else
		{
			return "";
		}
	}
	else
	{
		return "";
	}
} 


// Hide the div's with the class 'javascript_hide', used for buttons when javascript is enabled and the functions can use ajax.
function hide_javascript_divs()
{
	var div_elements = document.getElementsByTagName('div');

	for (i=0; i<div_elements.length; i++)
	{
		if (div_elements[i].className == 'javascript_hide')
		{
			div_elements[i].style.display = "none";
		}
	}
}


function hide_javascript_trs()
{
	var div_elements = document.getElementsByTagName('tr');

	for (i=0; i<div_elements.length; i++)
	{
		if (div_elements[i].className == 'javascript_hide')
		{
			div_elements[i].style.display = "none";
		}
	}
}