function jcorner_add()
{
  $("img.jcorners").each(function() {
			var img_src = $(this).attr("src");
			var img_width = $(this).width();
			var img_height = $(this).height();
			var img_alt = $(this).attr("alt");
			if (img_alt == null)
				{
					img_alt = "";
				}
			$(this).replaceWith("<div class='jcornered' title='"+ img_alt +"' style='position:relative; height:"+ img_height +"px ; width:"+ img_width +"px ; background-image:url("+ img_src + ")'><span class='jcorner_tl'></span><span class='jcorner_tr'></span></div>");
		});
}

//
// Adds event to window.onload without overwriting currently 
// assigned onload functions.
function addLoadEvent(func)
{    
    var oldonload = window.onload;
    if (typeof window.onload != 'function')
    {
        window.onload = func;
    } 
    else 
    {
        window.onload = function()
        {
            oldonload();
            func();
        }
    }
}