﻿

$.fn.image = function(src, f, e, text) {

    return this.each(function() {
        var i = new Image();

        $(i).attr('title', text.toString());
        $(i).attr('id', 'imagePhoto');
        //                $(i).css('width', '145px');
        //                $(i).css('height', '193px');
        i.src = src;
        i.onload = f;
        i.onerror = e;
        //if ($('#imagePhoto') == null) {
        $(this).empty();

        this.appendChild(i);
        $('#imagePhoto').tooltip({
            track: false,
            delay: 0,
            showURL: false,
            opacity: 80,
            fixPNG: true,
            showBody: " - ",
            extraClass: "pretty",
            top: -215,
            left: -5
        });



    });
};



function refreshImage(url, text) {
    $('#canvasMovile').image(url.toString(), function() {


        //console.log('image loaded');
    },
    function(e) {
                //console.log('error loading' + e.toString());
          },
          text);
          //console.log('loading tooltip');

}