jQuery.extend({ 
    ImpromptuDefaults: { prefix: "jqi", buttons: { OK: true }, loaded: function() { }, submit: function() { return true }, callback: function() { }, opacity: 0.9, zIndex: 999, overlayspeed: 1, promptspeed: 1, show: "show", focus: 0, useiframe: false },
    SetImpromptuDefaults: function(a) {
        jQuery.ImpromptuDefaults = jQuery.extend({}, jQuery.ImpromptuDefaults, a)
    },
    //prompt: function(j, q, p) {p = jQuery.extend({}, jQuery.ImpromptuDefaults, p); var g = { width: 317, heigth: 92 }; var e = (jQuery.browser.msie && jQuery.browser.version < 7); var u = jQuery(document.body); var h = jQuery(window); var c = '<div class="' + p.prefix + 'box" id="' + p.prefix + 'box">'; if (p.useiframe && ((jQuery.browser.msie && jQuery("object, applet").length > 0) || e)) { c += '<iframe src="javascript:;" class="' + p.prefix + 'fade" id="' + p.prefix + 'fade"></iframe>' } else { if (e) { $("select").css("visibility", "hidden") } c += '<div class="' + p.prefix + 'fade" id="' + p.prefix + 'fade"></div>' } c += '<div class="' + p.prefix + '" id="' + p.prefix + '"><div class="' + p.prefix + 'container"><div class="' + p.prefix + 'close"><div style="float:left">' + j + '</div></div><div class="' + p.prefix + 'message">' + q + '</div><div class="' + p.prefix + 'buttons" id="' + p.prefix + 'buttons">'; jQuery.each(p.buttons, function(m, b) { c += '<button name="' + p.prefix + "button" + m + '" id="' + p.prefix + "button" + m + '" value="' + b + '">' + m + "</button>" }); c += "</div></div></div></div>"; var v = u.prepend(c).children("#" + p.prefix + "box"); var s = v.children("#" + p.prefix); var r = v.children("#" + p.prefix + "fade"); var a = function() { return jQuery(document).offset().top + "px" }; var i = function() { v.css({ top: a() }) }; var d = function() { var m = 0; v.addClass(p.prefix + "warning"); var b = setInterval(function() { v.toggleClass(p.prefix + "warning"); if (m++ > 1) { clearInterval(b); v.removeClass(p.prefix + "warning") } }, 100) }; var k = function(b) { if (b.which == 27 || (b.DOM_VK_ESCAPE == 27 && b.which == 0)) { f() } }; var l = function() { var b = { width: jQuery(window).width(), height: jQuery(window).height() }; var m = { width: jQuery(document).width(), height: jQuery(document).height() }; v.css({ position: (e) ? "absolute" : "fixed", height: m.height, width: "100%", top: (e) ? a() : 0, left: 0, right: 0, bottom: 0 }); r.css({ position: "absolute", height: m.height, width: "100%", top: 0, left: 0, right: 0, bottom: 0 }); s.css({ position: "absolute", left: (b.width - g.width) / 2, top: b.height / 2 - g.heigth }) }; var n = function() { r.css({ zIndex: p.zIndex, display: "none", opacity: p.opacity }); s.css({ zIndex: p.zIndex + 1, display: "none" }) }; var f = function(m, b, o) { s.remove(); if (e) { u.unbind("scroll", i) } h.unbind("resize", l); r.fadeOut(p.overlayspeed, function() { r.unbind("click", d); r.remove(); if (m) { p.callback(b, o) } v.unbind("keypress", k); v.remove(); if (e && !p.useiframe) { $("select").css("visibility", "visible") } }) }; l(); n(); jQuery("#" + p.prefix + "buttons").children("button").click(function() { var m = s.children("." + p.prefix + "container").children("." + p.prefix + "message"); var b = p.buttons[jQuery(this).text()]; if (p.submit(b, m)) { f(true, b, m) } }); if (e) { h.scroll(i) } r.click(d); h.resize(l); v.keypress(k); s.find("." + p.prefix + "close").click(f); r.show(p.overlayspeed); s[p.show](p.promptspeed, function() { s.find("#" + p.prefix + "buttons button:eq(" + p.focus + ")").focus(); p.loaded() }); return v}
    prompt: function(t, m, o) {
        var o = jQuery.extend({}, jQuery.ImpromptuDefaults, o);
        alert(m);
        if (o.callback != $.undefined) o.callback();
        return ""; //jqib
    }
 });

