﻿// HTML5 placeholder plugin version 1.01
// Copyright (c) 2010-The End of Time, Mike Taylor, http://miketaylr.com
// MIT Licensed: http://www.opensource.org/licenses/mit-license.php

(function (b) {
    var f = "placeholder" in document.createElement("input"), g = b.browser.opera && b.browser.version < 10.5; b.fn.placeholder = function (c) {
        c = b.extend({}, b.fn.placeholder.defaults, c); var h = c.placeholderCSS.left; return f ? this : this.each(function () {
            var a = b(this), i = b.trim(a.val()), j = a.width(), k = a.height(), e = this.id ? this.id : "placeholder" + +new Date, d = a.attr("placeholder"); d = b("<label for=" + e + ">" + d + "</label>"); c.placeholderCSS.width = j; c.placeholderCSS.height = k; c.placeholderCSS.left = g && (this.type == "email" ||
this.type == "url") ? "11%" : h; d.css(c.placeholderCSS); if (!i) { a.wrap(c.inputWrapper); a.attr("id", e).after(d); b(d).after('<div style="clear:both;"></div>'); } a.focus(function () { b.trim(a.val()) || a.next().hide() }); a.blur(function () { b.trim(a.val()) || a.next().show() })
        })
    }; b.fn.placeholder.defaults = { inputWrapper: '<div style="position:relative" class="inputWrapper"></div>', placeholderCSS: { position: "absolute", left: "5px", top: "8px", "overflow-x": "hidden"} }
})(jQuery);

