YAHOO.namespace("fof.container");
YAHOO.fof.container.popup = new YAHOO.widget.Panel("popup", { 
        width:"500px", 
        visible:false, 
        constraintoviewport:true, 
        close: false,
        draggable: false,
        fixedcenter: true
    }
);
YAHOO.fof.container.popup.setHeader('&nbsp;');
YAHOO.fof.container.popup.setBody('<div class="content"></div>');
YAHOO.fof.container.popup.render(document.body);

function showPopup(content, width) {
    if (width)
        width = width + 'px';
    else
        width = '500px';
    YAHOO.fof.container.popup.cfg.setProperty('width', width);
    jQuery('#popup .content').html(content)
    if (jQuery('#popup_frame').length) {
        jQuery('#popup_frame').load(function () { YAHOO.fof.container.popup.show(); } );
    } else {
        YAHOO.fof.container.popup.show();
    }
}

function hidePopup() {
    YAHOO.fof.container.popup.hide();
}

function remotePopup(content_id, width) {
    ajaxPopup({action: 'ajax_static_content', id: content_id}, width);
}

function ajaxPopup(params, width) {
    jQuery.get(
        conf.ajax_url + 'index.php', 
        params, 
        function (data) {
            showPopup(data, width);
        }
    );    
}