
function IDOf (id) {
	return document.getElementById(id);
}

function doNothing () {}

function refresh (pbs, args) {
    //Given an asp generated postback request string and a string of 
    //of arguments, the postback can be done with arguments which can
    //set clientside.
    pbs = pbs.replace("junk", args);
    eval(pbs);
}

function getIntFromCSSUnit (s) {
	var n = s.split(/[a-zA-Z]/);
	return parseInt(n[0]);
}

function getAssoc (str, sep1, sep2) {
	var aFmt = str.split(sep1);
	var aKV = Array();
	for (var i = 0; i < aFmt.length; i++) {
		aKV[aFmt[i].split(sep2)[0]] = aFmt[i].split(sep2)[1];
	}
	return aKV;
}

function addCommas (amt) {
	if (amt >= 1000) {
		amt += "";
		var aCurr = amt.split("");
		amt = '';
		pos = 0;
		for (var i = aCurr.length - 1; i >= 0; i--) {                                
			if (pos > 2 && pos % 3 == 0)
				amt = "," + amt;
			
			amt = aCurr[i] + amt;
			pos++;
		}
	}
	return amt;
}

function unescapeXMLChar(strInput)
{
    strInput = strInput.replace(/&amp;/g, "&");
    strInput = strInput.replace(/&lt;/g, "<");
    strInput = strInput.replace(/&gt;/g, ">");
    strInput = strInput.replace(/&quot;/g, '"');
    strInput = strInput.replace(/&apos;/g, "'");

    return strInput;
}