// JavaScript Document for nicoleandgreg.net

function set_box_heights(){
// first the headline vs. featured	
	if($("featured")){
		var featured_height = $style("featured","height");
		var headline_height = $style("headline", "height");
		if(featured_height > headline_height) { $("headline").style.height = featured_height;}
		else{$("featured").style.height = headline_height;}
	}
// now the footer boxes, "recentpost", "mostcommented", and "recent_comments"
	var popular_heights = new Array();
	popular_heights[0] = $style("recentpost","height"); popular_heights[1] = $style("mostcommented","height"); popular_heights[2] = $style("recent_comments","height");
	popular_heights.sort();
	$("recentpost").style.height =  popular_heights[2]; $("mostcommented").style.height =  popular_heights[2]; $("recent_comments").style.height =  popular_heights[2];

}

function $(stringId)
{
	return document.getElementById(stringId);
}

function $style(ElementId, CssProperty)
{
	if($(ElementId).currentStyle)
	{
		var convertToCamelCase = CssProperty.replace(/\-(.)/g, function(m, l){return l.toUpperCase()});
		return $(ElementId).currentStyle[convertToCamelCase];
	}
	else if (window.getComputedStyle)
	{
		var elementStyle = window.getComputedStyle($(ElementId), "");
		return elementStyle.getPropertyValue(CssProperty);
	}
}
