
 

function get_mediainfo(mediainfoIndex) {
    switch (mediainfoIndex) {        

        case 0:
	    return  { "mediaUrl": "/media/chp0040/Response1.wmv",
                      "placeholderImage": "/media/chp0040/Response1_Thumb.jpg",
                      "chapters": [    
                                         
                                  ] };
                          
        default:
             throw Error.invalidOperation("No such mediainfo");
     }
}

function StartWithParent(parentId, appId) {
    new StartPlayer_0(parentId);
}

function StartPlayer_0(parentId) {
    this._hostname = EePlayer.Player._getUniqueName("xamlHost");
    Silverlight.createObjectEx( {   source: '/themes/default/common/homevideo/CH9player.xaml', 
                                        parentElement: $get(parentId ||"divPlayer_0"), 
                                        id:this._hostname, 
                                        properties:{ width:'100%', height:'100%', version:'1.0', background:document.body.style.backgroundColor, isWindowless:'false' }, 
                                        events:{ onLoad:Function.createDelegate(this, this._handleLoad) } } );
    this._currentMediainfo = 0;      
}
StartPlayer_0.prototype= {
    _handleLoad: function() {
        this._player = $create(   ExtendedPlayer.Player, 
                                  { // properties
                                    autoPlay    : false, 
                                    volume      : 1.0,
                                    muted       : false
                                  }, 
                                  { // event handlers
                                    mediaEnded: Function.createDelegate(this, this._onMediaEnded),
                                    mediaFailed: Function.createDelegate(this, this._onMediaFailed)
                                  },
                                  null, $get(this._hostname)  ); 
        this._playNextVideo();     
    },    
    _onMediaEnded: function(sender, eventArgs) {
        window.setTimeout( Function.createDelegate(this, this._playNextVideo), 1000);
    },
    _onMediaFailed: function(sender, eventArgs) {
        alert(String.format( Ee.UI.Xaml.Media.Res.mediaFailed, this._player.get_mediaUrl() ) );
    },
    _playNextVideo: function() {
        var cVideos = 1;
        if (this._currentMediainfo<cVideos)
            this._player.set_mediainfo( get_mediainfo( this._currentMediainfo++ ) );    
    }        
}

function StartPluginIntro(sender, args)
{
  sender.findName("PluginIntro").Begin();
}

function OnVideolist1MouseEnter(sender, args)
{
  sender.findName("Videolist1MouseEnter").Begin();
  sender.Cursor = "hand";
}

function OnVideolist1MouseLeave(sender, args)
{
  sender.findName("Videolist1MouseLeave").Begin();
  sender.Cursor = "default";
}

function OnVideolist2MouseEnter(sender, args)
{
  sender.findName("Videolist2MouseEnter").Begin();
  sender.Cursor = "hand";
}

function OnVideolist2MouseLeave(sender, args)
{
  sender.findName("Videolist2MouseLeave").Begin();
  sender.Cursor = "default";
}

function OnVideolist3MouseEnter(sender, args)
{
  sender.findName("VideoList3MouseEnter").Begin();
  sender.Cursor = "hand";
}

function OnVideolist3MouseLeave(sender, args)
{
  sender.findName("Videolist3MouseLeave").Begin();
  sender.Cursor = "default";
}

function OnVideolist4MouseEnter(sender, args)
{
  sender.findName("Videolist4MouseEnter").Begin();
  sender.Cursor = "hand";
}

function OnVideolist4MouseLeave(sender, args)
{
  sender.findName("Videolist4MouseLeave").Begin();
  sender.Cursor = "default";
}

function OnVideolist5MouseEnter(sender, args)
{
  sender.findName("Videolist5MouseEnter").Begin();
  sender.Cursor = "hand";
}

function OnVideolist5MouseLeave(sender, args)
{
  sender.findName("Videolist5MouseLeave").Begin();
  sender.Cursor = "default";
}

function OnVidelist1LeftMouseDown(sender, args)
{
 self.location.href = "http://ch9.hu/blogs/video/archive/2007/10/12/asp-net-3-5-233-s-vs-2008-bal-225-ssy-gyurival.aspx";
}

function OnVidelist2LeftMouseDown(sender, args)
{
  self.location.href = "http://ch9.hu/blogs/video/archive/2007/10/06/m-225-sodik-v-225-ltozat.aspx";
}

function OnVidelist3LeftMouseDown(sender, args)
{
  self.location.href = "http://ch9.hu/blogs/video/archive/2007/10/26/a-halo3-kultusz-233-s-ami-m-246-g-246-tte-van.aspx";
}

function OnVidelist4LeftMouseDown(sender, args)
{
  self.location.href = "http://ch9.hu/blogs/video/archive/2007/10/04/els-tesztanyag.aspx";
}

function OnVidelist5LeftMouseDown(sender, args)
{
  self.location.href = "http://ch9.hu/blogs/video/archive/2007/12/05/iis7-socival.aspx";
}
