(function(){var ij=null;var jh="USCXTextBox";var Fe=jh+"_InputBox";var e=jh+"_ListBox";function Z(){if(ij.request.readyState==4&&ij.request.responseText){try{if(ij.request.status==200){ij.Ah.focus();if(ij.request.responseText.indexOf("USCXTextBoxStatus: Apply Hd8BgsuRxp0")>0){ij.Wh.innerHTML=ij.request.responseText;var ti=ij.Wh.firstChild.offsetHeight;var zd=ij.Wh.firstChild.firstChild.offsetHeight;if(ti>zd)ij.Wh.firstChild.style.height=zd+"px";V(ij.Ah);}else{Ee(ij.Ah);}}}catch(xg){ShowTestData("Error on Ajax return call : "+xg.description);}}}function th(){if(ij&&ij.request&&ij.request.readyState!=0&&ij.request.readyState!=4)ij.request.abort();}function Ge(){try{th();if(ij&&ij.request)ij.request.onreadystatechange=Ac;ij=new Object();ij.request=new XMLHttpRequest();}catch(xg){try{ij.request=new ActiveXObject("Msxml2.XMLHTTP");}catch(xg){ij.request=new ActiveXObject("Microsoft.XMLHTTP");}}}function Ed(xg){var y;if(window.event){y=event.keyCode;}else if(xg.which){y=xg.which;}return y;}function kh(P){return P.getAttribute("ServiceUrl");}function Wf(P){if(P.value&&P.value.length>=P.uscx.Xd&&P.value!=""){var he=kh(P);if(he&&he!=""){var yb=Ch(P.value);Ge();ij.Ah=P;ij.Wh=P.uscx.re;ij.request.open("get",he+yb+"&r="+P.uscx.He,true);ij.request.onreadystatechange=Z;ij.request.send(null);}}else{Ee(P);}}function rb(P){if(P){if(P.tagName=="INPUT"&&P.type=="text")return P;if(P=pc(P))P=P.firstChild;while(P){if(P.tagName=="INPUT"&&P.type=="text")break;P=P.nextSibling;}}return P;}function pc(P){if(P){while(P){if(P.tagName=="DIV"||P.tagName=="SPAN"){if(P.className==jh){P=P.firstChild;break;}else if(P.className==Fe||P.className==e)break;}P=P.parentNode;}if(P){var Hg=P;while(Hg){if(Hg.className==Fe)return Hg;Hg=Hg.nextSibling;}Hg=P.previousSibling;while(Hg){if(Hg.className==Fe)return Hg;Hg=Hg.previousSibling;}}}return null;}function ed(P){if(P){if(P.tagName=="TABLE")return P;if(P=rc(P))P=P.firstChild;while(P){if(P.tagName=="TABLE")break;P=P.firstChild;}}return P;}function rc(P){if(P&&P.tagName=="INPUT"&&P.type=="text"){var Hg=P.parentNode;while(Hg){if((Hg.tagName=="DIV"||Hg.tagName=="SPAN")&&Hg.className==e)return Hg;Hg=Hg.nextSibling;}Hg=P.previousSibling;while(Hg){if((Hg.tagName=="DIV"||Hg.tagName=="SPAN")&&Hg.className==e)return Hg;Hg=Hg.previousSibling;}return null;}else{while(P){if((P.tagName=="DIV"||P.tagName=="SPAN")&&P.className==e)return P;P=P.parentNode;}}return null;}function $(P){var tc=ed(P);while(tc){if(tc.tagName=="TR")break;tc=tc.firstChild;}return tc;}function bd(P,Yd){var tc=ed(P);var td=$(P);var uscx=P.uscx;var xb=-1;if(Yd<=-2){var Hg;while(td){xb++;Hg=td.nextSibling;if(!Hg)uscx.ph(td,1);else uscx.ph(td,0);td=Hg;}Yd=xb;}else{while(td){xb++;if(xb==Yd)uscx.ph(td,1);else uscx.ph(td,0);td=td.nextSibling;}if(Yd>xb)Yd=-1;}return Yd;}function t(vh,uscx){var Yd=uscx.mg;if(Yd>=0){var ig=vh.parentNode;var vi=vh.firstChild;if(vi)vi=vi.firstChild;if(vi){var Hg=0;while(Yd>0){Hg+=vi.offsetHeight;vi=vi.nextSibling;Yd--;}var b=Hg+vi.offsetHeight;if(Hg<ig.scrollTop){uscx.ii=true;ig.scrollTop=Hg;window.setTimeout(function(){uscx.ii=false},20);}else if(b>ig.scrollTop+ig.clientHeight){uscx.ii=true;ig.scrollTop=b-ig.clientHeight;window.setTimeout(function(){uscx.ii=false},20);}}}}function Ei(P){var tc,td;if((tc=ed(P))&&(td=P.uscx)){td.mg=bd(P,++td.mg);t(tc,td);}}function yd(P){var tc,td;if((tc=ed(P))&&(td=P.uscx)){td.mg=bd(P,--td.mg);t(tc,td);}}function Sg(P,Zd){if(P){var tc=document.getElementById(P.id+'.TextID');if(tc){tc.value=Zd;}}}function Re(P){var tc,td,Eb;tc=rb(P);if(tc&&(td=tc.uscx)){var xb=td.mg;if(xb>=0){Eb=ed(tc);if(Eb&&(Eb=Eb.firstChild)&&(Eb=Eb.firstChild)){while(Eb){if(xb==0)break;xb--;Eb=Eb.nextSibling;}if(Eb){tc.value=Eb.getAttribute("uscx_v");td.tb=tc.value;Sg(tc,Eb.getAttribute("uscx_i"))}}}Ee(tc);}}function Ee(P){var Rd=ed(P);th();if(Rd){Rd.style.visibility="hidden";}P.uscx.re.style.visibility="hidden";P.uscx.jb=false;P.uscx.mg=-1;P.uscx.bf=null;P.uscx.Nf=false;P.uscx.re.innerHTML="";}function V(P){var Rd=ed(P);if(Rd){Rd.style.visibility="visible";P.uscx.re.style.visibility="visible";P.uscx.jb=true;P.uscx.mg=-1;}P.focus();}function rg(P,xg){var xb=xg.keyCode;var uscx=Hf(P);if(kg(xb)||Pb(xb)){if(xg.preventDefault)xg.preventDefault();}if(uscx.jb){if(v(xb)){th();Ei(P);}else if(Sh(xb)){th();yd(P);}else if(Ab(xb)){Re(P);}else if(Pb(xb)){Ee(P);}}else{if(v(xb)){Wf(P);}}}function zf(P,xg){var uscx=Hf(P);if(P.value!=uscx.tb){Sg(P,"");Wf(P);uscx.tb=P.value;}}function af(P){var uscx=Hf(P);if(!uscx.bf){uscx.bf=window.setTimeout(function(){uscx.Fb();},20);}}function l(P){if(P.value==P.getAttribute("PromptText")){P.value="";P.select();}}function pi(P){var tc=rb(P);if(P&&tc&&!tc.uscx.ii){var td=tc.uscx;var xb=0;while(P=P.previousSibling)xb++;td.mg=bd(tc,xb);}}function jj(P){pi(P);}function w(P){pi(P);tc=rb(P);Re(P);if(tc){window.setTimeout(function(){tc.focus();},20);}}function Ch(Wc){return encodeURIComponent?encodeURIComponent(Wc):escape(Wc);}function Sh(Qf){return Qf==38||Qf==63232;}function v(Qf){return Qf==40||Qf==63233;}function kg(Qf){return Sh(Qf)||v(Qf);}function wi(Qf){return Qf==13;}function yf(Qf){return Qf==9;}function Ab(Qf){return wi(Qf)||yf(Qf);}function Pb(Qf){return Qf==27;}function Ac(){}function sf(P){this.re=rc(P);this.jb=false;this.Nf=false;this.tb=P.value;var Hg=P.getAttribute("Sensitivity");if(Hg){this.Xd=Hg;}else{this.Xd=2;}Hg=P.getAttribute("HighlightRowClass");if(Hg){this.hh=Hg;}this.mg=-1;this.kd=rg;this.ku=zf;this.b=af;this.f=l;this.He=new Date()-new Date(1);this.bf=null;this.ph=function(Oe,f){if(f==1){if(this.hh)Oe.className=this.hh;else{Oe.style.color="#ffffff";Oe.style.background="#000080";}}else{if(this.hh)Oe.className="";else{Oe.style.color="";Oe.style.background="";}}};this.Fb=function(){if(this.Nf){P.focus();}else{Ee(P);if(P.value==""){var Hg=P.getAttribute("PromptText");if(Hg)P.value=Hg;}};this.bf=null;};}function Hf(P){if(!P.uscx)P.uscx=new sf(P);return P.uscx;}function Kc(P){var tc=rb(P);if(tc)Hf(tc).Nf=false;}function Eh(P){var tc=rb(P);if(tc)Hf(tc).Nf=true;}window.uscx={kd:rg,ku:zf,b:af,f:l,mo:jj,md:w,Mo:Kc,Md:Eh};})();