/* 

* toggleElement support for Spotlight
*/
var intClickCount = 0;

function funClickReset() {
    intClickCount = 0;
}
$(document).ready(function(){ 
    $('div.toggler-promo').toggleElements( 
        { 
			fxAnimation:'slide', 
			fxSpeed:'fast', 
			className:'togglerMain', 
			onHide: function() {
				// MSIE doesn't stop playing Flash objects in hidden/non-displayed elements, so we have to kill the Spotlight and replace it with something else
				if ($.browser.msie) {
					$("div#ctl00_ctl00_SpotLight1_spotlightPromo").html('<a id="spotlightGoesHere" href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>');
				}
				funSpotLight('hide');
			},
			onShow: function() {
				// Since we killed the Spotlight when we hid it, we have to re-embed it when we show it again
				if ($.browser.msie) {
				    var hdnspotlightXMLPath = "";
				    if(document.getElementById("ctl00_ctl00_Spotlight1_hdnspotlightXMLPath"))
				    {
				        hdnspotlightXMLPath = document.getElementById("ctl00_ctl00_Spotlight1_hdnspotlightXMLPath").value;
				    }
					swfobject.embedSWF(
						"../spotlight/foxFast_spotlight.swf", // path to swf
						"spotlightGoesHere", // id of element to replace with swf
						"990", // width
						"307", // height
						"9.0.0", // minimum flash version required
						false,
						{xmlFile: hdnspotlightXMLPath}, // flashvars
						{quality: "best", scale: "noscale", wmode: "transparent", bgcolor: "000000", allowfullscreen: "false"}, // params
						{align: "middle", style: "margin-top: 10px;"} // attributes
					);
				}
				funSpotLight('show');				
			}
		} 
	);
});

