﻿if (!window.MSDN)
	window.MSDN = {};

MSDN.Scene = function() 
{
}

MSDN.Scene.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		
		// Sample button event hookup: Find the button and then attach event handlers
		this.button = rootElement.children.getItem(0);	
		
		this.button.addEventListener("MouseEnter", Sys.Silverlight.createDelegate(this, this.handleMouseEnter));
		this.button.addEventListener("MouseLeftButtonDown", Sys.Silverlight.createDelegate(this, this.handleMouseDown));
		this.button.addEventListener("MouseLeftButtonUp", Sys.Silverlight.createDelegate(this, this.handleMouseUp));
		this.button.addEventListener("MouseLeave", Sys.Silverlight.createDelegate(this, this.handleMouseLeave));
	},
	
	// Sample event handlers
	handleMouseEnter: function(sender, eventArgs) 
	{
		// The following code shows how to find an element by name and call a method on it.
		var mouseEnterAnimation = sender.findName("mouseEnter");
		mouseEnterAnimation.begin(); 
	},
	
	handleMouseDown: function(sender, eventArgs) 
	{
		var mouseDownAnimation = sender.findName("mouseDown");
		mouseDownAnimation.begin(); 
	},
	
	handleMouseUp: function(sender, eventArgs) 
	{
		var mouseUpAnimation = sender.findName("mouseUp");
		mouseUpAnimation.begin(); 
		
		// Put clicked logic here
		alert("clicked");
	},
	
	handleMouseLeave: function(sender, eventArgs) 
	{
		var mouseLeaveAnimation = sender.findName("mouseLeave");
		mouseLeaveAnimation.begin(); 
	}
}

//移轉到相對應的網頁
function Hyperlink(sender , mouseEventArgs)
{
    var control=sender.getHost();
    
    var Picture1=control.content.findname("Picture1").Opacity;
    var Picture2=control.content.findname("Picture2").Opacity;


 	      
    
    if (Picture1 > Picture2)
    {
		document.location.href = 'http://www.microsoft.com/taiwan/sql2008/technical/training.aspx';

    }

    if (Picture2 > Picture1)
    {
		document.location.href = 'http://www.microsoft.com/taiwan/sql2008/download/trial-software.aspx';
	
    }
    
   
}
