function hasBorderRadius() {
	var d = document.createElement("div").style;
	if (typeof d.borderRadius !== "undefined") return true;
	if (typeof d.WebkitBorderRadius !== "undefined") return true;
	if (typeof d.MozBorderRadius !== "undefined") return true;
	return false;
}
( function($) {
    // we can now rely on $ within the safety of our ÒbodyguardÓ function
    $(document).ready( function() {
	    if (hasBorderRadius()) {
			$("img.roundedCorners").each(function() {
				$(this).wrap('<div class="roundedCorners" />');
					var imgSrc = $(this).attr("src");
					var imgHeight = $(this).height();
					var imgWidth = $(this).width();
				$(this).parent()
					.css("background-image", "url(" + imgSrc + ")")
					.css("background-repeat","no-repeat")
					.css("height", imgHeight + "px")
					.css("width", imgWidth + "px");
				$(this).remove();
			});
		}
    });
} ) ( jQuery );

