function equalHeight(group) {
    var tallest = 0;
    
    Ext.each(group, function() {
    	var thisHeight = Ext.get(this).getHeight();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    
    Ext.each(group, function() {
    	Ext.get(this).setHeight(tallest);
    })
}

function ellipsisText(element, text) {
	var height = element.offsetHeight;
	element.innerHTML = '<span id="ellipsisSpan">' + text + '</span>';
	inSpan = document.getElementById('ellipsisSpan');
	if (inSpan.offsetHeight > height) {
		var i = text.length;
		while(inSpan.offsetHeight > height && i > 0) {
			inSpan.innerHTML = text.substr(0,i) + '...';
			i--;
		}
		returnText = inSpan.innerHTML;
		element.innerHTML = '';
		return returnText;
	}
	return text;
}

function capitalizeString(text) {
	newText = '';
	text = text.split(' ');
    for(var c=0; c < text.length; c++) {
    	newText += text[c].substring(0,1).toUpperCase() + text[c].substring(1,text[c].length) + ' ';
    }
    return newText;
}

function commify(nStr) {
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}
