// requires jQuery
function enlargeBadge(event,url,title,description,width,height)
{
  var enlarged, badgeHtml, cursor;

  if (!width) {
  	width = 50;
  }
  if (!height) {
  	height = 50;
  }
  if (!jQuery('#enlargedBadge').get(0)) {
    cursor = getPosition(event);
    enlarged = jQuery('<div id="enlargedBadge"></div>');
    badgeHtml = '<h4>' + title + '</h4>';
    badgeHtml = badgeHtml + '<p>' + description + '</p>';
    badgeHtml = badgeHtml + '<div style="text-align: center;">';
    badgeHtml = badgeHtml + '<img src="' + url + '" height="' + height +'" width="'+ width +'" border="0"></div>';
    jQuery('body').append(enlarged)
    enlarged.append(badgeHtml);
    enlarged.css('left', cursor.x + 20 + 'px');
    enlarged.css('top', (cursor.y - enlarged.height() + 10) + 'px');
  }
}
function removeEnlargement()
{
  jQuery('#enlargedBadge').remove();
}
function getPosition(e) 
{
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}
