(function(){String.prototype.pasteTo=function(f){f.focus();if(document.selection){var c=document.selection;var b=c.createRange();b.colapse;if(b){b.text=this}}else{if(f.selectionStart||f.selectionEnd){var e=f.scrollTop,g=f.selectionStart,a=f.selectionEnd;var d=f.value.substring(0,g)+this+f.value.substring(a,f.value.length);f.value=d;f.scrollTop=e;f.selectionStart=f.selectionEnd=g+this.length}else{f.value+=this;f.selectionStart=f.selectionEnd=f.value.length}}},String.prototype.translateToKA=function(){var b,d,e=[],a="abgdevzTiklmnopJrstufqRySCcZwWxjh";for(var c=0;c<this.length;c++){d=this.substr(c,1);if((b=a.indexOf(d))>=0){e.push(String.fromCharCode(b+4304))}else{e.push(d)}}return e.join("")},GeoKBD={browser:{isOpera:navigator.userAgent.toLowerCase().indexOf("opera")>-1,isIe:navigator.userAgent.toLowerCase().indexOf("msie")>-1,isIe6:navigator.userAgent.toLowerCase().indexOf("msie 6")>-1,isIe7:navigator.userAgent.toLowerCase().indexOf("msie 7")>-1},event:{get:function(a){return a||window.event},getKeyCode:function(a){a=this.get(a);return a.keyCode||a.which},targetIs:function(c,b){c=this.get(c);var a=c.target||c.srcElement;return a.tagName.toLowerCase()==b?a:null},attach:function(c,b,d,a){if(c.addEventListener){c.addEventListener(b,d,a)}else{if(c.attachEvent){return c.attachEvent("on"+b,d)}else{c["on"+b]=d}}},detach:function(c,b,d,a){if(c.removeEventListener){c.removeEventListener(b,d,a)}else{if(c.detachEvent){c.detachEvent("on"+b,d)}else{c["on"+b]=null}}},cancel:function(a){a=this.get(a);if(a.stopPropagation){a.stopPropagation();a.preventDefault()}else{a.cancelBubble=true;a.returnValue=false}}},map:function(f,g,e){var a=this;f=(typeof f=="string")?document.forms[f]:f;if(!f.fields||f.fields==undefined){f.fields={}}if(f.ka==undefined){f.ka=f[e]?f[e].checked:true}if(g){if(typeof g=="string"){g=[g]}for(var c=0;c<g.length;c++){if(f[g[c]]&&!f.fields[g[c]]){f.fields[g[c]]=g[c]}}}else{var b,d;for(var c=0;c<f.elements.length;c++){if(f.elements[c].type){b=f.elements[c].name;d=f.elements[c].type.toLowerCase();if(d=="text"||d=="textarea"){f.fields[b]=b}}}}e=e||"geo";f.switcher=e;f.onkeypress=function(j){j=a.event.get(j);if(j.altKey||j.ctrlKey){return}var i,k=e,h=a.event.getKeyCode(j);if(h==96){if(this[k]){this.ka=this[k].checked=!this[k].checked}else{this.ka=!this.ka}return false}else{if(this[k]){this.ka=this[k].checked}}if(!this.ka){return}if((i=(a.event.targetIs(j,"textarea")||a.event.targetIs(j,"input")))){if(!this.fields[i.name]){return}text=String.fromCharCode(h);kaText=text.translateToKA();if(kaText!=text){kaText.pasteTo(i);return false}}};f=null},mapIFrame:function(d){var c=function(k){var j=(k.target||k.srcElement).ownerDocument;if(j.ka==undefined){j.ka=true}var i=GeoKBD.event.getKeyCode(k);var l=String.fromCharCode(i);var h,g;if(parent.document.forms[j.parentForm]){h=parent.document.forms[j.parentForm];if(h.switcher&&h[h.switcher]){g=h[h.switcher]}}if(i==96){j.ka=!j.ka;if(g){g.checked=j.ka}GeoKBD.event.cancel(k)}else{if(g){j.ka=g.checked}}h=g=null;if(j.ka){var m=l.translateToKA();if(m!=l){if(!GeoKBD.browser.isIe){j.execCommand("InsertHTML",false,m)}else{var f=j.selection.createRange();f.pasteHTML(m)}GeoKBD.event.cancel(k)}}};var a=function(f){if(!GeoKBD.browser.isIe){GeoKBD.event.attach(this.document,"keypress",c,true);GeoKBD.event.detach(this,"focus",a,true)}else{GeoKBD.event.attach(this.contentWindow.document,"keypress",c,true);this.onfocus=null}};var b=window.setInterval(function(){var e=typeof d=="string"?document.getElementById(d):d();if(e){for(var f=e.parentNode;f&&f!=document.body;f=f.parentNode){if(/form/i.test(f.tagName)){if(e.contentWindow.document){e.contentWindow.document.parentForm=f.name||f.id}else{e.document.parentForm=f.name||f.id}break}}if(!GeoKBD.browser.isIe){GeoKBD.event.attach(e.contentWindow,"focus",a,true)}else{e.onfocus=a}e=null;window.clearInterval(b)}},100)}};window.GeoKBD=GeoKBD})();

