function ToggleVisible(element) 
{
    var theElement = document.getElementById(element);
    if (theElement.style.display != 'block') theElement.style.display = 'block';
    else theElement.style.display = 'none';
}

function SetVisible(element, isVisible) 
{
    var theElement = document.getElementById(element);
    if (isVisible) theElement.style.display = 'block';
    else theElement.style.display = 'none';
}

function JumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function GetSilverlightVersion() {
    var version = 'No Silverlight: ' + (navigator.appVersion + ', ' + navigator.platform).substring(0,55);
    var container = null;

    try {
        var control = null;
        var product = 'Silverlight';

        if (navigator.userAgent.indexOf("Linux") != -1) {
            product = "Silverlight (Moonlight)";
        }

        if (window.ActiveXObject) {
            control = new ActiveXObject('AgControl.AgControl');
        }
        else {
            if (navigator.plugins['Silverlight Plug-In']) {
                container = document.createElement('div');
                document.body.appendChild(container);
                container.innerHTML = '<embed type="application/x-silverlight" src="data:," />';
                control = container.childNodes[0];
            }
        }

        if (control) {
            if (control.isVersionSupported('3.0')) {
                version = product + '/3.0';
            }
            else if (control.isVersionSupported('2.0')) {
                version = product + '/2.0';
            }
            else if (control.isVersionSupported('1.0')) {
                version = product + '/1.0';
            }
        }
    }
    catch (e) { }

    if (container) {
        document.body.removeChild(container);
    }
    return version;
}
