//---te zmienne mają być globalne---
var obj, obj1;

if (!window.Media)
	Media = {};

Media.Page = function() 
{
}

Media.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		
		// Sample event hookup:	
		rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));
		
        //---the original video---
        obj = this.control.content.findName("WindowsMedia_wmv");
   
        //---the reflected video---
        obj1 = this.control.content.findName("WindowsMedia_wmv1");
	},
	
	// Sample event handler
	handleMouseDown: function(sender, eventArgs) 
	{
		// The following line of code shows how to find an element by name and call a method on it.
		// this.control.content.findName("Storyboard1").Begin();
	}
}

function MouseEnter (sender, eventArgs)
{  
   //---wyciszenie odbitego elementu wideo---
   obj1.volume=0;
    
   //---odtwarzanie obu elementów wideo---
   obj.play();
   obj1.play();
}

function MouseLeave (sender, eventArgs)
{  
   //---wstrzymanie obu elementów wideo---
   obj.pause();
   obj1.pause();
}

function MouseClick (sender, eventArgs)
{  
   //---zatrzymanie obu elementów wideo---
   obj.stop();
   obj1.stop();
}
