(function($){$input=document.createElement('input');$.support.input=(function(at){var o={},i;for(i=0,n=at.length;i<n;i++){o[at[i]]=!!(at[i]in $input)}return o})('placeholder max min pattern'.split(' '));$.fn.placeholder=function(){if(!$.support.input.placeholder){return this.each(function(){var v=$(this).attr('placeholder'),iv=$(this).val();if(iv===''||iv==v){$(this).addClass('placeholder').val(v).click(function(){if($(this).hasClass('placeholder')){$(this).val('').removeClass('placeholder')}}).blur(function(){iv=$(this).val();if(iv===''||iv==v){$(this).addClass('placeholder').val(v)}})}$(this).change(function(){iv=$(this).val();if(iv===''){$(this).addClass('placeholder').val(v)}else{$(this).removeClass('placeholder')}})})}return this};$.fn.min=function(){if(!$.support.input.min){return this.change(function(){var m=parseFloat($(this).attr('min')),v=parseFloat($(this).val()),pv=$(this).attr('placeholder');if(pv!='undefined'&&pv==v){return this}if(v<m){$(this).val(m)}})}return this};$.fn.max=function(){if(!$.support.input.max){return this.change(function(){var m=parseFloat($(this).attr('max')),v=parseFloat($(this).val()),pv=$(this).attr('placeholder');if(pv!='undefined'&&pv==v){return this}if(v>m){$(this).val(m)}})}return this};$.fn.pattern=function(){if(!$.support.input.pattern){this.change(function(){var pattern=$(this).attr('pattern'),v=$(this).val(),pv=$(this).attr('placeholder');if(pv!='undefined'&&pv==v){return this}if(!new RegExp('^(?:'+pattern+')$').test(v)){var n=new RegExp('('+pattern+')').exec(v);$(this).val(n[0])}})}return this}})(jQuery);