﻿if (!window.education)
	window.education = {};

education.Page = function() 
{
}

education.Page.prototype =
{

	handleLoad: function(control, userContext, rootElement) 
	{
		this.skip = true;
		this.control = control;
		var head = rootElement.findName("headlineAni");
		head.addEventListener("Completed", Silverlight.createDelegate(this, this.startschwamm));
		var sender=rootElement;
		sender.findName("lizenzierung").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.dolizensierung));
		sender.findName("produkte").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.doprodukte));
		sender.findName("nachlese").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.donachlese));
		sender.findName("initiative").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.doinitiative));
		sender.findName("kontakt").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.dokontakt));
		sender.findName("ressourcen").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.doressourcen));
		sender.findName("academic").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.doacademic));
		sender.findName("support").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.dosupport));
		
		rootElement.findname("skipRepeat").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.skipIntro));
	},
	startschwamm:function(sender){
		var schwamm=sender.findName("schwammAni");
		schwamm.addEventListener("Completed", Silverlight.createDelegate(this, this.startmenu));
		schwamm.Begin();
	},
	startmenu: function(sender){
		var menu=sender.findName("menuAni");
		menu.addEventListener("Completed", Silverlight.createDelegate(this, this.end));
		menu.Begin();
			
		//sender.findName("lizenzierung").addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.dolizensierung));		
	},
		
	dolizensierung:function(){
		//alert('lizensierung');
		top.location="http://www.microsoft.com/austria/education/lizenzmodell_ueberblick.mspx";
	},
	doprodukte:function(){
		//alert('produkte');
		top.location="http://www.microsoft.com/austria/education/produkte_loesungen.mspx";
	},
	donachlese:function(){
		//alert('nachlese');
		//location="http://www.microsoft.com";
		top.location="http://www.microsoft.com/austria/events/eventnachlese.mspx";
	},
	doinitiative:function(){
		//alert('initiative');
		top.location="http://www.microsoft.com/austria/education/educationprogramme.mspx";
	},
	dokontakt:function(){
		//alert('kontakt');
		top.location="http://www.microsoft.com/austria/education/kontakt.mspx#EX";
	},
	doressourcen:function(){
		//alert('ressourcen');
		top.location="http://www.microsoft.com/austria/education/ressourcen.mspx";
	},
	doacademic:function(){
		//alert('academic');
		top.location="http://www.microsoft.com/austria/education/academic_zone.mspx";
	},
	dosupport:function(){
		//alert('support');
		top.location="http://www.microsoft.com/austria/education/support.mspx";
	},
	
	skipIntro: function(sender) 
	{
		if(this.skip)
		{
			this.end(sender);
			sender.findName("headlineAni").Stop();
			sender.findName("schwammAni").Stop();
			
			
			var endStoryBoard = sender.findName("menuAni");
			endStoryBoard.Begin();		
			endStoryBoard.Seek("00:00:00.7200000");	
			
		}
		else
		{
			sender.findName("SkipRepeatAni").Stop();	
			sender.findName("menuAni").Stop();
			sender.findName("schwammAni").Stop();
			
			sender.findName("headlineAni").Begin();
			this.skip = true;
		}	
	},
	
	end: function(sender)
	{
		sender.findName("SkipRepeatAni").Begin();
		this.skip = false;
	}
}