(function($){
$.fn.textFocus=function(v){
var range,len,v=v===undefined?0:parseInt(v);
this.each(function(){
if(!$.support.leadingWhitespace){
range=this.createTextRange();
v===0?range.collapse(false):range.move("character",v);
range.select();
}else{
len=this.value.length;
v===0?this.setSelectionRange(len,len):this.setSelectionRange(v,v);
}
this.focus();
});
return this;
}
})(jQuery);