﻿(function(b) { b.fn.bestlower = function(c) { var d = { ln: "en", clear: true }, c = b.extend({}, d, c); this.each(function() { var e = b(this); if (e.is("textarea") || e.is("input:text")) { e.keypress(function(h) { var j = h.charCode == undefined ? h.keyCode : h.charCode; var i = String.fromCharCode(j); if (j < 65 || j > 90) { if (c.ln == "en" || !a(j)) { return } } if (c.ln == "tr" && j == 105) { i = "\u0130" } if (this.createTextRange) { window.event.keyCode = i.toLowerCase().charCodeAt(0); return } else { var g = this.selectionStart; var f = this.selectionEnd; this.value = this.value.substr(0, g) + i.toLowerCase() + this.value.substr(f); this.setSelectionRange(g + 1, g + 1); return false } }); if (c.clear) { e.blur(function(f) { if (c.ln == "tr") { this.value = this.value.replace(/i/g, "\u0130") } this.value = this.value.replace(/^\s+|\s+$/g, "").replace(/\s{2,}/g, " ").toLowerCase() }) } } }) }; function a(e) { var c = [231, 246, 252, 287, 305, 351]; for (var d = 0; d < c.length; d++) { if (c[d] == e) { return true } } return false } })(jQuery);
