function imError(sender, args) {}

function mainVideoDownloaded(sender, args) {

	var i = guide.Scene.getInstance();
	var xaml = i.content;

	i.downloadInProgress = false;
	i.loaded = true;
	i.resetVideo(sender);
	i.v1loader = sender;
	video = sender.findName("video");
	video.SetSource(i.v1loader, "");
	video.play();
	soundDown();
	i.currentScene = "main";
	mainScene = sender.findName("mainScene");
	mainScene.setValue("Visibility", "Visible");
	subText = sender.findName("mainContent");
	subText.visibility = "Visible";
	var str = sender.findName("strMainSceneShow");
	str.begin();
}

function licenseVideoDownloaded(sender, args) {

	var i = guide.Scene.getInstance();
	var xaml = i.content;

	i.downloadInProgress = false;
    i.a1loader = i.plugin.createObject("downloader");
	i.a1loader.addEventListener("Completed", Silverlight.createDelegate(i, a1loaded));
	i.a1loader.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/RESOURCES/licencovani.zip");
	i.a1loader.send();
	i.resetVideo(sender);
	i.v2loader = sender;
	video = sender.findName("video");
	video.SetSource(i.v2loader, "");
	video.play();
	soundDown();
	i.currentScene = "license";
	mainScene = sender.findName("licenseScene");
	mainScene.setValue("Visibility", "Visible");
	subText = sender.findName("licenseSubText");
	subText.visibility = "Visible";
	var str = sender.findName("strLicenseSceneShow");
	str.begin();
}


function supportVideoDownloaded(sender, args) {

	var i = guide.Scene.getInstance();
	var xaml = i.content;

	i.downloadInProgress = false;
    i.a2loader = i.plugin.createObject("downloader");
	i.a2loader.addEventListener("Completed", Silverlight.createDelegate(i, a2loaded));
	i.a2loader.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/RESOURCES/podpora.zip");
	i.a2loader.send();
	i.resetVideo(sender);
	i.v3loader = sender;
	video = sender.findName("video");
	video.SetSource(i.v3loader, "");
	video.play();
	soundDown();
	i.currentScene = "support";
	mainScene = sender.findName("supportScene");
	mainScene.setValue("Visibility", "Visible");
	subText = sender.findName("supportSubText");
	subText.visibility = "Visible";
	var str = sender.findName("strSupportSceneShow");
	str.begin();
}

function partnersVideoDownloaded(sender, args) {

	var i = guide.Scene.getInstance();
	var xaml = i.content;

	i.downloadInProgress = false;
	i.a3loader = i.plugin.createObject("downloader");
	i.a3loader.addEventListener("Completed", Silverlight.createDelegate(i, a3loaded));
	i.a3loader.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/RESOURCES/partneri.zip");
	i.a3loader.send();
	i.resetVideo(sender);
	i.v4loader = sender;
	video = sender.findName("video");
	video.SetSource(i.v4loader, "");
	video.play();
	soundDown();
	i.currentScene = "partners";
	mainScene = sender.findName("partnersScene");
	mainScene.setValue("Visibility", "Visible");
	subText = sender.findName("partnersSubText");
	subText.visibility = "Visible";
	var str = sender.findName("strPartnersSceneShow");
	str.begin();
}

function companiesVideoDownloaded(sender, args) {

	var i = guide.Scene.getInstance();
	var xaml = i.content;

	i.downloadInProgress = false;
    i.a4loader = i.plugin.createObject("downloader");
	i.a4loader.addEventListener("Completed", Silverlight.createDelegate(i, a4loaded));
	i.a4loader.open("GET", "downloadFile.ashx?URL=http://download.microsoft.com/download/F/C/8/FC8AC987-67A5-426E-8130-F1DD5F001B73/RESOURCES/firmy.zip");
	i.a4loader.send();
	i.resetVideo(sender);
	i.v5loader = sender;
	video = sender.findName("video");
	video.SetSource(i.v5loader, "");
	video.play();
	soundDown();
	i.currentScene = "companies";
	mainScene = sender.findName("companiesScene");
	mainScene.setValue("Visibility", "Visible");
	subText = sender.findName("companiesSubText");
	subText.visibility = "Visible";
	var str = sender.findName("strCompaniesSceneShow");
	str.begin();
}

