function popup(title, url, props, panelName)
{
    if (!panelName)
        panelName = "panel2";

    var panel = YAHOO.wyeth.container[panelName];
    var req = createRequestObject();
    if (!req)
        return false;
        
    req.open("GET", url, false);
    req.send("");
    
    if (panel) {
	    panel.setBody(req.responseText);
	    panel.setHeader(title);
        panel.show();
	    panel.center();
    }
    else {
	    YAHOO.wyeth.container[panelName] = new YAHOO.widget.Panel(panelName, props );//, visible:true, draggable:true, close:true } );
	    panel = YAHOO.wyeth.container[panelName];
	    panel.setHeader(title);
	    panel.setBody(req.responseText);
	    //YAHOO.compusa.container.panel2.setFooter("End of Panel #2");
	    panel.render(document.body);
	    panel.center();
	}
	
	return false;
}

function popup2(title, html, props, panelName)
{
    if (!panelName)
        panelName = "panel3";

    var panel = YAHOO.wyeth.container[panelName];
    
    //alert(html);
        
    if (panel) {
	    panel.setBody(html);
	    panel.setHeader(title);
        panel.show();
	    panel.center();
    }
    else {
	    YAHOO.wyeth.container[panelName] = new YAHOO.widget.Panel(panelName, props );//, visible:true, draggable:true, close:true } );
	    panel = YAHOO.wyeth.container[panelName];
	    panel.setHeader(title);
	    panel.setBody(html);
	    panel.render(document.body);
	    panel.center();
	}
	
	return false;
}

function msgBox(title, msg, paneWidth)
{
    var panelName = title + '_panel';
    var panel = YAHOO.wyeth.container[panelName];
    
    if (!paneWidth)
        paneWidth='500';
        
    if (title == '')
        title = '&nbsp;';
    if (panel) {
	    panel.setBody(msg);
	    panel.setHeader(title);
        panel.show();
	    panel.center();
    }
    else {
	    YAHOO.wyeth.container[panelName] = new YAHOO.widget.Panel(panelName, { width:paneWidth + 'px', visible:true, draggable:true, close:true } );
	    panel = YAHOO.wyeth.container[panelName];
	    panel.setHeader(title);
	    panel.setBody(msg);
	    panel.render(document.body);
	    panel.center();
	}
	
	return false;
}

/*
function showPrevAddr(id, name)
{
    return popup("Address Change History for " + name, "ach.aspx?id=" + id, 
    { width:'500px', visible:true, draggable:true, close:true });//, constraintoviewport1:true });
}

function showOfferDetails(id, name)
{
    return popup("details of " + name, "od.aspx?id=" + id, { width:'500px', visible:true, draggable:true, close:true });//, constraintoviewport1:true });
}
function showOfferDetails_forReports(id, name)
{
    return popup("details of " + name, "../user/od.aspx?id=" + id, { width:'500px', visible:true, draggable:true, close:true });//, constraintoviewport1:true });
}
function showRcptItems(id, name, subOfferId)
{
    return popup("Receipt Items", "rph.aspx?id=" + id + "&uoid=" + subOfferId, { width:'500px', visible:true, draggable:true, close:true });//, constraintoviewport1:true });
}
function showRcptItems_forReports(id, name, subOfferId)
{
    return popup("Receipt Items", "../user/rph.aspx?id=" + id + "&uoid=" + subOfferId, { width:'500px', visible:true, draggable:true, close:true });//, constraintoviewport1:true });
}
function showRejections_forReports(id, name, subOfferId)
{
    return popup("Rejections", "list_rejections.aspx?id=" + id, { width:'500px', visible:true, draggable:true, close:true });//, constraintoviewport1:true });
}

function showLargeImage(url, title)
{
    if (YAHOO.compusa.container.panelImage) {
	    YAHOO.compusa.container.panelImage.setHeader(title);
	    YAHOO.compusa.container.panelImage.setBody("<center><img src='" + url + "' alt='' border='0'></center>");
        YAHOO.compusa.container.panelImage.show();
	    YAHOO.compusa.container.panelImage.center();
    }
    else {
	    YAHOO.compusa.container.panelImage = new YAHOO.widget.Panel("panelImage", { width:'300px', visible:true, draggable:true, close:true } );
	    YAHOO.compusa.container.panelImage.setHeader(title);
	    YAHOO.compusa.container.panelImage.setBody("<center><img src='" + url + "' alt='' border='0'></center>");
	    YAHOO.compusa.container.panelImage.render(document.body);
	    YAHOO.compusa.container.panelImage.center();
	}
}

function showAddInfo(id, title, pathToRoot)
{
    return popup(title, pathToRoot + "services/dop.aspx?id=" + id + "&prop=additional_info", { width:'300px', visible:true, draggable:true, close:true }, "panelAddInfo");
}


function showReceipt(id)
{
    return popup("Receipt", "rcpt.aspx?id=" + id, { width:'350px', visible:true, draggable:true, close:true }, "receiptinfo");
}

function showReceiptChooser(userId, rcptId)
{
    return popup("Receipts", "rcptchooser.aspx?user_id=" + userId + "&orig_rcpt_id=" + rcptId, { visible:true, draggable:true, close:true }, "receiptchooser");
}

*/

