﻿function setLoginValue(theTarget){
    var sL=document.getElementById("Xaml1");
    var tB=sL.content.findName("dlgLogin").findName(theTarget);
    tB.Text=document.getElementById(theTarget).value;
}
function setThreadValue(theTarget){
    var sL=document.getElementById("Xaml1");
    var tB=sL.content.findName(theTarget);
    tB.Text=document.getElementById(theTarget).value;
}
function doLogin(e)
{
    var c=e.charCode? e.charCode : e.keyCode
    if(c==13){
        var cTime=new Date()
        var sL=document.getElementById("Xaml1");
        var tB=sL.content.findName("dlgLogin").findName("txtTrigger");
        tB.Text=cTime.getTime().toString();
    }
}

function goto(url) {    window.open(url);}

function getT()
{
    return t;
}
function getS()
{
    return s;
}
function showAlternative() {
    document.getElementById("divInstall").style.display = "none";
    document.getElementById("divAlternative").style.display = "block";
}

function WaitForInstallCompletion(){
    try{
        navigator.plugins.refresh();
    }catch(e){}
    if( Silverlight.isInstalled("2.0.31005") ){
        window.location.reload(false);
    }else{
        setTimeout(WaitForInstallCompletion,2000);
    }
}
function window_onload() {
    if (!Silverlight.isInstalled("2.0.31005")) {
        setTimeout(WaitForInstallCompletion,5000);
    }
}

function openItunes(it) {
    window.open(it, "ifrCommand");
}

function IsFireBugInstalled(){
    if (window.console && window.console.firebug) {
      return true;
    }
    else
    {
        return false;
    }
}