function funPlaySelectedVideo(strIPAssetname, strTitleId, strTitleName, strRuntime, source, sourceurl2, strFileName, sourceurl1, strVideoType, strVideoAspectRatio, strFullScreen, strFileObjObjId, strWatchYN, strTitleType, strAssetName, strAssetType, strAssetFormatType, strFileSize) {
    toggleVideoLoadingMsg('');
    window.setTimeout("funPlaySelectedVideo1('" + strIPAssetname + "','" + strTitleId + "','" + strTitleName + "','" + strRuntime + "','" + source + "','" + sourceurl2 + "','" + strFileName + "','" + sourceurl1 + "','" + strVideoType + "','" + strVideoAspectRatio + "','" + strFullScreen + "','" + strFileObjObjId + "','" + strWatchYN + "','" + strTitleType + "','" + strAssetName + "','" + strAssetType + "','" + strAssetFormatType + "','" + strFileSize + "')", 1000);
    return false;
}
function funPlaySelectedVideo1(strIPAssetname,strTitleId,strTitleName,strRuntime,source,sourceurl2,strFileName,sourceurl1,strVideoType,strVideoAspectRatio,strFullScreen,strFileObjObjId,strWatchYN,strTitleType,strAssetName,strAssetType,strAssetFormatType,strFileSize) {
//     strFileName = "test.wmv";
//     source = "origin";
//     sourceurl2 = "adfds";
//     strVideoAspectRatio = "4:3"
    if (intClickCount == 0) {
        window.document.body.style.cursor = 'wait';
        intClickCount = 1;
        var GuidForPalyClick = "";
        try {
            GuidForPalyClick = guid();
        }
        catch (e) {
            GuidForPalyClick = guid();
        }
        var FoxFastVideoPlayerType = "";
        if (strTitleName != "") {
            strTitleName = strTitleName.replace("~@@~", "'");
        }
        if (strFileName != "") {
            strFileName = strFileName.replace("~@@~", "'");
        }
        if (strAssetName != "") {
            strAssetName = strAssetName.replace("~@@~", "'");
        }
        var strPlayerHeader = "";
        if (strRuntime == "") {
            strPlayerHeader = strTitleName + " - " + strTitleId;
        }
        else {
            strPlayerHeader = strTitleName + " - " + strTitleId + "(" + strRuntime + " Minutes)";
        }
        var vardate = new Date();
        if (source.toLowerCase() == "origin" && strVideoType.toLowerCase() == "long form drm low res") {
            //Added By Anil on 13.Oct.09 for not loading the player if the user wmv player is less than 11.0
            if (funKnowPlayerVersions() == false) {
                window.document.body.style.cursor = 'default';
                toggleVideoLoadingMsg('none');
                //Added to track the play click when object is not loaded (video failed to play)
                if (strTitleName != "") {
                    strTitleName = strTitleName.replace("'", "~@@~").replace(/\–/g, "~$~");
                }
                if (strFileName != "") {
                    strFileName = strFileName.replace("'", "~@@~").replace(/\–/g, "~$~");
                }
                if (strAssetName != "") {
                    strAssetName = strAssetName.replace("'", "~@@~").replace(/\–/g, "~$~");
                }
                if (strFileName.lastIndexOf(".mov") != -1) {
                    FoxFastVideoPlayerType = "QTP";
                }
                else if (strFileName.lastIndexOf(".wmv") != -1) {
                    FoxFastVideoPlayerType = "WMP";
                }
                //window.setTimeout("funPlayerPbTrends('" + strTitleName + "','" + strTitleId + "','" + strTitleType + "','" + strVideoType + "','" + strAssetType + "','" + strAssetFormatType + "','" + strAssetName + "','" + strFileName + "','" + strFileSize + "','" + FoxFastVideoPlayerType + "','failplay')", 7000);
                window.setTimeout("funClickReset()", 2000);
                return false;
            }
            else {
                funGetHtmlFromJQuery("Xmlhttp.aspx", "FileObjObjId=" + strFileObjObjId + "~" + vardate + "&Type=videowatch");
                funCreateDRMLicense(sourceurl1);
            }
        }
        if (strFileName.lastIndexOf(".wmv") != -1 && strFileName != "") {
            FoxFastVideoPlayerType = "WMP";
            window.document.getElementById("WMVPlayer").style.display = "block";
            window.document.getElementById("QTPlayer").style.display = "none";
            window.document.getElementById("divDefaultPlayer").style.display = "none";
            //funStopPlayingOtherPlayers('WMP');
            if (navigator.appName.toLowerCase() == "netscape") {
                funQuickTimeoverShowHide('show');
            }
            if (source.toLowerCase() == "origin" && sourceurl2 != "") {
                var strVideoStreaming = "s";
                if (window.document.getElementById("ctl00_ctl00_BodyContent_SubBodyContent_hdnVideoStream")) {
                    strVideoStreaming = window.document.getElementById("ctl00_ctl00_BodyContent_SubBodyContent_hdnVideoStream").value;
                }

                funGetHtmlFromJQuery("Xmlhttp.aspx", "FileObjObjId=" + strFileObjObjId + "~" + vardate + "&Type=videowatch");
                if (source.toLowerCase() == "dapr") {
                    funMediaPlayerObjec2(strIPAssetname, strVideoStreaming, strPlayerHeader, "", strVideoAspectRatio, strFullScreen, GuidForPalyClick);
                }
                else {
                    funMediaPlayerObjec2(strFileName, strVideoStreaming, strPlayerHeader, "", strVideoAspectRatio, strFullScreen, GuidForPalyClick);
                }
            }
            window.scrollTo(0, 0);
        }
        else if ((strFileName.lastIndexOf(".mov") != -1 && strFileName != "") || strAssetType.toString().toLowerCase() == "audio") {
            FoxFastVideoPlayerType = "QTP";
            window.document.getElementById("WMVPlayer").innerHTML = "";
            funGetHtmlFromJQuery("Xmlhttp.aspx", "FileObjObjId=" + strFileObjObjId + "~" + vardate + "&Type=videowatch");
            window.document.getElementById("divDefaultPlayer").style.display = "none";
            window.document.getElementById("QTPlayer").style.display = "block";
            window.document.getElementById("WMVPlayer").style.display = "none";
            //funStopPlayingOtherPlayers('QTP');
            var strControl = "";
            var strIE = "Y";
            if (navigator.appName.toLowerCase() == "netscape") {
                strIE = "N";
                funQuickTimeoverShowHide('hide');
            }
            window.document.getElementById("QTPlayer").innerHTML = "<div id='screeningHead'  class='screeningHeadOpen'>" +
        "<div class='title' id='divScrRoomTitle'></div>" +
        "<div class='subtitle' id='divVideosubtitle'>" + strPlayerHeader + "</div>" +
        "<div class='info' id='divVideoInfo'></div>" +
        "</div>" +
        "<div id='QTBody'>" +
        "<div style='position:relative;TEXT-ALIGN: center;'>" +
        "<IFRAME id='QT_Player_iframe' name='QT_Player_iframe' style='vertical-align:top' src='../aspxfiles/QTPlayer.aspx?FileName=" + strIPAssetname + "&PlayerSize=" + strVideoAspectRatio + "&IE=" + strIE + "'  width='990' height='327' scrolling='no' frameborder='0'></IFRAME>" +
        "</div>" +
        strControl +
        "</div>";

            funQTBody();
            window.scrollTo(0, 0);
        }
        funCloseVideoDialog();

        if (strTitleName != "") {
            strTitleName = strTitleName.replace("'", "~@@~").replace(/\–/g, "~$~");
        }
        if (strFileName != "") {
            strFileName = strFileName.replace("'", "~@@~").replace(/\–/g, "~$~");
        }
        if (strAssetName != "") {
            strAssetName = strAssetName.replace("'", "~@@~").replace(/\–/g, "~$~");
        }
        strAssetFormatType = strAssetFormatType + "~@$" + GuidForPalyClick;
        window.setTimeout("funPlayerPbTrends('" + strTitleName + "','" + strTitleId + "','" + strTitleType + "','" + strVideoType + "','" + strAssetType + "','" + strAssetFormatType + "','" + strAssetName + "','" + strFileName + "','" + strFileSize + "','" + FoxFastVideoPlayerType + "')", 7000);
        window.setTimeout("funClickReset()", 2000);
        window.document.body.style.cursor = 'default';
    }

    toggleVideoLoadingMsg('none');
    return false;
}

