// JavaScript Document
Ajax.Responders.register({
	onCreate: function() {
		if($('modal') && Ajax.activeRequestCount > 0)
		{	
			Control.Modal.open('<img src="/assets/images/ajax-loader.gif" width="16" height="16" align="center">&nbsp;Working...',{fade:false,fadeDuration:.25,width:200,height:40});
		}
	},
	onComplete: function() {
		if($('modal') && Ajax.activeRequestCount == 0)
		{
			Control.Modal.close();			
		}
			
	}
});

function getNodeValue(xml,node,subnode)
{
	if (!node) node = xml;
	try
	{
		if (node.getElementsByTagName(subnode)[0].hasChildNodes())
		{
			return node.getElementsByTagName(subnode)[0].firstChild.nodeValue;
		}
		else
		{
			if (typeof node.getElementsByTagName(subnode)[0] == 'object')
			{
				return "";
			}
			else
			{
				return node.getElementsByTagName(subnode)[0];
			}
		}
	}
	catch (err)
	{
		alert('XML Error : ' + err.message);
		return "";
	}
}

function ajaxDump(resp)
{
	$('ajaxdump').innerHTML = 'hello';
}