function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
              appSource = sender.getHost().Source;
            }
            
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;

            if (errorType == "ImageError" || errorType == "MediaError") {
              return;
            }

            var errMsg = "Unhandled Error in Silverlight Application " +  appSource + "\n" ;

            errMsg += "Code: "+ iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {           
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " +  args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }

            throw new Error(errMsg);
        }
function onSLAppLoad()
{
document.getElementById("slApp").focus();
}
function generateContent()
{
	var result="";
	result+="<h3>Silverlight JetLag</h3>";
result+="<iframe style=\"visibility:hidden;height:0px;width:0px;\" src=\"http://www.playdeez.com/hitcounter.php?HitPage=sljetlag.html\"></iframe>";
result+="<form id=\"form1\" runat=\"server\" style=\"height:100%\">";
result+="<div id=\"silverlightControlHost\">";
result+="<object id=\"slApp\" data=\"data:application/x-silverlight-2,\" type=\"application/x-silverlight-2\" width=\"640\" height=\"480\" onload=\"onSLAppLoad();\">";
result+="<param name=\"source\" value=\"silverlight/sljetlag/SLJetLag.xap\"/>";
result+="<param name=\"onError\" value=\"onSilverlightError\" />";
result+="<param name=\"background\" value=\"white\" />";
result+="<param name=\"minRuntimeVersion\" value=\"3.0.40818.0\" />";
result+="<param name=\"autoUpgrade\" value=\"true\" />";
result+="<a href=\"http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0\" style=\"text-decoration:none\">";
result+="<img src=\"http://go.microsoft.com/fwlink/?LinkId=108181\" alt=\"Get Microsoft Silverlight\" style=\"border-style:none\"/>";
result+="</a>";
result+="</object><iframe id=\"_sl_historyFrame\" style=\"visibility:hidden;height:0px;width:0px;border:0px\"></iframe></div>";
result+="</form>";
	return(result);
}
document.getElementById("pagecontent").innerHTML=generateContent();
document.title="Silverlight JetLag";