function funPlayerPbTrends(strTitleName, strTitleId, strTitleType, strVideoType, strAssetType, strAssetFormatType, strAssetName, strFileName, strFileSize, FoxFastVideoPlayerType,strFailViewType) {
    var strPlayerVersion = "";
    var strPlayer = "";
    var strWMPlayerVersion = "";
    var strWMPlayer = "";
    var strFailedPlayViewType = strFailViewType;
    if (FoxFastVideoPlayerType == "QTP" && window.frames["QT_Player_iframe"] && (window.frames["QT_Player_iframe"].document.getElementById("QuicktimePlayer"))) {
        strPlayerVersion = window.frames["QT_Player_iframe"].document.getElementById("QuicktimePlayer").getQuickTimeVersion();
        strPlayerVersion = (strPlayerVersion != "") ? strPlayerVersion.substring(0,strPlayerVersion.indexOf('.') + 2) : strPlayerVersion;
        strPlayer = "Quick Time Player";
    }
    else if (FoxFastVideoPlayerType == "WMP") {
        var SilLightInstalFlag = isSilverlightInstalled();
        if (SilLightInstalFlag == "Y" && strVideoType.toLowerCase() != "long form watermarked") {
            strPlayerVersion = getSilverlightVersion();
            strPlayer = "Silver Light Player";
            strWMPlayerVersion = printResults();
            strWMPlayerVersion = (strWMPlayerVersion != "") ? strWMPlayerVersion.substring(0, strWMPlayerVersion.indexOf('.') + 2) : strWMPlayerVersion;
            strWMPlayer = "Windows Media Player";
        }
        else {
            strPlayerVersion = printResults();
            strPlayerVersion = (strPlayerVersion != "") ? strPlayerVersion.substring(0,strPlayerVersion.indexOf('.') + 2) : strPlayerVersion;
            strPlayer = "Windows Media Player";
        }
    }
    var viewType = "";
    if(strPlayer != "")
    {
        if(strPlayerVersion != "" && strPlayerVersion != "0")
        {
            viewType = ((strFailedPlayViewType == "failplay") ? "Play Attempt" : "Play") + " - (" + strPlayer + " : " + strPlayerVersion + ")" + " " + ((strWMPlayer != "" && strWMPlayerVersion != "0") ? "(" + strWMPlayer + " : " + strWMPlayerVersion + ")" : ((strWMPlayer != "") ? "(" + strWMPlayer + ")" : ""));
        }
        else
        {
            viewType = ((strFailedPlayViewType == "failplay") ? "Play Attempt" : "Play") + " - (" + strPlayer + ")" + " " + ((strWMPlayer != "") ? "(" + strWMPlayer + ")" : "");
        }
    }
    else
    {
        viewType = ((strFailedPlayViewType == "failplay") ? "Play Attempt" : "Play");
    }
    funPBTrends(strTitleName, strTitleId, strTitleType, "", viewType, strVideoType, strAssetFormatType, strAssetName, strFileName, strFileSize);
   
}
function funMediaPlayerObjec2(strFileName, strVideoStreaming, strPlayerHeader, url, strVideoAspectRatio, strFullScreen, GuidForPalyClick) {
    window.document.getElementById("QTPlayer").innerHTML = "";
    var strCheckSliverlight = "<div style='position:relative; text-align:center;'>";
    var OSType = funGetOperatingSystem();
    var SilLightInstalFlag = isSilverlightInstalled();
    var Browser = funGetBrowserType();
    if (Browser.toLowerCase() == "netscape") {
        strCheckSliverlight = "<div id='divSlpCheck' style='position:relative; text-align:center;'>";
    } 
    window.document.getElementById("WMVPlayer").innerHTML =  "<div id='screeningHead'  class='screeningHeadOpen'>"+
        "<div class='title' id='divScrRoomTitle'></div>"+
        "<div class='subtitle' id='divVideosubtitle'>" + strPlayerHeader + "</div>"+
        "<div class='info' id='divVideoInfo'></div>"+
    "</div>"+
   "<div id='QTBody'>"+
    strCheckSliverlight +
    "<IFRAME id='MediaPlayer_iframe' name='MediaPlayer_iframe' src='../aspxfiles/WMVPlayer.aspx?FileName=" + strFileName + "&stream=" + strVideoStreaming + "&url=" + url + "&PlayerSize=" + strVideoAspectRatio + "&OSType=" + OSType + "&SilLightInstalFlag=" + SilLightInstalFlag + "&FullScreen=" + strFullScreen + "&Browser=" + Browser + "&PBTid=" + GuidForPalyClick + "'  width='990' height='327' scrolling='no' frameborder='0'></IFRAME>" +
    "</div></div>";
    funQTBody();
}
function funMediaPlayerObjec(strFileName, strVideoStreaming, strPlayerHeader, url, TitObjObjId, strVideoAspectRatio, strFullScreen, GuidForPalyClick) {
    window.document.getElementById("QTPlayer").innerHTML = "";
    var strCheckSliverlight = "<div style='position:relative; text-align:center;'>";
    var OSType = funGetOperatingSystem();
    var SilLightInstalFlag = isSilverlightInstalled();
    var Browser = funGetBrowserType();
    if (Browser.toLowerCase() == "netscape") {
        strCheckSliverlight = "<div id='divSlpCheck' style='position:relative; text-align:center;'>";
    } 
    window.document.getElementById("WMVPlayer").innerHTML = "<div id='screeningHead'  class='screeningHeadOpen'>" +
        "<div class='title' id='divScrRoomTitle'>Screening Room</div>" +
        "<div class='subtitle' id='divVideosubtitle'>" + strPlayerHeader + "</div>" +
        "<div class='info' id='divVideoInfo'></div>" +
    "</div>" +
    "<div id='QTBody'>" +
    strCheckSliverlight +
    "<IFRAME id='MediaPlayer_iframe' name='MediaPlayer_iframe' src='../aspxfiles/WMVPlayer.aspx?FileName=" + strFileName + "&stream=" + strVideoStreaming + "&url=" + url + "&PlayerSize=" + strVideoAspectRatio + "&OSType=" + OSType + "&SilLightInstalFlag=" + SilLightInstalFlag + "&FullScreen=" + strFullScreen + "&Browser=" + Browser + "&PBTid=" + GuidForPalyClick + "'  width='990' height='327' scrolling='no' frameborder='0'></IFRAME>" +
    "</div></div>";
    funQTBody();
}

