﻿if (!window.guide)
	window.guide = {};

guide.Scene = function() {
}

guide.Scene.instance = null;

guide.Scene.getInstance = function() {
		if (guide.Scene.instance == null) {
			guide.Scene.instance = new guide.Scene();
		}
		return guide.Scene.instance;
	};


guide.Scene.prototype = {

	handleLoad: function(plugin, userContext, root) 
	{
		this.plugin			= plugin;
		this.userContext	= userContext;
		this.root			= root;

		this.filesIdx		= 0;
		this.videoMarker	= 0;
		this.requestedScene = "main";
		this.currentScene	= "main";
		this.downloadInProgress = false;
		this.v1loader		= false;
		this.v2loader		= false;
		this.v3loader		= false;
		this.v4loader		= false;
		this.v5loader		= false;
		this.a1loader		= false;
		this.a2loader		= false;
		this.a3loader		= false;
		this.a4loader		= false;
		this.loaded 		= false;

		this.currentLayer = "";
		this.sceneRequested = false;
		this.mainAnimation = 0;
		this.licenseAnimation = 0;
		this.supportAnimation = 0;
		this.partnersAnimation = 0;
		this.companiesAnimation = 0;
		this.subtitles		= true;
		this.resources		= true;
		this.loop = false;
		this.currentMenuItem = false;
		this.currentLoop = 0;
		this.loopArray = ["loop.wmv", "loop.wmv", "cekani1.wmv", "loop.wmv", "loop.wmv", "cekani5.wmv"];

		
		root.findName("video").addEventListener("markerReached", Silverlight.createDelegate(this, this.videoMarkerReached));
		root.findName("video").addEventListener("mediaEnded", Silverlight.createDelegate(this, this.videoEnded));
		root.findName("videoHide").addEventListener("Completed", Silverlight.createDelegate(this, this.videoHideCompleted));
		root.findName("videoShow").addEventListener("Completed", Silverlight.createDelegate(this, this.videoShowCompleted));
		root.findName("cnvMainDisplay").addEventListener("Completed", Silverlight.createDelegate(this, this.evtCnvMainDisplayCompleted));
		root.findName("mnuShadow").addEventListener("MouseEnter", Silverlight.createDelegate(this, this.menuShadowClose));
		root.findName("mnuShadow").addEventListener("MouseMove", Silverlight.createDelegate(this, this.menuShadowClose));

		// download fontu
/*		var semibold = plugin.createObject("downloader");  
		semibold.addEventListener("completed", Silverlight.createDelegate(this, semiboldDownloaded));  
		semibold.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.GUIProgress));
		semibold.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/FONTS/SegoeSb.ttf");
		semibold.send();

		var bold = plugin.createObject("downloader");
		bold.addEventListener("completed", Silverlight.createDelegate(this, boldDownloaded));
		bold.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.GUIProgress));
		bold.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/FONTS/Segoebd.ttf");
		bold.send();

		var condensed = plugin.createObject("downloader");
		condensed.addEventListener("completed", Silverlight.createDelegate(this, condensedDownloaded));
		condensed.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.GUIProgress));
		condensed.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/FONTS/Segoecbd.ttf");
		condensed.send();*/

		// download obrazku
		var images = plugin.createObject("downloader");
		images.addEventListener("completed", Silverlight.createDelegate(this, imagesDownloaded));
		images.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.GUIProgress));
		images.addEventListener("Completed", Silverlight.createDelegate(this, this.GUICompleted));
		images.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/RESOURCES/images.zip");
		images.send();

	},

	evtCnvMainDisplayCompleted: function (sender, args) {
		this.showRequestedScene(sender, args);
	},

	resetVideo: function(sender) {

		progress = sender.findName("progress");
		progress.text = "";
		this.videoMarker = 0;
		var sub1 = sender.findName("subLine1");
		sub1.text = "";
		var sub2 = sender.findName("subLine2");
		sub2.text = "";
		cnvSubtitles = sender.findName("cnvSubtitles");
		cnvSubtitles.setValue("Visibility", "Visible");
		this.downloadInProgress = false;
		this.loop = false;
	},
	
	showRequestedScene: function (sender, args) {

		this.mainAnimation = 0;
		this.licenseAnimation = 0;
		this.supportAnimation = 0;
		this.partnersAnimation = 0;
		this.companiesAnimation = 0;

		video = sender.findName("video");
		video.stop();

		this.videoMarker = 0;
		switch(this.requestedScene) {
			case "main":
					this.currentMenuItem = false;
					if (this.v1loader == false) {
						soundUp();
						this.downloadInProgress = true;
						if (this.resources) {
							mainCanvas = sender.findName("mainCanvas");
							mainCanvas.visibility = "Visible";
							this.loop = true;
							video.opacity = "1";
							video.setSource(this.resources, "loop.wmv");
							video.play();
						}
						var downloader = this.plugin.createObject("downloader");
						downloader.addEventListener("Completed", Silverlight.createDelegate(this, mainVideoDownloaded));
						downloader.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.videoProgress));
						downloader.open("GET", "downloadFile.ashx?URL=http://mediadl.microsoft.com/mediadl/www/c/cze/virtualnipruvodce/video/uvod.wmv");
						downloader.send();
					} else { 
						this.resetVideo(sender);
						video = sender.findName("video");
						video.SetSource(this.v1loader, "");
						video.play();
						this.currentScene = "main";
						mainScene = sender.findName("mainScene");
						mainScene.setValue("Visibility", "Visible");
						subText = sender.findName("mainContent");
						subText.visibility = "Visible";
						var str = sender.findName("strMainSceneShow");
						str.begin();
					}
				break;
			case "license":
					this.currentMenuItem = "txtSubmenu1";
					if (this.v2loader == false) {
						soundUp();
						this.downloadInProgress = true;
						if (this.resources) {
							mainCanvas = sender.findName("mainCanvas");
							mainCanvas.visibility = "Visible";
							this.loop = true;
							video.visibility = "Visible";
							video.opacity = "1";
							video.setSource(this.resources, "loop.wmv");
							video.play();
						}
						var downloader = this.plugin.createObject("downloader");
						downloader.addEventListener("Completed", Silverlight.createDelegate(this, licenseVideoDownloaded));
						downloader.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.videoProgress));
						downloader.open("GET", "downloadFile.ashx?URL=http://mediadl.microsoft.com/mediadl/www/c/cze/virtualnipruvodce/video/licence.wmv");
						downloader.send();
					} else {
						this.resetVideo(sender);
						video = sender.findName("video");
						video.setSource(this.v2loader, "");
						video.play();
						this.currentScene = "license";
						mainScene = sender.findName("licenseScene");
						mainScene.setValue("Visibility", "Visible");
						subText = sender.findName("licenseSubText");
						subText.visibility = "Visible";
						var str = sender.findName("strLicenseSceneShow");
						str.begin();
					}
				break;
			case "support":
					this.currentMenuItem = "txtSubmenu2";
					if (this.v3loader == false) {
						soundUp();
						this.downloadInProgress = true;
						if (this.resources) {
							mainCanvas = sender.findName("mainCanvas");
							mainCanvas.visibility = "Visible";
							this.loop = true;
							video.visibility = "Visible";
							video.opacity = "1";
							video.setSource(this.resources, "loop.wmv");
							video.play();
						}
						var downloader = this.plugin.createObject("downloader");
						downloader.addEventListener("Completed", Silverlight.createDelegate(this, supportVideoDownloaded));
						downloader.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.videoProgress));
						downloader.open("GET", "downloadFile.ashx?URL=http://mediadl.microsoft.com/mediadl/www/c/cze/virtualnipruvodce/video/podpora.wmv");
						downloader.send();
					} else {
						this.resetVideo(sender);
						video = sender.findName("video");
						video.setSource(this.v3loader, "");
						video.play();
						this.currentScene = "support";
						mainScene = sender.findName("supportScene");
						mainScene.setValue("Visibility", "Visible");
						subText = sender.findName("supportSubText");
						subText.visibility = "Visible";
						var str = sender.findName("strSupportSceneShow");
						str.begin();
					}
				break;
			case "partners":
					this.currentMenuItem = "txtSubmenu3";
					if (this.v4loader == false) {
						soundUp();
						this.downloadInProgress = true;
						if (this.resources) {
							mainCanvas = sender.findName("mainCanvas");
							mainCanvas.visibility = "Visible";
							this.loop = true;
							video.visibility = "Visible";
							video.opacity = "1";
							video.setSource(this.resources, "loop.wmv");
							video.play();
						}
						var downloader = this.plugin.createObject("downloader");
						downloader.addEventListener("Completed", Silverlight.createDelegate(this, partnersVideoDownloaded));
						downloader.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.videoProgress));
						downloader.open("GET", "downloadFile.ashx?URL=http://mediadl.microsoft.com/mediadl/www/c/cze/virtualnipruvodce/video/partneri.wmv");
						downloader.send();
					} else {
						this.resetVideo(sender);
						video = sender.findName("video");
						video.setSource(this.v4loader, "");
						video.play();
						this.currentScene = "partners";
						mainScene = sender.findName("partnersScene");
						mainScene.setValue("Visibility", "Visible");
						subText = sender.findName("partnersSubText");
						subText.visibility = "Visible";
						var str = sender.findName("strPartnersSceneShow");
						str.begin();
					}
				break;
			case "companies":
					this.currentMenuItem = "txtSubmenu4";
					if (this.v5loader == false) {
						soundUp();
						this.downloadInProgress = true;
						if (this.resources) {
							mainCanvas = sender.findName("mainCanvas");
							mainCanvas.visibility = "Visible";
							this.loop = true;
							video.visibility = "Visible";
							video.opacity = "1";
							video.setSource(this.resources, "loop.wmv");
							video.play();
						}
						var downloader = this.plugin.createObject("downloader");
						downloader.addEventListener("Completed", Silverlight.createDelegate(this, companiesVideoDownloaded));
						downloader.addEventListener("DownloadProgressChanged", Silverlight.createDelegate(this, this.videoProgress));
						downloader.open("GET", "downloadFile.ashx?URL=http://mediadl.microsoft.com/mediadl/www/c/cze/virtualnipruvodce/video/firmy.wmv");
						downloader.send();
					} else {
						this.resetVideo(sender);
						video = sender.findName("video");
						video.setSource(this.v5loader, "");
						video.play();
						this.currentScene = "companies";
						mainScene = sender.findName("companiesScene");
						mainScene.setValue("Visibility", "Visible");
						subText = sender.findName("companiesSubText");
						subText.visibility = "Visible";
						var str = sender.findName("strCompaniesSceneShow");
						str.begin();
					}
				break;
		}
	},

	closeCurrentScene: function(sender) {

		soundDown();
		if (this.subtitles == true) {
			cnvSubtitles = sender.findName("cnvSubtitles");
			cnvSubtitles.setValue("Visibility", "Collapsed");
			subLine1 = sender.findName("subLine1");
			subLine1.text = "";
			subLine2 = sender.findName("subLine2");
			subLine2.text = "";
		}

	    switch (this.currentScene) {
			case "main":
				var str = sender.findName("strMainSceneHide");
				str.begin();
			    break;
			case "license":
				var str = sender.findName("strLicenseSceneHide");
				str.begin();
			    break;
			case "support":
				var str = sender.findName("strSupportSceneHide");
				str.begin();
			    break;
			case "partners":
				var str = sender.findName("strPartnersSceneHide");
				str.begin();
			    break;
			case "companies":
				var str = sender.findName("strCompaniesSceneHide");
				str.begin();
			    break;

		}
	},

	videoEnded: function (sender, args) {

		welcomeVideo = sender.findName("video");

		cnvSubtitles = sender.findName("cnvSubtitles");
		cnvSubtitles.setValue("Visibility", "Collapsed");
		var sub1 = sender.findName("subLine1");
		sub1.text = "";
		var sub2 = sender.findName("subLine2");
		sub2.text = "";

		this.requestForButtonMove = false;
		if (!this.loop) {
			// ztmavit
			if (this.currentScene == "license") this.licenseVideoFinished = true;
			if (this.currentScene == "support") this.supportVideoFinished = true;			
			if (this.currentScene == "partners") this.partnersVideoFinished = true;
			if (this.currentScene == "companies") this.companiesVideoFinished = true;			
			str = sender.findName("videoHide");
			str.begin();
			if (this.loaded == true) soundUp();
		} else {
			if (this.downloadInProgress) {
			    sender.stop();
			    sender.play();
			} else {
				if (this.loopArray[this.currentLoop] == this.getNextLoop()) {
				    sender.stop();
				    sender.play();
				} else {
		        	this.currentLoop--;
					str = sender.findName("videoHide");
					str.begin();
				}
			}
		}
	},

	getNextLoop: function () {

	    if (this.currentLoop != (this.loopArray.length -1)) {
	        this.currentLoop++;
	        return this.loopArray[this.currentLoop];
		} else {
	        this.currentLoop = 0;
	        return this.loopArray[this.currentLoop];
		}
	},

	videoMarkerReached: function (sender, eventArgs) {

		var sub1 = sender.findName("subLine1");
		var sub2 = sender.findName("subLine2");
	
		switch (this.currentScene) {
			case "main":
							switch (this.videoMarker) {
								case 0:
									sub1.text = "                                   Vítejte, jmenuji se Bára";
									sub2.text = "             a ráda bych Vám zodpověděla 4 nejčastější dotazy,";
								break;
								case 1:
									sub1.text = "                                 se kterými se na nás obracíte.";
									sub2.text = "";
								break;
								case 2:
									sub1.text = "                Pojďme se tedy podívat, co Vás nejvíc zajímá.";
									sub2.text = "";
								break;
								case 3:
									sub1.text = "               Plánujete si od nás pořídit software a chcete vědět";
									sub2.text = "               jaké licenční programy jsou pro Vás nejvýhodnější,";
								break;
								case 4:
									sub1.text = "           nebo jakých výhod můžete jako náš zákazník využívat?";
									sub2.text = "";
								break;
								case 5:
									cnv = sender.findName("cnvLicense");
									cnv.visibility = "Visible";
									cnvText = sender.findName("cnvLicenseText");
									cnvText.visibility = "Visible";
									vid = sender.findName("icoLicenseShow");
									vid.begin();
									this.mainAnimation++;
									sub1.text = "     Stačí se jen podívat na přehled základních licenčních modelů,";
									sub2.text = "                 kde naleznete všechny potřebné informace";
								break;
								case 6:
									sub1.text = "                     o možnostech nákupu našich produktů.";
									sub2.text = "";
								break;
								case 7:
									sub1.text = "                             Často se také setkáváme s tím,";
									sub2.text = "                            že potřebujete jednoduše poradit,";
									cnv = sender.findName("cnvSupport");
									cnv.visibility = "Visible";
									cnvText = sender.findName("cnvSupportText");
									cnvText.visibility = "Visible";
									vid = sender.findName("icoSupportShow");
									vid.begin();
									this.mainAnimation++;
								break;
								case 8:
									sub1.text = "                            a netušíte, kam přesně se obrátit.";
									sub2.text = "";
								break;
								case 9:
									cnv = sender.findName("cnvPartners");
									cnv.visibility = "Visible";
									cnvText = sender.findName("cnvPartnersText");
									cnvText.visibility = "Visible";
									vid = sender.findName("icoPartnersShow");
									vid.begin();
									this.mainAnimation++;
									sub1.text = "  Pokud jste naším partnerem, zajímají Vás především informace";
									sub2.text = "   o probíhajících nebo připravovaných partnerských programech.";
								break;
								case 10:
									cnv = sender.findName("cnvCompanies");
									cnv.visibility = "Visible";
									cnvText = sender.findName("cnvCompaniesText");
									cnvText.visibility = "Visible";
									vid = sender.findName("icoCompaniesShow");
									vid.begin();
									this.mainAnimation++;
									sub1.text = "           A v neposlední řadě se na nás také obracíte s žádostmi";
									sub2.text = "   o podrobné informace k našim řešením pro středně velké firmy.";
								break;
								case 11:
									sub1.text = "  Pokud Vás více zajímá některé z těchto témat, stačí si jen vybrat ";
									sub2.text = "       a já Vám poskytnu maximum informací potřebných k tomu,";
								break;
								case 12:
									sub1.text = "                          abyste se mohli správně rozhodnout.";
									sub2.text = "";
								break;

							}
				break;
			case "license":
							switch (this.videoMarker) {
							
								case 0:
									sub1.text = "              Plánujete si od nás pořídit software a chcete vědět";
									sub2.text = "               jaké licenční programy jsou pro Vás nejvýhodnější,";
								break;
								case 1:
									sub1.text = "          nebo jakých výhod můžete jako náš zákazník využívat?";
									sub2.text = "";
								break;
								case 2:
									cnv1 = sender.findName("cnvLicModels");
									cnv1.visibility = "Visible";
									cnv1Text = sender.findName("cnvLicModelsText");
									cnv1Text.visibility = "Visible";
									vid = sender.findName("icoLicenseModels");
									vid.begin();
									this.licenseAnimation++;
									sub1.text = "     Stačí se jen podívat na přehled základních licenčních modelů,";
									sub2.text = "                   kde najdete všechny potřebné informace";
								break;
								case 3:
									sub1.text = "                      o možnostech nákupu našich produktů.";
									sub2.text = "";
								break;
								case 4:
									sub1.text = "   Pro Vás, kteří hledáte pouze informace o výhodných nabídkách,";
									sub2.text = "             máme připraven aktuální přehled probíhajících akcí.";
								break;
								case 5:
									cnv1 = sender.findName("cnvLicOffers");
									cnv1.visibility = "Visible";
									cnv1Text = sender.findName("cnvLicOffersText");
									cnv1Text.visibility = "Visible";
									vid = sender.findName("icoLicenseOffers");
									vid.begin();
								break;
								case 6:
									cnv2 = sender.findName("cnvLicSupport");
									cnv2.visibility = "Visible";
									cnv2Text = sender.findName("cnvLicSupportText");
									cnv2Text.visibility = "Visible";
									vid = sender.findName("icoLicenseSupport");
									vid.begin();
									this.licenseAnimation++;
									sub1.text = " A pokud chcete poskytnout bližší upřesnění telefonicky, pak jsou";
									sub2.text = "     naše operátorky připraveny zodpovědět všechny Vaše dotazy.";
								break;
								case 7:
									cnv1 = sender.findName("cnvLicWizard");
									cnv1.visibility = "Visible";
									cnv1Text = sender.findName("cnvLicWizardText");
									cnv1Text.visibility = "Visible";
									vid = sender.findName("icoLicenseWizard");
									vid.begin();
									sub1.text = "   Navíc jsme pro Vás připravili zcela nového licenčního průvodce,";
									sub2.text = "        který Vám poskytne detailní informace o způsobu nákupu";
								break;
								case 8:
									sub1.text = "                                       našich produktů.";
									sub2.text = "";
								break;
								case 9:
									sub1.text = "          Chcete vědět více? Pak si zvolte téma, která Vás zajímá";
									sub2.text = "                a já Vám pomohu najít tu správnou odpověď.";
								break;
								case 10:
									if (this.requestForButtonMove) {
										str = sender.findName("ldMove");
										str.begin();
									}
								break;
							}
				break;
			case "support":
							switch (this.videoMarker) {
								case 0:
									sub1.text = "          Chcete si od nás pořídit software a potřebujete poradit";
									sub2.text = "        s jeho nákupem, nebo jste si již software od nás zakoupili";
								break;
								case 1:
									sub1.text = "             a chybí Vám detailnější informace o jeho nastavení?";
									sub2.text = "";
								break;
								case 2:
									sub1.text = "      V těchto případech nabízíme několik možností, díky kterým";
									sub2.text = "                   získáte přesně ty informace, které hledáte.";
								break;
								case 3:
									cnv1 = sender.findName("cnvPages");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvPagesText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strSupportPagesShow");
									vid.begin();
									this.supportAnimation++;
									sub1.text = "                      Jednou z nich, jsou naše webové stránky.";
									sub2.text = "";
								break;
								case 4:
									cnv1 = sender.findName("cnvOnline");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvOnlineText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strSupportOnlineShow");
									vid.begin();
									this.supportAnimation++;
									sub1.text = "   Pokud preferujete online dotazy, pak pro Vás máme připravenou";
									sub2.text = "      technickou online podporu, kde najdete znalostní databázi,";
								break;
								case 5:
									sub1.text = "                 sestavenou na základě nejčastějších dotazů ";
									sub2.text = "                              ostatních zákazníků.";
								break;
								case 6:
									cnv1 = sender.findName("cnvDownload");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvDownloadText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strSupportDownloadShow");
									vid.begin();
									this.supportAnimation++;
									sub1.text = "     Dále jsme soustředili veškeré naše volně dostupné produkty,";
									sub2.text = "                bezpečnostní nástroje a nejnovější aktualizace";
								break;
								case 7:
									sub1.text = "               do nového centra stahování, takže nyní již máte";
									sub2.text = "                  všechny potřebné instalace na jednom místě.";
								break;
								case 8:
									cnv1 = sender.findName("cnvAbout");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvAboutText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strSupportAboutShow");
									vid.begin();
									this.supportAnimation++;
									sub1.text = "                  A pokud hledáte některého z našich partnerů,";
									sub2.text = "           máte jej možnost nalézt na našich webových stránkách.";
								break;
								case 9:
									sub1.text = "                 Jestliže upřednostňujete radu našeho operátora,";
									sub2.text = "                       kontaktujte naše zákaznické centrum.";
								break;
								case 10:
									sub1.text = "                        Zajímá Vás více detailních informací?";
									sub2.text = "          Pak si zvolte téma a já Vám pomohu najít další upřesnění.";
								break;
							}
				break;
			case "partners":
							switch (this.videoMarker) {
								case 0:
									sub1.text = "          Jste naším partnerem a hledáte detailnější informace";
									sub2.text = "              o probíhajících nebo připravovaných kampaních?";
								break;
								case 1:
									sub1.text = "    nebo chcete jen zjistit aktuální informace o akčních nabídkách";
									sub2.text = "                 a připravovaných školeních a seminářích,";
								break;
								case 2:
									sub1.text = "                   anebo hledáte bližší informace o přínosech";
									sub2.text = "                              Microsoft Partner Programu?";
								break;
								case 3:
									cnv1 = sender.findName("cnvPortal");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvPortalText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strPartnersPortalShow");
									vid.begin();
									this.partnersAnimation++;
									sub1.text = "    Právě pro Vás je určen kompletní informační portál, na kterém";
									sub2.text = "naleznete podrobné informace pro naše současné i budoucí klienty.";
								break;
								case 4:
									cnv1 = sender.findName("cnvProgram");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvProgramText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strPartnersProgramShow");
									vid.begin();
									this.partnersAnimation++;
									sub1.text = "                    Zde naleznete detailní informace o výhodách";
									sub2.text = "                    Microsoft Partner Programu nebo možnostech,";
								break;
								case 5:
									sub1.text = "         které Vám pro zviditelnění Vás a Vašich řešení nabízíme.";
									sub2.text = "";
								break;
								case 6:
									cnv1 = sender.findName("cnvActions");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvActionsText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strPartnersActionsShow");
									vid.begin();
									this.partnersAnimation++;
									sub1.text = "   Pokud Vás však zajímají pouze akční nabídky, pak si je můžete";
									sub2.text = "                prohlédnout v rámci přehledu produktů i akcí,";
								break;
								case 7:
									sub1.text = "                             které jsme pro Vás připravili.";
									sub2.text = "";
								break;
								case 8:
									cnv1 = sender.findName("cnvLearning");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvLearningText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strPartnersLearningShow");
									vid.begin();
									this.partnersAnimation++;
									sub1.text = "       V neposlední řadě si také s námi můžete zvýšit kvalifikaci";
									sub2.text = "                           a kvalitu poskytovaných služeb,";
								break;
								case 9:
									sub1.text = "        díky podrobnému školícímu programu pro naše partnery.";
									sub2.text = "";
								break;
								case 10:
									sub1.text = "         Chcete získat detailnější informace? Pak si zvolte téma,";
									sub2.text = "        které Vás zajímá a já Vám pomohu s dalším upřesněním.";
								break;
							}
				break;
			case "companies":
							switch (this.videoMarker) {
								case 0:
									sub1.text = "                          Jste středně velká firma a hledáte ";
									sub2.text = "               optimální řešení Vašich potřeb v oblasti software?";

								break;
								case 1:
									sub1.text = " Nebo Vás zajímají konkrétní informace o možnostech licencování,";
									sub2.text = "                           popřípadě o našich partnerech,";
								break;
								case 2:
									sub1.text = "       kteří by Vám byli schopni poskytnout profesionální servis?";
									sub2.text = "";
								break;
								case 3:
									cnv1 = sender.findName("cnvCenter");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvCenterText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strCompaniesCenterShow");
									vid.begin();
									this.companiesAnimation++;
									sub1.text = "   V tom případě Vás zveme do Centra středně velkých firem, kde";
									sub2.text = "   naleznete detailní informace určené jak vedoucím pracovníkům,";
								break;
								case 4:
									sub1.text = "                                       tak i IT manažerům.";
									sub2.text = "";
								break;
								case 5:
									cnv1 = sender.findName("cnvOverview");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvOverviewText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strCompaniesOverviewShow");
									vid.begin();
									this.companiesAnimation++;
									sub1.text = "        Nabízíme Vám zde přehled našich klíčových řešení, která";
									sub2.text = " Vám pomohou například nejen zdokonalit Vaše obchodní procesy,";
								break;
								case 6:
									sub1.text = "   ale také využít mobilní technologii ke zvýšení Vaší produktivity.";
									sub2.text = "";
								break;
								case 7:
									cnv1 = sender.findName("cnvSecurity");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvSecurityText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strCompaniesSecurityShow");
									vid.begin();
									this.companiesAnimation++;
									sub1.text = "                 V neposlední řadě Vám také pomůžeme vybrat";
									sub2.text = "                   vhodné bezpečnostní nástroje, které zajistí";
								break;
								case 8:
									sub1.text = "             maximální bezpečnost Vašich informačních zdrojů.";
									sub2.text = "";
								break;
								case 9:
									cnv1 = sender.findName("cnvCSupport");
									cnv1.visibility = "Visible";
									cnv2 = sender.findName("cnvCSupportText");
									cnv2.visibility = "Visible";
									vid = sender.findName("strCompaniesSupportShow");
									vid.begin();
									this.companiesAnimation++;
									sub1.text = "A pokud chcete zjistit více informací ohledně školení a poradenství,";
									sub2.text = "                  máme pro Vás připravenou technickou podporu,";
								break;
								case 10:
									sub1.text = "           která Vám pomůže maximálně využívat naše produkty.";
									sub2.text = "";
								break;
								case 11:
									sub1.text = "                          Zajímají Vás podrobnější informace?";
									sub2.text = "         Pak si zvolte téma a já Vám pomohu vyřešit Vaše dotazy.";
								break;
							}
				break;

		}
		this.videoMarker++;		
	},

	videoHideCompleted: function (sender, args) {

		if (!this.downloadInProgress) {
			welcomeVideo = sender.findName("video");
			if (this.requestForButtonMove) {
				welcomeVideo.setSource(this.resources, this.requestedButtonMoveVideo);
			} else {
				welcomeVideo.setSource(this.resources, this.getNextLoop());
				this.loop = true;
			}
			str = sender.findName("videoShow");
			str.begin();
		}
	},
	
	videoShowCompleted: function (sender, args) {
		welcomeVideo = sender.findName("video");
		welcomeVideo.play();
	},

	menuShadowClose: function (sender, args) {
		sender.Visibility = "Collapsed";
		sender.Opacity = "0";
	},
	
	videoProgress: function (sender, args) {
		txt = sender.findName("progress");
		txt.text = "Nahrávám video " + Math.floor(sender.downloadProgress * 100) + " %";
	},
	
	GUIProgress: function (sender, args) {
		sender.findName("GUIProgress").text = ("Nahrávám prostředí " + Math.floor(sender.downloadProgress * 100) + " %");
	},

	GUICompleted: function (sender, args) {
		this.resources = sender;
		sender.findName("GUIProgress").Visibility = "Collapsed";
		soundUp();
	}

	
}
