function FormControll() { return this; } new FormControll(); FormControll.prototype.getFormObject = function (i, f, e) { if (typeof i == "object") return i; else if (document.getElementById && i) return document.getElementById(i); else if (f && e) return document.forms[f].elements[e]; else alert("Script Eroor : FormControll.getFormObject()"); } FormControll.prototype.value = function (i, f, e, v) { var o = this.getFormObject(i, f, e); if ((f && !e) || v) o.value = arguments[arguments.length -1]; else return o.value; } FormControll.prototype.checked = function (i, f, e) { var o = this.getFormObject(i, f, e); switch (arguments[arguments.length -1]) { case false: o.checked = "false"; break; case true: o.checked = "true"; break; case "get": return o.checked; break; default: o.checked = o.checked ? false : true; } } FormControll.prototype.click = function (i, f, e) { this.getFormObject(i, f, e).click(); } FormControll.prototype.blur = function (i, f, e) { this.getFormObject(i, f, e).blur(); } FormControll.prototype.focus = function (i, f, e) { this.getFormObject(i, f, e).focus(); } FormControll.prototype.select = function (i, f, e) { var o = this.getFormObject(i, f, e); o.select(); } FormControll.prototype.option = function (i, f, e) { var o = this.getFormObject(i, f, e); this.index = o.selectedIndex; this.options = o.options; this.length = this.options.length; this.value = this.options[this.index].value; this.text = this.options[this.index].text; this.setIndex = function (n) { this.index = n;} this.setSelected = function (n) { this.options[n].selected = true;} this.setValue = function (v) { this.options[this.index].value = v;} this.setText = function (v) { this.options[this.index].text = v;} return this; } //var fms = new FormControll();