function getReference(strID)
{
	if (document.getElementById)
		return document.getElementById(strID);
	else if (document.all)
		return document.all[strID];
	else if (document.layers)
		return document.layers[strID];
	return null;
}

function strReplace(strInput, strSearch, strReplace, boolIgnoreCase)
{
	var strOptions = "mg" + (boolIgnoreCase ? "i" : "");
	var objRegexp = new RegExp(strSearch, strOptions);
	return strInput.replace(objRegexp, strReplace);
}

function strTrim(strInput)
{
	var strOutput = strInput.replace(/^\s*/mg, "");
	return strOutput.replace(/\s*$/mg, "");
}

function strLeftTrim(strInput)
{
	return strInput.replace(/^\s*/mg, "");
}

function strRightTrim(strInput)
{
	return strInput.replace(/\s*$/mg, "");
}

function setStyle(objElement, strAttribute, strValue)
{
	if (objElement == null) return false;
	objElement.style[strAttribute] = strValue;
	return true;
}

function getStyle(objElement, strAttribute)
{
	if (objElement == null) return null;
	var strValue = objElement.style[strAttribute];
	if (!strValue)
	{
		if(document.defaultView)
			strValue = document.defaultView.getComputedStyle(objElement, "").getPropertyValue(strAttribute);
		else if (objElement.currentStyle)
			strValue = objElement.currentStyle[strAttribute];
	}
	return strValue;
}