function a1loaded(sender, args) {}

function a2loaded(sender, args) {}

function a3loaded(sender, args) {}

function a4loaded(sender, args) {}

function a5loaded(sender, args) {}

function imagesDownloaded(sender, eventArgs) {

	var i = guide.Scene.getInstance();
	var xaml = i.content;

	i.root.findName("imgBackground").setSource(sender, "bg-new.jpg");
	i.root.findName("videoimagehack").setSource(sender, "videoimagehack.png");
	i.root.findName("imgLogo").setSource(sender, "logo.png");
	i.root.findName("subIcoLicense").setSource(sender, "hp-ico1licence-small.png");
	i.root.findName("subIcoSupport").setSource(sender, "hp-ico2podpora-small.png");
	i.root.findName("subIcoPartners").setSource(sender, "hp-ico3partneri-small.png");
	i.root.findName("subIcoCompanies").setSource(sender, "hp-ico4firmy-small.png");
	i.root.findName("imgMenuButton").setSource(sender, "menu-button.png");
	i.root.findName("icoLicense").setSource(sender, "hp-ico1licence.png");
	i.root.findName("licenseShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblLicense").setSource(sender, "hp-bubble-big.png");
	i.root.findName("lblLicenseBubble").setSource(sender, "hp-bubble1-hover.png");
	i.root.findName("icoSupport").setSource(sender, "hp-ico2podpora.png");
	i.root.findName("lblSupport").setSource(sender, "hp-bubble-big.png");
	i.root.findName("supportShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblSupportBubble").setSource(sender, "hp-bubble2-hover.png");
	i.root.findName("icoPartners").setSource(sender, "hp-ico3partneri.png");
	i.root.findName("lblPartners").setSource(sender, "hp-bubble.png");
	i.root.findName("partnersShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblPartnersBubble").setSource(sender, "hp-bubble3-hover.png");
	i.root.findName("icoCompanies").setSource(sender, "hp-ico4firmy.png");
	i.root.findName("lblCompanies").setSource(sender, "hp-bubble.png");
	i.root.findName("companiesShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblCompaniesBubble").setSource(sender, "hp-bubble4-hover.png");
	i.root.findName("icoLicModels").setSource(sender, "ico1-lmodely.png");
	i.root.findName("licModelsShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblLicModels").setSource(sender, "hp-bubble.png");
	i.root.findName("txtLicModelsBubble").setSource(sender, "sub-bubble1-hover.png");
	i.root.findName("txtLicOffersBubble").setSource(sender, "sub-bubble1-hover.png");
	i.root.findName("txtLicSupportBubble").setSource(sender, "sub-bubble1-hover.png");
	i.root.findName("txtLicWizardBubble").setSource(sender, "sub-bubble1-hover.png");
	i.root.findName("txtPagesBubble").setSource(sender, "sub-bubble2-hover.png");
	i.root.findName("txtOnlineBubble").setSource(sender, "sub-bubble2-hover.png");
	i.root.findName("txtDownloadBubble").setSource(sender, "sub-bubble2-hover.png");
	i.root.findName("txtAboutBubble").setSource(sender, "sub-bubble2-hover.png");
	i.root.findName("txtPortalBubble").setSource(sender, "sub-bubble3-hover.png");
	i.root.findName("txtProgramBubble").setSource(sender, "sub-bubble3-hover.png");
	i.root.findName("txtActionsBubble").setSource(sender, "sub-bubble3-hover.png");
	i.root.findName("txtLearningBubble").setSource(sender, "sub-bubble3-hover.png");
	i.root.findName("txtCenterBubble").setSource(sender, "sub-bubble4-hover.png");
	i.root.findName("txtOverviewBubble").setSource(sender, "sub-bubble4-hover.png");
	i.root.findName("txtSecurityBubble").setSource(sender, "sub-bubble4-hover.png");
	i.root.findName("txtCSupportBubble").setSource(sender, "sub-bubble4-hover.png");
	i.root.findName("icoLicOffers").setSource(sender, "ico2-nabidky.png");
	i.root.findName("licOffersShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblLicOffers").setSource(sender, "hp-bubble.png");
	i.root.findName("icoLicWizard").setSource(sender, "ico4-pruvodce.png");
	i.root.findName("licWizardShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblLicWizard").setSource(sender, "hp-bubble.png");
	i.root.findName("icoLicSupport").setSource(sender, "ico3-podpora.png");
	i.root.findName("licSupportShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblLicSupport").setSource(sender, "hp-bubble.png");
	i.root.findName("icoPages").setSource(sender, "ico1-webovestranky.png");
	i.root.findName("supPagesShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblPages").setSource(sender, "hp-bubble.png");
	i.root.findName("icoOnline").setSource(sender, "ico2-podpora.png");
	i.root.findName("supOnlineShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblOnline").setSource(sender, "hp-bubble.png");
	i.root.findName("icoDownload").setSource(sender, "ico3-cstahovani.png");
	i.root.findName("supDownloadShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblDownload").setSource(sender, "hp-bubble.png");
	i.root.findName("icoAbout").setSource(sender, "ico4-opartnerech.png");
	i.root.findName("supAboutShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblAbout").setSource(sender, "hp-bubble.png");
	i.root.findName("icoPortal").setSource(sender, "ico1-pportal.png");
	i.root.findName("supPortalShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblPortal").setSource(sender, "hp-bubble.png");
	i.root.findName("icoProgram").setSource(sender, "ico2-pprogram.png");
	i.root.findName("supProgramShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblProgram").setSource(sender, "hp-bubble.png");
	i.root.findName("icoActions").setSource(sender, "ico3-anabidky.png");
	i.root.findName("supActionsShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblActions").setSource(sender, "hp-bubble.png");
	i.root.findName("icoLearning").setSource(sender, "ico4-skoly.png");
	i.root.findName("supLearningShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblLearning").setSource(sender, "hp-bubble.png");
	i.root.findName("icoCenter").setSource(sender, "ico1-centrum.png");
	i.root.findName("supCenterShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblCenter").setSource(sender, "hp-bubble.png");
	i.root.findName("icoOverview").setSource(sender, "ico2-reseni.png");
	i.root.findName("supOverviewShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblOverview").setSource(sender, "hp-bubble.png");
	i.root.findName("icoSecurity").setSource(sender, "ico3-zabezpeceni.png");
	i.root.findName("supSecurityShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblSecurity").setSource(sender, "hp-bubble.png");
	i.root.findName("icoCSupport").setSource(sender, "ico4-podpora.png");
	i.root.findName("supCSupportShadow").setSource(sender, "hp-ico-hover.png");
	i.root.findName("lblCSupport").setSource(sender, "hp-bubble.png");
	i.root.findName("mnuBackground").setSource(sender, "roletka.png");
	i.root.findName("mnuBtn1").setSource(sender, "hp-ico1licence-small.png");
	i.root.findName("mnuBtn2").setSource(sender, "hp-ico2podpora-small.png");
	i.root.findName("mnuBtn3").setSource(sender, "hp-ico3partneri-small.png");
	i.root.findName("mnuBtn4").setSource(sender, "hp-ico4firmy-small.png");
	i.root.findName("btnSubtitles").setSource(sender, "sub-on.png");
	i.root.findName("btnSound").setSource(sender, "sound-on.png");
	i.root.findName("mainContentImage").setSource(sender, "vitejte-v-zakaznickem.png");
	i.root.findName("licenseContentImage").setSource(sender, "porizuji-si-software.png");
	i.root.findName("supportContentImage").setSource(sender, "kam-se-mohu-obratit.png");
	i.root.findName("partnersContentImage").setSource(sender, "jsem-partnerskou-organizaci.png");
	i.root.findName("companiesContentImage").setSource(sender, "jsme-stredne-velka.png");
	i.root.findName("mnuShadow").setSource(sender, "stin.png");
	i.root.findName("btnForward").setSource(sender, "ff-ico.png");
	i.root.findName("btnRewind").setSource(sender, "rw-ico.png");
	i.root.findName("bgmusic").setSource(sender, "music.mp3");
	i.root.findName("bgmusic").addEventListener("MediaFailed", imError);


	i.root.findName("progress").setFontSource(sender);
	i.root.findName("progress").fontFamily = "Segoe Semibold";

	i.root.findName("txtMenu").setFontSource(sender);
	i.root.findName("txtMenu").fontFamily = "Segoe Semibold";

	i.root.findName("txtMenu2").setFontSource(sender);
	i.root.findName("txtMenu2").fontFamily = "Segoe Semibold";

	i.root.findName("txtSubmenu1").setFontSource(sender);
	i.root.findName("txtSubmenu1").fontFamily = "Segoe Semibold";

	i.root.findName("txtSubmenu2").setFontSource(sender);
	i.root.findName("txtSubmenu2").fontFamily = "Segoe Semibold";

	i.root.findName("txtSubmenu3").setFontSource(sender);
	i.root.findName("txtSubmenu3").fontFamily = "Segoe Semibold";

	i.root.findName("txtSubmenu4").setFontSource(sender);
	i.root.findName("txtSubmenu4").fontFamily = "Segoe Semibold";


	i.root.findName("txtLicense1").setFontSource(sender);
	i.root.findName("txtLicense1").fontFamily = "Segoe Condensed";

	i.root.findName("txtLicense2").setFontSource(sender);
	i.root.findName("txtLicense2").fontFamily = "Segoe Condensed";

	i.root.findName("txtSupport1").setFontSource(sender);
	i.root.findName("txtSupport1").fontFamily = "Segoe Condensed";
	
	i.root.findName("txtSupport2").setFontSource(sender);
	i.root.findName("txtSupport2").fontFamily = "Segoe Condensed";

	i.root.findName("txtPartners").setFontSource(sender);
	i.root.findName("txtPartners").fontFamily = "Segoe Condensed";

	i.root.findName("txtCompanies").setFontSource(sender);
	i.root.findName("txtCompanies").fontFamily = "Segoe Condensed";

	i.root.findName("txtLicModels").setFontSource(sender);
	i.root.findName("txtLicModels").fontFamily = "Segoe Condensed";

	i.root.findName("txtLicOffers").setFontSource(sender);
	i.root.findName("txtLicOffers").fontFamily = "Segoe Condensed";

	i.root.findName("txtLicWizard").setFontSource(sender);
	i.root.findName("txtLicWizard").fontFamily = "Segoe Condensed";

	i.root.findName("txtLicSupport").setFontSource(sender);
	i.root.findName("txtLicSupport").fontFamily = "Segoe Condensed";

	i.root.findName("txtPages").setFontSource(sender);
	i.root.findName("txtPages").fontFamily = "Segoe Condensed";

	i.root.findName("txtOnline").setFontSource(sender);
	i.root.findName("txtOnline").fontFamily = "Segoe Condensed";

	i.root.findName("txtDownload").setFontSource(sender);
	i.root.findName("txtDownload").fontFamily = "Segoe Condensed";

	i.root.findName("txtAbout").setFontSource(sender);
	i.root.findName("txtAbout").fontFamily = "Segoe Condensed";

	i.root.findName("txtPortal").setFontSource(sender);
	i.root.findName("txtPortal").fontFamily = "Segoe Condensed";

	i.root.findName("txtProgram").setFontSource(sender);
	i.root.findName("txtProgram").fontFamily = "Segoe Condensed";

	i.root.findName("txtActions").setFontSource(sender);
	i.root.findName("txtActions").fontFamily = "Segoe Condensed";

	i.root.findName("txtLearning").setFontSource(sender);
	i.root.findName("txtLearning").fontFamily = "Segoe Condensed";

	i.root.findName("txtCenter").setFontSource(sender);
	i.root.findName("txtCenter").fontFamily = "Segoe Condensed";

	i.root.findName("txtOverview").setFontSource(sender);
	i.root.findName("txtOverview").fontFamily = "Segoe Condensed";

	i.root.findName("txtSecurity").setFontSource(sender);
	i.root.findName("txtSecurity").fontFamily = "Segoe Condensed";

	i.root.findName("txtCSupport").setFontSource(sender);
	i.root.findName("txtCSupport").fontFamily = "Segoe Condensed";

	i.root.findName("cnvMainDisplay").begin();
}
