/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Based on Making Compact Forms More Accessible by Mike Brittain (http://alistapart.com/articles/makingcompactformsmoreaccessible)
 */
(function(a){a.fn.overlabel=function(b){var d=a.extend({},a.fn.overlabel.defaults,b);var c=this.filter("label[for]").map(function(){var e=a(this);var j=e.attr("for");var h=document.getElementById(j);if(!h){return}var i=a.meta?a.extend({},d,e.data()):d;e.addClass(i.label_class);var f=function(){e.css(i.hide_css)};var g=function(){this.value||e.css(i.show_css)};a(h).parent().addClass(i.wrapper_class).end().focus(f).blur(g).each(f).each(g);return this});return d.filter?c:c.end()};a.fn.overlabel.defaults={label_class:"overlabel-apply",wrapper_class:"overlabel-wrapper",hide_css:{"text-indent":"-10000px"},show_css:{"text-indent":"0px",cursor:"text"},filter:false}})(jQuery);
