(function(a){var b={'font':'12px','color':'#999','left':'5px','top':'','position':'relative','fontFamily':'','display':'','zIndex':90,'rTop':'','width':'','height':'','lineHeight':''};a.fn.defaultValue=function(c){var d=a.extend({},b,c);var e=(function(){var g=document.createElement('input');return('placeholder'in g)})();var f=false;if(this[0]){var g=this[0].tagName;if(g!=null&&g!=''){if(g=='div'||g=='DIV'){f=true}}};if(e&&!f){return false};return this.each(function(){var g=a(this),h=a.trim(g.val());if(g.parent('.placeholder-wrapper')[0]){return};var i=g.width(),j=g.height();var k=j;if(this.tagName=="TEXTAREA"||this.tagName=="textarea"){k=30};var l=(this.id)?this.id:'placeholder'+(Math.floor(Math.random()*1123456789));var m=g.attr('placeholder');var n=a('<span class="placeholder" style="text-align:left" for='+l+'>'+m+'</span>');var o;if(d.top==null||d.top==''){o=g.css('padding-top')}else{o=d.top};if(d.width!=null&&d.width!=''){i=d.width};if(d.height!=null&&d.height!=''){j=d.height};if(d.lineHeight!=null&&d.lineHeight!=''){k=d.lineHeight};n.css({'left':d.left,'font':d.font,'color':d.color,'padding-top':o,'width':i,'height':j,'line-height':k+"px",'zIndex':d.zIndex,'position':'absolute'});var p=d.fontFamily;if(p!=''){n.css({'font-family':p})};if(d.rTop!=''){n.css({'top':d.rTop})};if(f){n.click(function(){a(this).focus()})};if(d.display!=null&&d.display!=''){g.wrap('<span class="placeholder-wrapper" style="position:'+d.position+'; display:'+d.display+';"></span>')}else{g.wrap('<span class="placeholder-wrapper" style="position:'+d.position+';"></span>')};g.attr('id',l).after(n);if(h&&!f){n.hide()}else if(f){var q=a(this).html();q=a.trim(q).toLowerCase();if(q.length>0&&!(q=='<br>'||q=='<p><br></p>'||q=='<p>&nbsp;</p>'||q=='<p></p>'||q=='<p/>')){n.hide()}};n.keydown(function(){g.trigger("focus")});n.focus(function(){a(this).hide();g.focus()});g.focus(function(){if(!a.trim(g.val())){n.hide()}});g.click(function(){g.focus()});g.blur(function(){if(f){var q=a(this).html();q=a.trim(q).toLowerCase();if(q.length==0||q=='<br>'||q=='<p><br></p>'||q=='<p>&nbsp;</p>'||q=='<p></p>'||q=='<p/>'){n.show()}}else{if(!a.trim(g.val())){n.show()}}})})}})(jQuery);