function funQTBody() {
    var obj = window.document.getElementById("ctl00_ctl00_SpotLight1_divSpotLight");
    $("#screeningHead").click(function() {

        if ($("#QTBody").is(":hidden")) {
            $("#QTBody").slideDown("fast");
            $("#screeningHead").removeClass('screeningHeadClosed');
            $("#screeningHead").addClass('screeningHeadOpen');
            if (navigator.appName.toLowerCase() == "netscape" && window.document.getElementById("QTPlayer") && window.document.getElementById("QTPlayer").style.display == 'block') {
                funQuickTimeoverShowHide('hide');
            }
            funSetPlayeronSpotlight('show');
            if (window.document.getElementById("divDefaultPlayer") && window.document.getElementById("divDefaultPlayer").style.display == 'block') {
                funRemoveTogglerLinkClass(obj, 'toggler', 'onHide', '');
            }
        }
        else {
            $("#QTBody").slideUp("fast");
            $("#screeningHead").removeClass('screeningHeadOpen');
            $("#screeningHead").addClass('screeningHeadClosed');
            funQuickTimeoverShowHide('show');
            funSetPlayeronSpotlight('hide');
            if (window.document.getElementById("divDefaultPlayer") && window.document.getElementById("divDefaultPlayer").style.display == 'block') {
                funRemoveTogglerLinkClassShow(obj, 'toggler', 'onShow', '');
            }
        }
    });
}

