function SLV() {
    logSLV(getSLV());
}
 
function getSLV() {
    var version = '0';
    var container = null;
    try {
 
        var control = null;
        if (window.navigator.userAgent.indexOf('MSIE') >= 0) {
            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('4.0')) { version = 4; }
            else if (control.isVersionSupported('3.0')) { version = 3; }
            else if (control.isVersionSupported('2.0')) { version = 2; }
            else if (control.isVersionSupported('1.1')) { version = 1; }
            else if (control.isVersionSupported('1.0')) { version = 1; }
        }
    }
 
    catch (e) { } if (container) {
        document.body.removeChild(container);
    }
 
    return version;
}

function logSLV(v) {
    var phpPath = 'http://www.lehreroffice.ch/services/slv/slv.php?slv='
    var xmlHttp = null;
    try {
        // Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
        xmlHttp = new XMLHttpRequest();
    } catch (e) {
        try {
            // MS Internet Explorer (ab v6)
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
            try {
                // MS Internet Explorer (ab v5)
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                xmlHttp = null;
            }
        }
    }
    if (xmlHttp) {
        xmlHttp.open('GET', phpPath + v, true);
        xmlHttp.send(null);
    }
}

