// JScript source code

//contains calls to silverlight.js, loads xaml
function createSilverlight(hostID, controlID, source)
{
	Silverlight.createObjectEx({
		source: source,
		parentElement: document.getElementById(hostID),
		id: controlID,
		properties: {
			width: "500",
			height: "237",
			version: "2.0",
			enableHtmlAccess: "true",
			isWindowless: "true",
			backgroundcolor: "#00000000",
			MaxFrameRate: "30"
		},
		events: {}
		});
	   
	// Give the keyboard focus to the Silverlight control by default
    document.body.onload = function() {
          var silverlightControl = document.getElementById('SilverlightControl');
          if (silverlightControl)
          silverlightControl.focus();
    }
}


function xaml_Loaded(sender, args) {
    sender.findName("TireAnimation").Opacity = 1;
    sender.findName("Fwd").begin();
}

function forward_completed(sender, args) {
    sender.findName("SmartAir").begin();
}
function smartair_completed(sender, args) {
    sender.findName("TagLine1").begin();
}
function tagline1_completed(sender, args) {
    sender.findName("TagLine2").begin();
}
function tagline2_completed(sender, args) {
    sender.findName("TagLine3").begin();
}
function tagline3_completed(sender, args) {
    sender.findName("TagLine4").begin();
}
function tagline4_completed(sender, args) {
    sender.findName("TagLine5").begin();
}
function tagline5_completed(sender, args) {
    sender.findName("TagLine6").begin();
}
Silverlight.createDelegate = function(instance, method) {
    return function() {
        return method.apply(instance, arguments);
    }
}
