/*** Start of file: generic\sundio\resource-info.js ***/
/**
 * Static object that handles functionality for showing tooltips on the text resource labels. Used when the site is viewed in admin mode and
 * all text resource labels are marked.
 * @class Show tooltips on the resource labels
 * @constructor
 * @param {jQuery} $ Reference to the jQuery object
 */
var ResourceInfo = function($){
    
	/** @namespace Private methods and variables */
    var priv = {
        
        /**
         * Setup tooltips on resource labels.
         * @param {jQuery} jQuery object containing elements to bind tooltips to
         * @private
         */
        toolTip: function($element) {            
            var path = Resource.GetText("path_prefix");
            $element.each(function (i) {
                $(this).jHelperTip({
                        trigger: "hover", 
                        source: "ajax", 
                        autoClose: false,
                        type: "GET",
                        position: "static",
                        ttC: "#divResourceInfo",
                        loadingText: "",
                        loadingImg: "",
                        topOff: 50,
                        leftOff: 10,
                        url: path + "/_html/resource-block.aspx",
                        data: { key: $(this).attr('ref') }
                    }
                );
            });
        } 
    };

    /** @scope ResourceInfo */
    return {
    
        /**
         * Initializes the logic for the tooltip
         * to be called on $(document).ready
         */
        OnReady: function(){
            $(window).bind("load", function(){
                priv.toolTip($('span.resource'));
                priv.toolTip($('span.admin-error'));
            });
        }
    };
}(jQuery);/*** End of file: generic\sundio\resource-info.js ***/
