﻿if (!window.Home)
	Home = {};

Home.Page = function() 
{
}

Home.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		this.control.content.findName("Storyboard1").Begin();
		// Sample event hookup:	
		//rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));
		//if (null != this.control.content.findName("MyHyperlink"))
		this.control.content.findName("Games").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink1));
		this.control.content.findName("Audio").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink2));
		this.control.content.findName("Video").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink3));
		this.control.content.findName("Surprise").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink4));
		this.control.content.findName("ObjControl").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink6));
		this.control.content.findName("DeepZoom").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink7));
		this.control.content.findName("PhotoAlbum").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink8));
		this.control.content.findName("WebBased").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleHyperlink5));
	},
	
	handleHyperlink1: function(sender, eventArgs)
	{
		window.location = "Games/Coinflip.html";
	},
	handleHyperlink2: function(sender, eventArgs)
	{
		window.location = "Audio/default.html";
	},
	handleHyperlink3: function(sender, eventArgs)
	{
		window.location = "Video/default.html";
	},
	handleHyperlink4: function(sender, eventArgs)
	{
		window.location = "Surprise/Default.html";
	},
	handleHyperlink6: function(sender, eventArgs)
	{
		window.location = "ObjectControl/Default.html";
	},
	handleHyperlink7: function(sender, eventArgs)
	{
	    window.location = "DeepZoom/Default.html";
	},
	handleHyperlink8: function(sender, eventArgs) {
	    window.location = "PhotoAlbum/Default.html";
	},
	handleHyperlink5: function(sender, eventArgs)
	{
		window.location = "../Default.aspx";
	},

	// 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();
	}
}