$.fn.firePopUp = function(header,text,buttonText,url) {	
	$('#popUpInfo').remove();  // If the popUpInfo box has been open then remove it 
	var o                   = $(this[0]);
	var id                  = $(o).attr("id");
	var dialog              =  '<div id="popUpInfo" style="width:200px; height:60px;">';
		dialog				+= '<p style="text-align:center; font:14px Verdana,Geneva,sans-serif; margin-top:15px;">'+header+'</p>';
		dialog	            += '<p style="text-align:center; font:9px Verdana,Geneva,sans-serif;">'+text+'</p>';
		dialog              += '<div>';	
	var dialogIndex         = $.getHighestIndex() + 1; 
	var dialog_buttons = {};
		dialog_buttons[buttonText] = function(){ window.location = url; };
	$('body').append(dialog);
	$('#popUpInfo').dialog({
						   resizable:false,
						   zIndex:dialogIndex,
						   buttons: dialog_buttons
	});	
};

$.getHighestIndex = function()
{
	  var maxZ = Math.max.apply(null,$.map($('body > *'), function(e,n){
           if($(e).css('position')=='absolute')
                return parseInt($(e).css('z-index'))||1 ;
           })
      );
	  return  maxZ;
}