function funtoggle() {
    $(document).ready(function() {
        $('div.toggler-promos').toggleElements(
        {
            fxAnimation: 'slide',
            fxSpeed: 'fast',
            className: 'togglerMain',
            onHide: function() {

            },
            onShow: function() {

            }
        }
	);
    });
}


function funQTPlayerFireFox()
{

$(document).ready(function(){

// jquery function for hover-trigger video controls

var _PendingHide;

$("#playerdiv").hover(function() {
if (_PendingHide) { clearTimeout(_PendingHide );}
$("#controls_container_FireFox").slideDown("slow");
}, function() {

_PendingHide = setTimeout(function() { $("#controls_container_FireFox").slideUp("slow"); },
2000);


});

$("#controls_container_FireFox").hover(function() {
if (_PendingHide) { clearTimeout(_PendingHide );}
}, function() {
_PendingHide = setTimeout(function() { $("#controls_container_FireFox").slideUp("slow"); },
2000);
});


  });

}

function funQuickTimeoverShowHide(display) {
    if (display == 'show') {
        if (window.document.getElementById("ctl00_ctl00_Login1_titleSearch")) {
            window.document.getElementById("ctl00_ctl00_Login1_titleSearch").value = "Title Search";
            window.document.getElementById("ctl00_ctl00_Login1_titleSearch").disabled = false;
        }
        if (window.document.getElementById("ddsubmenu1")) {
            window.document.getElementById("ddsubmenu1").setAttribute("style", "display:block");
        }
        if (window.document.getElementById("ddsubmenu2")) {
            window.document.getElementById("ddsubmenu2").setAttribute("style", "display:block");
        }
        if (window.document.getElementById("btnsearch")) {
            window.document.getElementById("btnsearch").disabled = false;
        }
    }
    else {
        if (window.document.getElementById("ctl00_ctl00_Login1_titleSearch")) {
            window.document.getElementById("ctl00_ctl00_Login1_titleSearch").value = "Close video window to search";
            window.document.getElementById("ctl00_ctl00_Login1_titleSearch").disabled = true;
        }
        if (window.document.getElementById("ddsubmenu1")) {
            window.document.getElementById("ddsubmenu1").setAttribute("style", "display:none");
        }
        if (window.document.getElementById("ddsubmenu2")) {
            window.document.getElementById("ddsubmenu2").setAttribute("style", "display:none");
        }
        if (window.document.getElementById("btnsearch")) {
            window.document.getElementById("btnsearch").disabled = true;
        }
        if (window.document.getElementById("PopupDiv")) {
            window.document.getElementById("PopupDiv").innerHTML = "";
            window.document.getElementById("PopupDiv").setAttribute("style", "display:none");
        }
        
    }

}

