   $(document).ready(function() {
   $(function() {
 
        // setup overlay actions to buttons
        $("a[rel]").overlay({
 
            // use the Apple effect for overlay
            effect: 'apple',
            expose: '#789',
			
			onBeforeLoad : function() {
   				var that = this					
   				$(this.getOverlay()).remove().appendTo("body");
   				$(".close", this.getOverlay()).click(function(e){
				that.close();
  			});
			},
 
            onLoad: function(content) {
                // find the player contained inside this overlay and load it
                this.getOverlay().find("a.player").flowplayer(0).load();
            },
 
            onClose: function(content) {
                $f().unload();
            }
        });
 
        // install flowplayers
        $("a.player").flowplayer("/flowplayer/flowplayer-3.2.7.swf", {clip: { scaling: 'orig'}});
    })
    
   });
