
/*
	This function will call an ajax URL get string to
	the "primaryURL" listed, passing the parameters of
	a unique "id" and an "action" incase the page handles
	multiple actions/popups, etc...
	"title" is optional...
*/
function ExecutePopUp(id, action, primaryURL, title) {
/*
	var payload = primaryURL;
	payload += "?id=" + escape(id);
	payload += "&action=" + escaoe(action);
	
	$.get(payload, function(retVal) {
		alert(retVal);
	});
*/
	if($("#osimo_popupbox").length==0)
	{
		$('body').prepend("<div id=\"osimo_popupbox\"></div>");
	}
	$("#osimo_popupbox").dialog({
	    title: title,
	    modal: true,
	    resizable:false,
	    overlay: {
	    	opacity: 0.5,
	    	background: "black"
	    },
        height: 500,
        width: 670,
        open:function(){
            $.ajax({
            	type:'POST',
            	url:primaryURL,
            	data:'action=' + escape(action) + '&id=' + escape(id),
            	success:function(msg){
            		if(msg!='0')
            		{
            			$('#osimo_popupbox').html(msg).show();
            		}
            		else
            		{
            			$(this).dialog('destroy');
            		}
	        	}
	        });
        },
        close:function(){
        	$(this).dialog('destroy');
        }
	});
}
