﻿if (!window.UntitledProject1)
	UntitledProject1 = {};

UntitledProject1.Page = function() 
{
}

UntitledProject1.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		// Sample event hookup:	
		rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));
	},
	
	// 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 onLoadAd(sender,args)
{
		sender.findName("AD1").Source = AdPic1;
		sender.findName("AD2").Source = AdPic2;
		sender.findName("AD3").Source = AdPic3;
}
function ShowAd(sender,args)
{
		sender.findName("Storyboard1").Duration="0:0:4";
		sender.findName("Storyboard1").Begin(); 
}

function CloseAd(sender,args) 
{
		sender.findName("Storyboard1").Duration="5:5:9";
		sender.findName("Storyboard1").Begin(); 
}
