/*
* ajax_conn()
*
* used to initialize an xmlHttpRequest object on all
* supported browsers
*
* @return object xmlHttpRequest object
*/
function ajax_conn()
{
	var tmp;

	try
	{
		tmp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try
		{
			tmp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			tmp = null;
		}
	}

	if ( !tmp && typeof XMLHttpRequest != 'undefined' )
	{
		tmp = new XMLHttpRequest();
	}

	if ( !tmp )
	{
		return false;
	}

	return tmp;
}

/*
* div_reference
*
* used to wrap a getElementById-like ability
* for all capable browsers
*
* @param string id name of element/id/later/etc to return
* @return object id
*/
function div_reference(id)
{
	if( document.layers )
	{ //Netscape layers
        	return document.layers[id];
	}
	if( document.getElementById )
	{ //DOM; IE5, NS6, Mozilla, Opera
        	return document.getElementById(id);
	}
	if( document.all )
	{ //Proprietary DOM; IE4
        	return document.all[id];
	}
	if( document[id] )
	{ //Netscape alternative
        	return document[id];
	}
	return false;
}


function gettext(msgid) { return msgid; }
function ngettext(singular, plural, count) { return (count == 1) ? singular : plural; }
function gettext_noop(msgid) { return msgid; }
function interpolate(fmt, obj, named) {
    if (named) {
        return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
    } else {
        return fmt.replace(/%s/g, function(match){return String(obj.shift())});
    }
}