function funStopPlayingOtherPlayers(type) {
    if (type == 'QTP') {
        if ($.browser.msie) {
            $("div#ctl00_ctl00_SpotLight1_spotlightPromo").html('<a id="spotlightGoesHere" href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>');
        }
        if (window.frames["MediaPlayer_iframe"] && window.frames["MediaPlayer_iframe"].document.getElementById("MediaPlayer") && (window.document.getElementById("WMVPlayer") && window.document.getElementById("WMVPlayer").style.display == 'block')) {
            objPlayer = window.frames["MediaPlayer_iframe"].document.getElementById("MediaPlayer");
            objPlayer.controls.stop();
        }
    }
    else if (type == 'WMP') {
        if ($.browser.msie) {
            $("div#ctl00_ctl00_SpotLight1_spotlightPromo").html('<a id="spotlightGoesHere" href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>');
        }
        if (window.frames["QT_Player_iframe"] && window.frames["QT_Player_iframe"].document.getElementById("QuicktimePlayer") && (window.document.getElementById("QTPlayer") && window.document.getElementById("QTPlayer").style.display == 'block')) {
            objPlayer = window.frames["QT_Player_iframe"].document.getElementById("QuicktimePlayer");
            objPlayer.Stop();
        }
    }
    else {
        if (window.frames["MediaPlayer_iframe"] && window.frames["MediaPlayer_iframe"].document.getElementById("MediaPlayer") && (window.document.getElementById("WMVPlayer") && window.document.getElementById("WMVPlayer").style.display == 'block')) {
            objPlayer = window.frames["MediaPlayer_iframe"].document.getElementById("MediaPlayer");
            objPlayer.controls.stop();
        }
        if (window.frames["QT_Player_iframe"] && window.frames["QT_Player_iframe"].document.getElementById("QuicktimePlayer") && (window.document.getElementById("QTPlayer") && window.document.getElementById("QTPlayer").style.display == 'block')) {
            objPlayer = window.frames["QT_Player_iframe"].document.getElementById("QuicktimePlayer");
            objPlayer.Stop();
        }
    }
}


function detectWMP() {
    var wmpInfo = {
        installed: false,
        scriptable: false,
        type: null,
        versionInfo: null
    };
    var wmp64 = "MediaPlayer.MediaPlayer.1";
    var wmp7 = "WMPlayer.OCX.7";

    if ((window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1) || window.GeckoActiveXObject) {
        wmpInfo.type = "ActiveX";
        var player = createActiveXObject(wmp7);
        if (player) {
            wmpInfo.installed = true;
            wmpInfo.scriptable = true;
            wmpInfo.versionInfo = player.versionInfo;
            return wmpInfo;
        }
        else {
            player = createActiveXObject(wmp64);
            if (player) {
                wmpInfo.installed = true;
                wmpInfo.scriptable = true;
                wmpInfo.versionInfo = "6.4";
                return wmpInfo;
            }
            else {
                wmpInfo.versionInfo = "none";
                return wmpInfo;
            }
        }
    }
    
}

function createActiveXObject(id) {
    var error;
    var control = null;

    try {
        if (window.ActiveXObject) {
            control = new ActiveXObject(id);
        }
        else if (window.GeckoActiveXObject) {
            control = new GeckoActiveXObject(id);
        }
    }
    catch (error) {
    }
    return control;
}

function printResults() {
    var detectionResults = detectWMP();
    if (detectionResults.installed) {
        return detectionResults.versionInfo;
    }
    else
        return 0;
}

getSilverlightVersion = function() {

    var SLVersion;

    try {
        try {

            var control = new ActiveXObject('AgControl.AgControl');

            if (control.IsVersionSupported("3.0"))
                SLVersion = "3.0";

            else

                if (control.IsVersionSupported("2.0"))
                SLVersion = "2.0";

            else

                SLVersion = "1.0";
            control = null;

        }

        catch (e) {
            var plugin = navigator.plugins["Silverlight Plug-In"];

            if (plugin) {
                if (plugin.description === "3.0.40624.0") {
                    SLVersion = "3.0";
                }

                else if (plugin.description === "2.0.30523.6") {
                    SLVersion = "2.0";
                }
                else if (plugin.description === "1.0.30226.2") {
                    SLVersion = "1.0";
                }
                else {
                    SLVersion = parseInt(plugin.description[0]);
                }

            }

            else {
                SLVersion = 0;
            }

        }

    }

    catch (e) {
        SLVersion = 0;

    }
    return SLVersion;

}









