﻿this.tooltip = function() {
    xOffset = 10;
    yOffset = 20;
    $(".tooltip").hover(function(e) {
        this.t = this.title;
        this.title = "";
        $("body").append("<div id='tooltip'>" + this.t + "</div>");
        $("#tooltip")
			.css("top", (e.pageY - xOffset) + "px")
			.css("left", (e.pageX + yOffset) + "px")
			.fadeIn("fast");
    },
	function() {
	    this.title = this.t;
	    $("#tooltip").remove();
	});
    $(".tooltip").mousemove(function(e) {
        ($("#tooltip")
			.css("top", (e.pageY - xOffset) + "px")
			.css("left", (e.pageX + yOffset) + "px"));
    });
};
$(document).ready(function() {
    tooltip();
});

function revealModal(divID, dest, title, width, height) {
    $("#modalDialog").dialog({ close: function(event, ui) { $("#modalDialog").dialog('destroy'); eval('AfterModal();'); }, resizable: false, modal: true, width: width, height: height.replace('px', ''), title: title, closeOnEscape: true });
    $('#modalDialog').html("<iframe src='" + dest + "' style='width:" + (width.replace('px', '') - 40) + "px;height:" + (height.replace('px', '') - 50) + "px;border:0;' frameborder='0' allowtransparency='false'></iframe>");
}
