/*function showvideo(url, title) {
	showvideo(url, title, 640, 480);
}*/

function showvideo(url, title, pWidth, pHeight ) {
	if(pWidth == null) { pWidth = 640; }
	if(pHeight == null) { pHeight = 514; }
	
	var player = $f("showvideo_player", "/flowplayer/flowplayer-3.0.7.swf", {
        clip:{ 
            url: url, 
            scaling: 'fit',
            
            // these two configuration variables does the trick 
            autoPlay: true,  
            autoBuffering: true,
        
            // track start event for this clip         
            onStart: function(clip) {             
                pageTracker._trackEvent("Videos", "Play", clip.url);         
            }, 
         
            // track pause event for this clip. time (in seconds) is also tracked        
            onPause: function(clip) {             
                    pageTracker._trackEvent("Videos", "Pause", clip.url, parseInt(this.getTime()));         
            },                 
         
            // track stop event for this clip. time is also tracked         
            onStop: function(clip) {             
                    pageTracker._trackEvent("Videos", "Stop", clip.url, parseInt(this.getTime())); 
            },                  
         
            // track finish event for this clip         
            onFinish: function(clip) {   
               player.getPlugin("play").css({opacity:0});
               pageTracker._trackEvent("Videos", "Finish", clip.url);         
            }        
        
        },
        plugins: {
            // default controls with the same background color as the page background 
            controls:  {              
                all:false, 
                play: true,
                stop: false,
                time: true,
                scrubber:true,
                volume: true,
                mute:true,
                fullscreen: true 
            }
        } 
    }); 
	
	
	var dialog = $("#showvideo_player").dialog({
		autoOpen: false,
		modal: true, 
		zresizable: false,
		zautoResize:true,
		width: pWidth, 
		height: pHeight,
		title: title, 
		open: function(event, ui) { player.load();},
		close: function(event, ui) { player.unload(); },
		show: 'slide'
	});
	
	player.play( {
        url: url, 
        
        // these two configuration variables does the trick 
        autoPlay: true,  
        autoBuffering: true,

        // track start event for this clip         
        onStart: function(clip) {             
            pageTracker._trackEvent("Videos", "Play", clip.url);         
        }, 
     
        // track pause event for this clip. time (in seconds) is also tracked        
        onPause: function(clip) {             
                pageTracker._trackEvent("Videos", "Pause", clip.url, parseInt(this.getTime()));         
        },                 
     
        // track stop event for this clip. time is also tracked         
        onStop: function(clip) {             
                pageTracker._trackEvent("Videos", "Stop", clip.url, parseInt(this.getTime())); 
        },                  
     
        // track finish event for this clip         
        onFinish: function(clip) {             
           player.getPlugin("play").css({opacity:0});
           pageTracker._trackEvent("Videos", "Finish", clip.url);         
        }        
    
	});
	
	$('#showvideo_player').dialog('option', 'title', title);
	
	$("#showvideo_player").dialog('open');
	
}