function get_xml_elm_value_by_name(XML, element_name)
{
	var element = XML.getElementsByTagName(element_name);
	if (element.length > 0)
	{
		if (element[0].childNodes.length > 0)
		{
			var value = '';
			
			for(i = 0; i < element[0].childNodes.length; i++)
			{
				value += element[0].childNodes[i].nodeValue;
			}
		}
		else
		{
			var value = "";
		}
	}
	else
	{
		var value = false;
		/*alert("Error #1002: XML parse failed, error getting [" + element_name + "] element");*/
	}
	
	return value;
}

//usethis function when no returnaction is needed
function ajax_do_nothing(request)
{
	//do nothing
}

function do_ajax_request(url, params, return_function)
{
    var myAjax = new Ajax.Request(url, 
    {method : 'get', parameters : params, onComplete : return_function }
    );
}

function htmlSpecialCharsReversed(str)
{
	str = str.replace(/&lt;/gi, '<');
	str = str.replace(/&quot;/gi, '"');
	str = str.replace(/&gt;/gi, '>');
	str = str.replace(/&amp;/gi, '&');
	str = str.replace(/>/, '>');
	str = str.replace(/</, '<');
	str = str.replace(/'/, '\'');
	str = str.replace(/"/, '\"');
	str = str.replace(/&/, '&');
	
	return str;
}