﻿function IsSilverlight() {
    this.degree = 0;
}
IsSilverlight.prototype.IsInstalled = function() {
    return window.Silverlight.isInstalled;
}
IsSilverlight.prototype.FadeIn = function(obj) {
    if(this.degree < 100){
        this.degree += 10;
        if (obj.filters && obj.filters[0]) {
            if (typeof obj.filters[0].opacity == "number") //if IE6+
                obj.filters[0].opacity = this.degree
            else //else if IE5.5-
                obj.style.filter = "alpha(opacity=" + this.degree + ")"
        }
        else if (obj.style.MozOpacity)
            obj.style.MozOpacity = this.degree / 101
        else if (obj.style.KhtmlOpacity)
            obj.style.KhtmlOpacity = this.degree / 100
        else if (obj.style.opacity && !obj.filters)
            obj.style.opacity = this.degree / 101
    }
}
IsSilverlight.prototype.FadeOut = function(obj) {
    if(this.degree > 0){
        this.degree -= 10;
        if (obj.filters && obj.filters[0]) {
            if (typeof obj.filters[0].opacity == "number") //if IE6+
                obj.filters[0].opacity = this.degree
            else //else if IE5.5-
                obj.style.filter = "alpha(opacity=" + this.degree + ")"
        }
        else if (obj.style.MozOpacity)
            obj.style.MozOpacity = this.degree / 101
        else if (obj.style.KhtmlOpacity)
            obj.style.KhtmlOpacity = this.degree / 100
        else if (obj.style.opacity && !obj.filters)
            obj.style.opacity = this.degree / 101
    }
}


