function showModalPanel(title, content, width) {

    panel = 
        new YAHOO.widget.Panel("panel",  
            { width:width+"px",
              fixedcenter:true, 
              close:true, 
              draggable:true, 
              zindex:4,
              modal:true,
              visible:false
            } 
        );

    //YAHOO.util.Event.addListener(panel, "hide", function() { this.destroy(); }, this);
    panel.hideEvent.subscribe(function() { this.destroy(); });
     
    panel.setHeader(title);
    panel.setBody(content);
    panel.render(document.body);
    YAHOO.util.Dom.setStyle(panel.body, "width", (width-20)+"px"); // ugly hack!
    panel.show();
}

function showVideo(title, videoUrl, previewImage, width, height) {
    var content = '<div id="mvcontainer" style="width: '+width+'px; height: ' + (height+20) + 'px; margin: auto"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>';
    showModalPanel(title, content, (width+20));
    var s1 = new SWFObject("https://media.dreamhost.com/mp5/player.swf","ply",width,height,"9","#FFFFFF");
    s1.addParam("allowfullscreen","true");
    s1.addParam("allowscriptaccess","always");
    s1.addParam("flashvars","file="+videoUrl+"&image="+previewImage);
    s1.write("mvcontainer");
}

