﻿
$(document).ready(function () {
    $('a.toolTip').cluetip({ splitTitle: '|', dropShadow: false, cluetipClass: 'custom', showTitle: false });
    modulPopup();
    $('.slide-out-div').tabSlideOut({
        tabHandle: '.handle',                              //class of the element that will be your tab
        pathToTabImage: 'images/feedback/feedback_top_black.png',          //path to the image for the tab *required*
        imageHeight: '30px',                               //height of tab image *required*
        imageWidth: '80px',                               //width of tab image *required*    
        tabLocation: 'top',                               //side of screen where tab lives, top, right, bottom, or left
        speed: 300,                                        //speed of animation
        action: 'click',                                   //options: 'click' or 'hover', action to trigger animation
        topPos: '0px',
        leftPos: 'auto',                                   //position from the top
        fixedPosition: false                               //options: true makes it stick(fixed position) on scroll
    });
    $('.slide-out-div').css('visibility', 'visible');
    //            $(function() {
    //                var zIndexNumber = 1000;
    //                $('div').each(function() {
    //                    $(this).css('zIndex', zIndexNumber);
    //                    zIndexNumber -= 10;
    //                });
    //            });
});
function modulPopup() {
    var $loading = $('<img src="/images/ui/loader.gif" alt="loading">');
    $('a.right_menu_modal').each(function () {
        //this.preventDefault();
        var horizontalPadding = 30;
        var verticalPadding = 30;
        var $dialog = $('<div id="dialogue"></div>').append($loading);
        var $link = $(this).one('click', function () {
            $dialog
		.load($link.attr('href'), function () {
		    $('#closeMe', $dialog).click(function () {
		        $dialog.dialog('close');
		    });
		})
		.dialog({
		    title: $(this).text(),
		    autoOpen: true,
		    modal: true,
		    width: 725,
		    height: 500
		});
            $link.click(function () {
                $dialog.dialog('open');
                return false;
            });
            return false;
        });
    });

}
getSilverlightVersion = function () {
    var SLVersion;
    try {
        try {
            var control = new ActiveXObject('AgControl.AgControl');
            if (control.IsVersionSupported("4.0"))
                SLVersion = 4;
            else if (control.IsVersionSupported("3.0"))
                SLVersion = 3;
            else if (control.IsVersionSupported("2.0"))
                    SLVersion = 2;
            else
                    SLVersion = 1;
            control = null;
        }
        catch (e) {
            var plugin = navigator.plugins["Silverlight Plug-In"];
            if (plugin) {
                if (plugin.description === "1.0.30226.2")
                    SLVersion = 2;
                else
                    SLVersion = parseInt(plugin.description[0]);
            }
            else
                SLVersion = 0;
        }
    }
    catch (e) {
        SLVersion = 0;
    }
    return SLVersion;
}
     

