
String.prototype.ucwords = function () 
{

	var bits = this.split(/ /);
	var style = "";

	for (var i in bits)
	{
		style+= bits[i].charAt(0).toUpperCase() + bits[i].substr(1, bits[i].length - 1);
	}

	return style;
}

function getStyle(x,styleProp)
{
	if (typeof(x) == "string")
		x = document.getElementById(x);

	if (styleProp.match(/float/i))
		var styleProp2 = "styleFloat";
	else if (styleProp.match(/\-/))
	{
		var styleProp2 = styleProp.replace(/\-/, " ");
		styleProp2 = styleProp2.ucwords();
		styleProp2 = styleProp2.charAt(0).toLowerCase() + styleProp2.substr(1, styleProp2.length - 1);
	}
	else
	{
		var styleProp2 = styleProp.replace(/([A-Z])/,"-$1");
		styleProp2 = styleProp2.toLowerCase();
	}

	if (x.currentStyle)
	{
		var y = x.currentStyle[styleProp];
		if (!y) y = x.currentStyle[styleProp2];
	}
	else if (window.getComputedStyle)
	{
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
		if (!y) y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp2);
	}

	return y;
}