var p_status = 0;

if (!window.PitchIt_Themplate)
	window.PitchIt_Themplate = {};

    PitchIt_Themplate.Scene = function() 
    {
    }

    PitchIt_Themplate.Scene.prototype =
    {
	    handleLoad: function(plugIn, userContext, rootElement) 
	    {
		    this.plugIn = plugIn;
	    }
    }
    function createSilverlight()
    {
	    var scene5 = new PitchIt_Themplate.Scene();
	    var vh = "'" + this.vidHeight + "'";
	    Silverlight.createObjectEx({
		    source: '/SiteCollectionDocuments/Silverlight/small_Player.xaml',
		    parentElement: document.getElementById(this.PluginDivId),
		    id: this.PluginId,
		    properties: {
			    width: "100%",
			    height: "100%",
			    background:'#00ffffff',
                isWindowless: 'true',
                inplaceInstallPrompt:true, // Determines whether to display 
			    version: '1.0'
		    },
		    events: {
		        onError: "onErr",
			    onLoad: null
		    },		
		    context: null 
	    });
    }
    
function SPB_Click(sender, eventArgs)
{
    var movie = sender.findName("SPlayer");
    movie.opacity = 1;
    
    if(p_status == 1)
    {
        movie.pause();
        this.p_status = 0;
    }
    else
    {
        movie.play();
        this.p_status = 1;
    }   
}

function SPmovie_stopped(sender, eventArgs)
{
    sender.findName(sender.name).stop();
    this.p_status = 0;
}

function GetMovie(sender, eventArgs)
{
    var movie = sender.findName("SPlayer");
    this.p_status = 1;
    movie.opacity = 1;
    sender.findName("SPlayer").Source = SMP_movie[0];
    movie.width= this.vidWidth;
    movie.Height= this.vidHeight;
    movie.autoplay= this.vidAutoPlay;
    var plugin = document.getElementById(this.PluginId);
    plugin.width = this.vidWidth;
    plugin.height = this.vidHeight;
    //movie.play();
}
