function LSD_TextControl(nl,xl,id,mnd,ein,emnd,nv,xv,d,n,dp,ts,tp,r,fz,flc,tt,re){var i=navigator.userAgent.toLowerCase().indexOf("msie");this.ie7=i> -1&&parseInt(navigator.userAgent.toLowerCase().substring(i+4))>=7;this.ie=i> -1;this.saf=(navigator.userAgent.toLowerCase().indexOf("safari")> -1);this.fox=(navigator.userAgent.toLowerCase().indexOf("firefox")> -1);this.op=(navigator.userAgent.toLowerCase().indexOf("opera")> -1);this.moz=((navigator.userAgent.toLowerCase().indexOf("firefox")== -1)&&(navigator.userAgent.toLowerCase().indexOf("gecko")> -1))&& !this.saf;this.nav=(navigator.userAgent.toLowerCase().indexOf("navigator")> -1);this.nl=nl;this.xl=xl;this.id=id;this.mnd=mnd;this.ein=ein;this.emnd=emnd;this.nv=nv;this.xv=xv;this.d=d;this.n=n;this.dp=dp;this.ts=ts;this.tp=tp;this.r=r;this.fz=fz;this.flc=flc;this.tt=tt;this.re=re;this.tc=this.wc=this.cc=this.hc=this.dcc=this.M=null;};LSD_TextControl.prototype.reset=function(){this.init();this.hc.value=parseInt(this.hc.value,10)& ~2;this.isValid(false,true);};LSD_TextControl.prototype.clear=function(f,L,H){this.init();if(typeof f=='undefined')f=false;if(typeof H=='undefined')H=false;if(typeof L=='undefined')L=false;if(this.e||f){var pv=this.gpv(this.v);this.hc.value=parseInt(this.hc.value,10)|2;this.tc.value='';if(L)this.M='';var b=this.v.length>0;this.v='';if(this.wc!=null){if(this.mnd){this.wc.style.display='block';this.wc.title=this.emnd;}else{this.wc.style.display='none';}}if(b){if(this.ClientClearPostback!=null){this.ClientClearPostback();}else if(this.OnClientCleared!=null){this.OnClientCleared(this,pv,H,!this.mnd);}}}};LSD_TextControl.prototype.focus=function(){this.init();if(this.e)this.tc.focus();};LSD_TextControl.prototype.enable=function(){this.init();if(this.r){this.tc.readOnly=false;}else{this.tc.disabled=false;}if(this.dcc!=null)this.dcc.style.display='none';if(this.cc!=null)this.cc.style.display='block';this.e=true;this.hc.value=parseInt(this.hc.value,10)|1;};LSD_TextControl.prototype.disable=function(){this.init();if(this.r){this.tc.readOnly=true;}else{this.tc.disabled=true;}if(this.cc!=null)this.cc.style.display='none';if(this.dcc!=null)this.dcc.style.display='block';this.e=false;this.hc.value=parseInt(this.hc.value,10)& ~1;};LSD_TextControl.prototype.isEnabled=function(){this.init();return this.e;};LSD_TextControl.prototype.isEmpty=function(){this.init();this.tr();return this.tc.value.length==0;};LSD_TextControl.prototype.isValid=function(b1,b2){this.init();if(typeof b2=='undefined')b2=false;var o=false,n= -1;this.tr();if(this.tc.value.length!=0){o=(this.nl==0||this.tc.value.length>=this.nl)&&(this.xl==0||this.tc.value.length<=this.xl);if(this.tp>0&&o){var s=this.tc.value;if(this.tp==3){var nRes=s.search(/^\w+((-\w+)|(\.\w+)|(\'\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]{2,4}$/);o=nRes!= -1;}else if(this.tp==5){var nRes=s.search(/^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$/);o=nRes!= -1;}else if(this.tp==4){if(this.re.length==0)o=true;else o=new RegExp(this.re).exec(s)==s;}else{if(this.tp==1){for(n=s.length-1,m=1;n>=0;n--,m++){if(this.ts!=null&&m%4==0&& !(n==0&&s.charCodeAt(n)==45)){if(this.ts!=s.charAt(n)){break;}}else if((s.charCodeAt(n)<48||s.charCodeAt(n)>57)&& !(n==0&&this.n&&s.charCodeAt(n)==45)){break;}}}else{n=s.indexOf(this.dp);if(n== -1|| !((s.indexOf(this.dp,n+1)> -1||s.length-n>this.flc+1)&&n> -1)){if(n==0){n= -1;}else{for(n=(n== -1?s.length-1:n-1),m=1;n>=0;n--,m++){if(this.ts!=null&&m%4==0&& !(n==0&&s.charCodeAt(n)==45)){if(this.ts!=s.charAt(n)){break;}}else if((s.charCodeAt(n)<48||s.charCodeAt(n)>57)&& !(n==0&&this.n&&s.charCodeAt(n)==45)){break;}}}}}o=n== -1;}if(o&&this.tp!=3&&this.tp!=4&&this.tp!=5&&(this.nv!=null||this.xv!=null)){if(this.ts=='.'){s=this.tc.value.replace(/\./g,'');}else if(this.ts==','){s=s.replace(/\,/g,'');}if(this.tp==1){s=parseInt(s,10);}else{if(this.dp==','){s=s.replace(/\,/g,'.');}s=parseFloat(s);}if((this.nv!=null&&s<this.nv)||(this.xv!=null&&s>this.xv)){o=false;}}}if((b1||b2)&& !o&&this.wc!=null){this.wc.style.display='block';this.wc.title=this.ein;}}else{o= !this.mnd;if(b1||b2){if(this.mnd&&this.wc!=null){this.wc.style.display=((((parseInt(this.hc.value,10)&2)>0)&&b2)||b1)?'block':'none';this.wc.title=this.emnd;}else if(this.wc!=null){this.wc.style.display='none';}}}return o;};LSD_TextControl.prototype.getValue=function(){this.init();this.tr();var s=null;if(this.tc.value.length!=0){if(this.isValid(false,false)){s=this.tc.value;if(this.tp>0&&this.tp<3){if(this.ts=='.'){s=s.replace(/\./g,'');}else if(this.ts==','){s=s.replace(/\,/g,'');}try{if(s.length==0){s=parseInt('r');}else{if(this.tp==1){s=parseInt(s,10);}else{if(this.dp==','){s=s.replace(/\,/g,'.');}s=parseFloat(s);}}}catch(ex){s=parseInt('r');}}else{switch(this.tt){case 1:s=s.toUpperCase();break;case 2:s=s.toLowerCase();break;case 3:if(this.tp!=3&&this.tp!=5)s=s.replace(/\b([a-z])/g,function($0){return $0.toUpperCase();});break;}}}else{if(this.tp==0||this.tp==3||this.tp==4||this.tp==5){s=this.tc.value;}else if(this.tp==1){s=parseInt(this.tc.value,10);}else{s=parseFloat(this.tc.value);}}}else{if(this.tp==0||this.tp==3||this.tp==4||this.tp==5){s='';}else{s=parseInt('r');}}return s;};LSD_TextControl.prototype.setValue=function(t,f,L){this.init();if(typeof f=='undefined')f=false;if(t==null||typeof t=='undefined')t='';if(typeof L=='undefined')L=false;if(!this.e&& !f){return;}var v=t.toString().replace(/^\s+|\s+$/g,'');var pv=this.gpv(v);if(this.tp>0&&this.tp<3){if(this.tp==2){if(this.dp==','){v=v.replace(/\./g,',');}else{v=v.replace(/\,/g,'.');}}v=this.mv(v);}this.tc.value=v;var bv=this.isValid(false,false),f=this.v!=v;this.v=this.tc.value;if(L)this.M=this.v;if(this.wc!=null){if(bv){this.wc.style.display='none';}else{this.wc.style.display='block';this.wc.title=this.tc.value.length==0?this.emnd:this.ein;}}if(f){if(v.length==0){if(this.ClientClearPostback!=null){this.ClientClearPostback();}else if(this.OnClientCleared!=null){this.OnClientCleared(this,pv,false,!this.mnd);}}else{if(this.ClientChangePostback!=null){this.ClientChangePostback();}else if(this.OnClientChanged!=null){this.OnClientChanged(this,pv,this.getValue(),false,bv);}}}};LSD_TextControl.prototype.resetValue=function(){this.frmrst();};LSD_TextControl.prototype.OnClientChanged=null;LSD_TextControl.prototype.OnClientCleared=null;LSD_TextControl.prototype.ClientChangePostback=null;LSD_TextControl.prototype.ClientClearPostback=null;LSD_TextControl.prototype.isv=function(v){this.init();var o=false,n= -1;v=v.replace(/^\s+|\s+$/g,'');if(v.length!=0){o=(this.nl==0||v.length>=this.nl)&&(this.xl==0||v.length<=this.xl);if(this.tp>0&&o){var s=v;if(this.tp==3){var nRes=s.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]{2,4}$/);o=nRes!= -1;}else if(this.tp==5){var nRes=s.search(/^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$/);o=nRes!= -1;}else if(this.tp==4){if(this.re.length==0)o=true;else o=new RegExp(this.re).exec(s)==s;}else{if(this.tp==1){for(n=s.length-1,m=1;n>=0;n--,m++){if(this.ts!=null&&m%4==0&& !(n==0&&s.charCodeAt(n)==45)){if(this.ts!=s.charAt(n)){break;}}else if((s.charCodeAt(n)<48||s.charCodeAt(n)>57)&& !(n==0&&this.n&&s.charCodeAt(n)==45)){break;}}}else{n=s.indexOf(this.dp);if(n== -1|| !((s.indexOf(this.dp,n+1)> -1||s.length-n>this.flc+1)&&n> -1)){if(n==0){n= -1;}else{for(n=(n== -1?s.length-1:n-1),m=1;n>=0;n--,m++){if(this.ts!=null&&m%4==0&& !(n==0&&s.charCodeAt(n)==45)){if(this.ts!=s.charAt(n)){break;}}else if((s.charCodeAt(n)<48||s.charCodeAt(n)>57)&& !(n==0&&this.n&&s.charCodeAt(n)==45)){break;}}}}}o=n== -1;}if(o&&this.tp!=3&&this.tp!=4&&this.tp!=5&&(this.nv!=null||this.xv!=null)){if(this.ts=='.'){s=v.replace(/\./g,'');}else if(this.ts==','){s=s.replace(/\,/g,'');}if(this.tp==1){s=parseInt(s,10);}else{if(this.dp==','){s=s.replace(/\,/g,'.');}s=parseFloat(s);}if((this.nv!=null&&s<this.nv)||(this.xv!=null&&s>this.xv)){o=false;}}}}else{o= !this.mnd;}return o;};LSD_TextControl.prototype.gpv=function(v){this.init();v=v.replace(/^\s+|\s+$/g,'');var s=null;if(v.length!=0){if(this.isv(v)){s=v;if(this.tp>0&&this.tp<3){if(this.ts=='.'){s=s.replace(/\./g,'');}else if(this.ts==','){s=s.replace(/\,/g,'');}try{if(s.length==0){s=parseInt('r');}else{if(this.tp==1){s=parseInt(s,10);}else{if(this.dp==','){s=s.replace(/\,/g,'.');}s=parseFloat(s);}}}catch(ex){s=parseInt('r');}}else{switch(this.tt){case 1:s=s.toUpperCase();break;case 2:s=s.toLowerCase();break;case 3:if(this.tp!=3&&this.tp!=5)s=s.replace(/\b([a-z])/g,function($0){return $0.toUpperCase();});break;}}}else{if(this.tp==0||this.tp==3||this.tp==4||this.tp==5){s=v;}else if(this.tp==1){s=parseInt(v,10);}else{s=parseFloat(v);}}}else{if(this.tp==0||this.tp==3||this.tp==4||this.tp==5){s='';}else{s=parseInt('r');}}return s;};LSD_TextControl.prototype.mv=function(v){this.init();if(this.tp==0||this.tp==3||this.tp==4||this.tp==5){return v;}var v=v.replace(/^\s+|\s+$/g,'');if(this.tp==1){var s=parseInt(v.substring(0,15),10),t='';if(isNaN(s)){v='';}else if(this.ts!=null){s=s.toString();for(var n=s.length-1,m=1;n>=0;n--,m++){if(m%4==0){if(s.charCodeAt(n)!=45){t+=this.ts;}m=1;}t+=s.charAt(n);}v='';for(n=t.length-1;n>=0;n--){v+=t.charAt(n);}}else{v=s;}}else{if(v==this.dp){v='';}if(this.dp==','){v=v.replace(/\./g,',');}else{v=v.replace(/\,/g,'.');}var n=v.indexOf(this.dp),nn=n;if(n==v.length-1&&v.length>0){n=nn= -1;v=v.substring(0,v.length-1);}if(n== -1&&v.length>16-this.flc){v=v.substring(0,16-this.flc);}if(n>16-this.flc){v='';}else{if(n==0){v='0'+v;nn= ++n;}if(this.dp==','){v=v.replace(/\,/g,'.');}var s=parseFloat(v),t='';if(isNaN(s)){v='';}else if(this.ts!=null){s=s.toString();n=nn=s.indexOf('.');for(n=(n== -1?s.length-1:n-1),m=1;n>=0;n--,m++){if(m%4==0){if(s.charCodeAt(n)!=45){t+=this.ts;}m=1;}t+=s.charAt(n);}v='';for(n=t.length-1;n>=0;n--){v+=t.charAt(n);}if(nn> -1){v+=this.dp;v+=s.substring(nn+1);}}else{v=s.toString();n=nn=v.indexOf('.');if(this.dp==','){v=v.replace(/\./g,',');}}if(v.length>0&&this.fz){var g;if(nn== -1){v+=this.dp;g=v.length+this.flc;}else{if(this.ts!=null){nn=v.indexOf(this.dp);}g=nn+1+this.flc;}while(v.length<g){v+='0';}}}}return v;};LSD_TextControl.prototype.tr=function(){this.init();this.tc.value=this.tc.value.replace(/^\s+|\s+$/g,'');};LSD_TextControl.prototype.fc=function(){this.init();if(this.tp!=0&&this.tp!=3&&this.tp!=4&&this.tp!=5&&this.ts!=null){if(this.ts=='.'){this.tc.value=this.tc.value.replace(/\./g,'');}else if(this.ts==','){this.tc.value=this.tc.value.replace(/\,/g,'');}this.tc.select();}};LSD_TextControl.prototype.br=function(){this.init();if(this.tp!=0&&this.tp!=3&&this.tp!=4&&this.tp!=5){var v='';if(this.ts=='.'){v=this.tc.value.replace(/\./g,'');}else if(this.ts==','){v=this.tc.value.replace(/\,/g,'');}else{v=this.tc.value;}this.tc.value=this.mv(v);}var pv=this.gpv(this.v);var b=this.isValid(false,false),f=this.v!=this.tc.value;this.v=this.tc.value;if(this.wc!=null){if(b){this.wc.style.display='none';}else{this.wc.style.display='block';this.wc.title=this.tc.value.length==0?this.emnd:this.ein;}}if(f){if(this.tc.value.length==0){if(this.ClientClearPostback!=null){this.ClientClearPostback();}else if(this.OnClientCleared!=null){this.OnClientCleared(this,pv,true,!this.mnd);}}else{if(this.ClientChangePostback!=null){this.ClientChangePostback();}else if(this.OnClientChanged!=null){this.OnClientChanged(this,pv,this.getValue(),true,b);}}}};LSD_TextControl.prototype.ku=function(e,o,on){this.init();if(this.xl>0&&this.tc.value.length>=this.xl){try{if(!this.kcu(e))on.focus();}catch(ex){}}};LSD_TextControl.prototype.kp=function(e,o){this.init();var c=new Object();c.c=0;if(this.kcp(e,c))return true;if((this.tp==2&&((this.tc.value.length>=16-this.flc&&this.tc.value.indexOf(this.dp)== -1&& !(c.c==44||c.c==46))||(this.ss()<=this.tc.value.indexOf(this.dp)&&this.tc.value.indexOf(this.dp)>=16-this.flc)||(c.c!=45&&this.ss()>this.tc.value.indexOf(this.dp)&&this.tc.value.indexOf(this.dp)> -1&&this.tc.value.length-this.tc.value.indexOf(this.dp)>this.flc)))||(this.tp==1&&this.tc.value.length>=15)||(this.xl>0&&this.tc.value.length>=this.xl))return false;if(this.tp!=0&&this.tp!=3&&this.tp!=4&&this.tp!=5){if(c.c==45){if(this.tc.value.indexOf('-')== -1&&this.n){this.tc.value='-'+this.tc.value;}return false;}else if(this.tp==2&&(c.c==44||c.c==46)){if(this.ss()>16-this.flc||this.tc.value.length-this.ss()>this.flc||this.tc.value.indexOf(this.dp)> -1){return false;}if(c.c==44&&this.dp=='.'){if(this.ie)e.keyCode=46;else{var n=this.tc.selectionStart;this.tc.value=this.tc.value.substring(0,n)+'.'+this.tc.value.substring(this.tc.selectionEnd,this.tc.value.length);this.tc.selectionStart=n+1;this.tc.selectionEnd=n+1;return false;}}else if(c.c==46&&this.dp==','){if(this.ie)e.keyCode=44;else{var n=this.tc.selectionStart;this.tc.value=this.tc.value.substring(0,n)+','+this.tc.value.substring(this.tc.selectionEnd,this.tc.value.length);this.tc.selectionStart=n+1;this.tc.selectionEnd=n+1;return false;}}return true;}return(this.tc.value.indexOf('-')== -1||this.ss()>0)&&(c.c>47&&c.c<58);}return true;};LSD_TextControl.prototype.kcu=function(e){this.init();var n=typeof e.keyCode=='undefined'?e.which:e.keyCode;var c=typeof e.charCode=='undefined'? -1:e.charCode;if(this.saf){return(c==0||n==8||n==9||n==13||n==27);}else{return(n==8||n==9||n==13||(n>15&&n<21)||n==27||(n>32&&n<41)||n==45||n==46||n==91||n==92||n==93||n==113||n==144);}return(c==0||n==8||n==9||n==13||(n>15&&n<21)||n==27||(n>32&&n<41)||n==45||n==46||n==91||n==92||n==93||n==113||n==144);};LSD_TextControl.prototype.kcp=function(e,ch){this.init();var n=typeof e.keyCode=='undefined'?e.which:e.keyCode;var c=typeof e.charCode=='undefined'? -1:e.charCode;if(this.ie){ch.c=n;return(n==27||n==13);}else if(this.op){ch.c=n;return(n==0||n==8||n==9||n==13||(n>15&&n<21)||n==27||(n>32&&n<41)||(n==45&& !this.n)||n==46||n==91||n==92||n==93||n==113||n==144);}else{ch.c=c;return(c==0||n==8||n==9);}};LSD_TextControl.prototype.ss=function(){this.init();if(this.ie){var v=this.tc.value;var r=document.selection.createRange();r.text='~';var n=this.tc.value.search('~');this.tc.value=v;r=this.tc.createTextRange();r.collapse(true);r.moveEnd('character',n);r.moveStart('character',n);r.select();return n;}else{return this.tc.selectionEnd;}};LSD_TextControl.prototype.dclup=function(){};LSD_TextControl.prototype.init=function(b){if(typeof b=='undefined')b=false;if(b){document.getElementById(this.id+'_hidden').value=document.getElementById(this.id+'_hiddenO').value;}var n=parseInt(document.getElementById(this.id+'_hidden').value,10);if((n&4)==0){this.tc=document.getElementById(this.id+'_txt');this.wc=document.getElementById(this.id+'_warning');this.cc=document.getElementById(this.id+'_clear');this.dcc=document.getElementById(this.id+'_disclr');this.hc=document.getElementById(this.id+'_hidden');this.e=(n&1)>0;this.chng=(n&2)>0;this.v=this.M=this.tc.value;this.hc.value=n|4;}};LSD_TextControl.prototype.frmrst=function(){if(this.M==null||this.M.length==0){this.clear(true,true,true);}else{this.setValue(this.M,true,true);}};
