function CurrencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}


function rndAjax(url,parm,fun)
{
	ajax = new GLM.AJAX();
	ajax.callPage(url+"?r="+rnd()+"&"+parm,fun);
}
function getObj(id)
{
	return document.getElementById(id);
}
function getComboVal(id)
{
	obj = document.getElementById(id);
	return obj[obj.selectedIndex].value;
}
function getTextVal(id)
{
	return getObj(id).value;
}
function getCheckBoxVal(id)
{
	obj = getObj(id);
	if(obj.checked=true)
	{
		return 'Y';
	}
	else
	{
		return 'N';
	}
}
function parseXML(response)
{
	if (window.DOMParser)
	  {
		  parser=new DOMParser();
		  xmlDoc=parser.parseFromString(response,"text/xml");
	  }
	else // Internet Explorer
	  {
		  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		  xmlDoc.async="false";
		  xmlDoc.loadXML(response);
	  }	
	  return xmlDoc;
}
function getTextVal(id)
{
	return getObj(id).value;
}
function xmlNodeValue(xmlDoc,key)
{
	if(xmlDoc.getElementsByTagName(key)[0].childNodes.length>0)
	{
		return xmlDoc.getElementsByTagName(key)[0].childNodes[0].nodeValue;
	}
	else
	{
		return '';
	}
}