﻿/*
*
* jQuery commandText item plugin 
* Version 1.0 (2008-22-10)
* @requires jQuery v1.2.3 or later
*
*/

; (function($) {


    function install(el, opts) {

    }


    $.fn.commandText = function(opts, clicked) {
        return this.each(function(i) {
            var el = $(this);
            __commandText(el, opts, clicked);

        });
    }


    var __text = '';
    function __commandText(el, opts, clicked) {
        __text = opts.text;
        /*$(el).hover(
        function() {
                
        }
        , function() { });*/
        var _top = $(el).height(); //114px
        var _width = $(el).width(); //114px
        //alert(_top);


        var id = new Date().getTime();
        /*
            
        */
        $(el).bind('mouseenter', function() {
            $(el).append('<div id="' + id + '" style="float:left;' +
                                ';overflow:hidden;opacity:0.7;margin:0;padding:0;margin-top:-' + _top + 'px;position:absolute;padding:3px;border:solid 0;background:white;">' +
                            '<span style=\"z-index:9999;float:left;opacity:1;\">' + __text + '</span>' +
                        '</div>');
        });

        /*
            
        */
        $(el).bind('mouseleave', function() {
            $('#' + id, el).remove();
        });

        
        $('#img', el).bind('click',clicked);


    }




})(jQuery);