window.addEvent('domready', function(){
	var box = new multiBox('mb', {
		overlay: new overlay(),
		showControls:false,
		_onOpen:function ()
		{
		    setTimeout(function(){
		        var m = document.getElementById('MultiBoxMediaObject').childNodes[0];
		        //alert(m);
                myAddListener(m, 'qt_ended', function(){box.close();}, false);
		    }, 2000);
		}
	});    			
});
	
	// So that we can catch the QT ended event and close the window.
function myAddListener(obj, evt, handler, captures)
{
    if ( document.addEventListener )
        obj.addEventListener(evt, handler, captures);
    else
        obj.attachEvent('on' + evt, handler); // IE requires this form
}
