
var Generate__UniqId_countWEbInput=0;function Generate__UniqIdWebInputUsage(){try{Generate__UniqId_countWEbInput++;if(Generate__UniqId_countWEbInput==NaN)
Generate__UniqId_countWEbInput=0;return Generate__UniqId_countWEbInput;}catch(ex){Generate__UniqId_countWEbInput=0;}}
function get_element_by___id(aElementId){var pElem=window[aElementId];if(!pElem){pElem=document.getElementById(aElementId);}
return pElem;}
function Add__EventListener(evname,el,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};function find_First_Child___by__tag_Name(aParent,aTagName){for(var i=0;i<aParent.childNodes.length;i++){if(aParent.childNodes.item(i).nodeName==aTagName){return aParent.childNodes.item(i);}}
return null;}
function GetControlLocation(element)
{var offsetX=0;var offsetY=0;var parent;for(parent=element;parent;parent=parent.offsetParent){if(parent.offsetLeft){offsetX+=parent.offsetLeft;}
if(parent.offsetTop){offsetY+=parent.offsetTop;}}
return{x:offsetX,y:offsetY};}
function GetControlBounds(element){var offset=GetControlLocation(element);var width=element.offsetWidth;var height=element.offsetHeight;return{x:offset.x,y:offset.y,width:width,height:height};}
function EnumPartsHelperWindow(aParentElem){var pThis=this;this.ownerMaskedEditObject=aParentElem;this.prevHintWindow=null;this._stopAutoIncDec=false;this._autoIncDecTimerId=-1;this.doIncDecEnumPart=function(aIsDec,aPos,aEnumObject,oTextNode){pThis._stopAutoIncDec=false;if(pThis._autoIncDecTimerId!=-1){window.clearTimeout(pThis._autoIncDecTimerId);pThis._autoIncDecTimerId=-1;}
if(aIsDec)
pThis.ownerMaskedEditObject.C1MaskedTextProvider_.doDecrementEnumerationPart(aPos);else
pThis.ownerMaskedEditObject.C1MaskedTextProvider_.doIncrementEnumerationPart(aPos);pThis._autoIncDecTimerId=window.setTimeout(function(){pThis.doIncDecEnumPart(aIsDec,aPos,aEnumObject,oTextNode);},400);oTextNode.nodeValue="..."+aEnumObject.currentDigitValue+"...";pThis.ownerMaskedEditObject.updateControlText(true);}
this.doStopIncDecEnumPart=function(){pThis._stopAutoIncDec=true;if(pThis._autoIncDecTimerId!=-1){window.clearTimeout(pThis._autoIncDecTimerId);pThis._autoIncDecTimerId=-1;}}
this.show=function(aEnumObject,aHideInterval){pThis.hide(aHideInterval);var aElement=document.createElement("div");aElement.onmousedown=function(){window.setTimeout(function(){window[pThis.ownerMaskedEditObject._cache_id]["elem"].focus();pThis.ownerMaskedEditObject.selectText(aEnumObject.beginIndex);},5);return false;};aElement.innerHTML="";aElement.style.fontSize="14px";aElement.style.backgroundColor="lightyellow";aElement.style.borderWidth="1px";aElement.style.padding="2px";aElement.style.borderStyle="solid";aElement.style.borderColor="black";aElement.style.position="absolute";var aControlBounds=GetControlBounds(window[this.ownerMaskedEditObject._cache_id]["elem"]);aElement.style.top=(aControlBounds.y+aControlBounds.height+2)+"px";aElement.style.left=(aControlBounds.x+aControlBounds.width/20)+"px";var arr=aEnumObject.GetArrayOfAvilableValues();var aCurIndex=aEnumObject.curValueIndex;if(aEnumObject.EnumPartType_==EnumPartType.Degit){var oTextNode=document.createTextNode("");oTextNode.nodeValue="..."+aEnumObject.currentDigitValue+"...";var aLink=document.createElement("a");aLink.beginIndex=aEnumObject.beginIndex;aLink.innerHTML="<font color=black><b><<</b></font>";aLink.href="javascript:void(0)";aLink.style.textDecoration="none";aLink.onmousedown=function(){window.setTimeout(function(){window[pThis.ownerMaskedEditObject._cache_id]["elem"].focus();},5);return false;};aLink.onmouseover=function(){pThis.doIncDecEnumPart(true,this.beginIndex,aEnumObject,oTextNode);return false;};aLink.onmouseout=function(){pThis.doStopIncDecEnumPart();return false;};aElement.appendChild(aLink);aLink=document.createElement("a");aLink.index=0;aLink.innerHTML="<font color=black>"+arr[0]+"</font>";aLink.href="javascript:void(0)";aLink.style.textDecoration="none";aLink.onmousedown=function(){pThis.ownerMaskedEditObject.C1MaskedTextProvider_.doSetEnumerationIndex(this.index,aEnumObject);pThis.ownerMaskedEditObject.updateControlText(true);window.setTimeout(function(){window[pThis.ownerMaskedEditObject._cache_id]["elem"].focus();},5);pThis.hide(1);return false;};aElement.appendChild(aLink);aElement.appendChild(oTextNode);aLink=document.createElement("a");aLink.index=1;aLink.innerHTML="<font color=black>"+arr[1]+"</font>";aLink.href="javascript:void(0)";aLink.style.textDecoration="none";aLink.onmousedown=function(){pThis.ownerMaskedEditObject.C1MaskedTextProvider_.doSetEnumerationIndex(this.index,aEnumObject);pThis.ownerMaskedEditObject.updateControlText(true);window.setTimeout(function(){window[pThis.ownerMaskedEditObject._cache_id]["elem"].focus();},5);pThis.hide(1);return false;};aElement.appendChild(aLink);aLink=document.createElement("a");aLink.beginIndex=aEnumObject.beginIndex;aLink.innerHTML="<font color=black><b>>></b></font>";aLink.href="javascript:void(0)";aLink.style.textDecoration="none";aLink.onmousedown=function(){window.setTimeout(function(){window[pThis.ownerMaskedEditObject._cache_id]["elem"].focus();},5);return false;};aLink.onmouseover=function(){pThis.doIncDecEnumPart(false,this.beginIndex,aEnumObject,oTextNode);return false;};aLink.onmouseout=function(){pThis.doStopIncDecEnumPart();return false;};aElement.appendChild(aLink);}else{for(var i=0;i<arr.length;i++){var aLink=document.createElement("a");aLink.index=i;if(aEnumObject.EnumPartType_==EnumPartType.Degit){aLink.innerHTML="<font color=black>"+arr[i]+"</font>";}else{if(i==aCurIndex){aLink.innerHTML="<font color=black><b>"+arr[i]+"</b></font>";}else{aLink.innerHTML="<font color=black>"+arr[i]+"</font>";}}
aLink.href="javascript:void(0)";aLink.style.textDecoration="none";aLink.onmousedown=function(){pThis.ownerMaskedEditObject.C1MaskedTextProvider_.doSetEnumerationIndex(this.index,aEnumObject);pThis.ownerMaskedEditObject.updateControlText(true);window.setTimeout(function(){window[pThis.ownerMaskedEditObject._cache_id]["elem"].focus();},5);pThis.hide(1);return false;};aElement.appendChild(aLink);if(aEnumObject.EnumPartType_==EnumPartType.Degit&&i==0){var oTextNode=document.createTextNode("...");aElement.appendChild(oTextNode);}else{var oTextNode=document.createTextNode(" ");aElement.appendChild(oTextNode);}}}
this.prevHintWindow=aElement;document.body.appendChild(aElement);}
this.hide=function(aHideInterval){if(aHideInterval==undefined)
aHideInterval=200;var aPrevWindow=pThis.prevHintWindow;pThis.prevHintWindow=null;window.setTimeout(function(){if(aPrevWindow!=null){pThis.doStopIncDecEnumPart();document.body.removeChild(aPrevWindow);aPrevWindow=null;}},aHideInterval);}}
function create__Delegate_CP(that,thatMethod){return function(){return thatMethod.apply(that,arguments);}}
function Add__EventListener(evname,el,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};function Remove__EventListener(evname,el,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};function C1MaskedEdit(idOrElem,Mask){var pThis=this;var id="";if((idOrElem instanceof String)||idOrElem.tagName==undefined||idOrElem.tagName.toLowerCase()!="input"){id=idOrElem;pThis.elem=get_element_by___id(id);}else{pThis.elem=idOrElem;if(idOrElem.id==undefined||idOrElem.id==""){idOrElem.id="temp_id_"+new Date().getTime()+Math.floor(Math.random()*(100000-1+1)+1);}
id=idOrElem.id;}
pThis.id=id;if(pThis.elem==null){window.status="C1WebInput initialization error";}
pThis._cache_id=pThis.id+"_HtmlElemsCache";window[pThis._cache_id]=new Object();window[pThis._cache_id]["elem"]=pThis.elem;window[pThis._cache_id]["elemTbl"]=get_element_by___id(id+"TBL");if(window[pThis._cache_id]["elemTbl"]==null){window[pThis._cache_id]["elemTbl"]=window[pThis._cache_id]["elem"];}
pThis.elem=null;idOrElem=null;var aElemViewState=get_element_by___id(id+"_ViewState");if(aElemViewState!=null){aElemViewState.value="-";}else{aElemViewState=new Object();aElemViewState.value="";}
window[pThis._cache_id]["ViewStateElem"]=aElemViewState;aElemViewState=null;pThis.C1MaskedTextProvider_=new C1MaskedTextProvider();pThis.C1MaskedTextProvider_._parentMaskEdit=pThis;pThis.isMaskNull=false;try{pThis.C1MaskedTextProvider_.constructor(Mask,false);}catch(e){pThis.isMaskNull=true;}
pThis.EnumPartsHelperWindow_=new EnumPartsHelperWindow(this);pThis.InvalidInputColor=null;pThis.isControlFocused=false;pThis.isInvalidInputColorShowing=false;pThis.isControlInitialized=false;this.toBool=function(value){value=""+value+"";if(value=="1"||value.toLowerCase()=="true"||value.toLowerCase()=="yes")
return true;return false;}
this.HidePromptOnLeaveValue=false;this.HideEnterValue=false;this.ShowHintForEnumPartsValue=true;this.CustomMaskHandler=null;this.UseSystemPasswordCharValue=false;this.OnClientBlur=null;this.OnClientFocus=null;this.OnClientInit=null;this.OnClientInvalidInput=null;this.OnClientTextChanged=null;this.OnClientDateChanged=null;this.OnClientKeyDown=null;this.OnClientKeyPress=null;this.OnClientKeyUp=null;this.OnClientMouseDown=null;this.OnClientMouseUp=null;this.OnClientMouseOver=null;this.OnClientMouseOut=null;this.OnClientCustomButtonClick=null;this.OnClientValueBoundsExceeded=null;this.set_OnClientBlur=function(value){pThis.OnClientBlur=value;}
this.get_OnClientBlur=function(){return pThis.OnClientBlur;}
this.set_OnClientFocus=function(value){pThis.OnClientFocus=value;}
this.get_OnClientFocus=function(){return pThis.OnClientFocus;}
this.__is___OnClientInit_Called=false;this.set_OnClientInit=function(value){pThis.OnClientInit=value;if(pThis.__is___OnClientInit_Called==false&&pThis.isControlInitialized==true){pThis.__is___OnClientInit_Called=true;pThis.doClientEvent("OnClientInit");}}
this.get_OnClientInit=function(){return pThis.OnClientInit;}
this.set_OnClientInvalidInput=function(value){pThis.OnClientInvalidInput=value;}
this.get_OnClientInvalidInput=function(){return pThis.OnClientInvalidInput;}
this.set_OnClientTextChanged=function(value){pThis.OnClientTextChanged=value;}
this.get_OnClientTextChanged=function(){return pThis.OnClientTextChanged;}
this.set_OnClientDateChanged=this.set_onClientDateChanged=function(value){pThis.OnClientDateChanged=value;}
this.get_OnClientDateChanged=this.get_onClientDateChanged=function(){return pThis.OnClientDateChanged;}
this.set_OnClientKeyDown=function(value){pThis.OnClientKeyDown=value;}
this.get_OnClientKeyDown=function(){return pThis.OnClientKeyDown;}
this.set_OnClientKeyPress=function(value){pThis.OnClientKeyPress=value;}
this.get_OnClientKeyPress=function(){return pThis.OnClientKeyPress;}
this.set_OnClientKeyUp=function(value){pThis.OnClientKeyUp=value;}
this.get_OnClientKeyUp=function(){return pThis.OnClientKeyUp;}
this.set_OnClientMouseDown=function(value){pThis.OnClientMouseDown=value;}
this.get_OnClientMouseDown=function(){return pThis.OnClientMouseDown;}
this.set_OnClientMouseUp=function(value){pThis.OnClientMouseUp=value;}
this.get_OnClientMouseUp=function(){return pThis.OnClientMouseUp;}
this.set_OnClientMouseOver=function(value){pThis.OnClientMouseOver=value;}
this.get_OnClientMouseOver=function(){return pThis.OnClientMouseOver;}
this.set_OnClientMouseOut=function(value){pThis.OnClientMouseOut=value;}
this.get_OnClientMouseOut=function(){return pThis.OnClientMouseOut;}
this.set_OnClientCustomButtonClick=function(value){pThis.OnClientCustomButtonClick=value;}
this.get_OnClientCustomButtonClick=function(){return pThis.OnClientCustomButtonClick;}
this.set_OnClientValueBoundsExceeded=this.set_onClientValueBoundsExceeded=function(value){pThis.OnClientValueBoundsExceeded=value;}
this.get_OnClientValueBoundsExceeded=this.get_onClientValueBoundsExceeded=function(){return pThis.OnClientValueBoundsExceeded;}
pThis.doClientEvent=function(value,aArrayOfAdditionalParams){if(aArrayOfAdditionalParams==undefined)
aArrayOfAdditionalParams=new Array();if(value.indexOf("On")!=0){value=+"On"+value;}
if(pThis[value]instanceof Function){pThis[value](pThis,aArrayOfAdditionalParams.length>0?aArrayOfAdditionalParams[0]:null,aArrayOfAdditionalParams.length>1?aArrayOfAdditionalParams[1]:null);return true;}
if(pThis[value]==undefined||pThis[value]==null||pThis[value]==""){return false;}
try{window.c1_temp_ref__=pThis;window.c1_temp_refArr__=aArrayOfAdditionalParams;var s=pThis[value]+'(window.c1_temp_ref__';for(var i=0;i<aArrayOfAdditionalParams.length;i++){s+=', window.c1_temp_refArr__['+i+']';}
s+=');';eval(s);return true;}catch(e){return false;}}
this.get_ToolTip=function(){return window[pThis._cache_id]["elem"].title;}
this.set_ToolTip=function(value){window[pThis._cache_id]["elem"].title=value;pThis.putPostDataValue("ToolTip",value,(value==null||value==""));}
this.get_BackColor=function(){return window[pThis._cache_id]["elem"].style.backgroundColor;}
this.set_BackColor=function(value){try{window[pThis._cache_id]["elem"].style.backgroundColor=value;window[pThis._cache_id]["elemTbl"].style.backgroundColor=value;pThis.putPostDataValue("BackColor",value,(value==null||value==""));}catch(ex){return false;}
return true;}
this.get_BorderColor=function(){return window[pThis._cache_id]["elemTbl"].style.borderColor;}
this.set_BorderColor=function(value){try{window[pThis._cache_id]["elemTbl"].style.borderColor=value;pThis.putPostDataValue("BorderColor",value,(value==null||value==""));}catch(ex){return false;}
return true;}
this.get_BorderStyle=function(){return window[pThis._cache_id]["elemTbl"].style.borderStyle;}
this.set_BorderStyle=function(value){try{window[pThis._cache_id]["elemTbl"].style.borderStyle=value;pThis.putPostDataValue("BorderStyle",value,(value==null||value==""));}catch(ex){return false;}
return true;}
this.get_BorderWidth=function(){var aResult=window[pThis._cache_id]["elemTbl"].style.borderWidth;aResult=aResult.replace(/[p]/,"");aResult=aResult.replace(/[x]/,"");return aResult;}
this.set_BorderWidth=function(value){try{value=""+value+"";value=value.replace(/[p]/,"");value=value.replace(/[x]/,"");window[pThis._cache_id]["elemTbl"].style.borderWidth=value+"px";pThis.putPostDataValue("BorderWidth",value,(value==null||value==""));}catch(ex){return false;}
return true;}
this.get_CellSpacing=function(){return window[pThis._cache_id]["elemTbl"].cellSpacing;}
this.set_CellSpacing=function(value){try{window[pThis._cache_id]["elemTbl"].cellSpacing=value;pThis.putPostDataValue("CellSpacing",value,(value==null||value==""));}catch(ex){return false;}
return true;}
this.get_CssClass=function(){return window[pThis._cache_id]["elemTbl"].className;}
this.set_CssClass=function(value){try{window[pThis._cache_id]["elemTbl"].className=value;window[pThis._cache_id]["elem"].className=value;pThis.putPostDataValue("CssClass",value,false);}catch(ex){return false;}
return true;}
this.get_ForeColor=function(){return window[pThis._cache_id]["elem"].style.color;}
this.set_ForeColor=function(value){try{window[pThis._cache_id]["elem"].style.color=value;pThis.putPostDataValue("ForeColor",value,(value==null||value==""));}catch(ex){return false;}
return true;}
this.get_TextAlign=function(){return window[pThis._cache_id]["elem"].style.textAlign;}
this.set_TextAlign=function(value){try{pThis.putPostDataValue("TextAlign",value,(value==null||value==""));window[pThis._cache_id]["elem"].style.textAlign=value;return true;}catch(ex){return false;}}
this.set_AllowPromptAsInput=function(value){pThis.C1MaskedTextProvider_.AllowPromptAsInput=pThis.toBool(value);pThis.putPostDataValue("AllowPromptAsInput",value,(value==null||value==""));}
this.get_AllowPromptAsInput=function(){return pThis.C1MaskedTextProvider_.AllowPromptAsInput;}
this.set_Culture=function(aCulture){pThis.C1MaskedTextProvider_.set_CultureInfo(aCulture);pThis.updateControlText(false);}
this.get_Culture=function(){return pThis.C1MaskedTextProvider_.get_CultureInfo();}
this.set_CustomMaskedTextProvider=function(aCustomMaskedTextProvider){pThis.C1MaskedTextProvider_=aCustomMaskedTextProvider;pThis.C1MaskedTextProvider_._parentMaskEdit=pThis;pThis.C1MaskedTextProvider_.Initialize();pThis.updateControlText(false);}
this.get_CustomMaskedTextProvider=function(){return pThis.C1MaskedTextProvider_;}
this.set_HideEnter=function(value){pThis.HideEnterValue=pThis.toBool(value);pThis.putPostDataValue("HideEnter",value,(value==null||value==""));}
this.get_HideEnter=function(){return pThis.HideEnterValue;}
this.set_HidePromptOnLeave=function(value){if(pThis.HidePromptOnLeaveValue!=value){pThis.HidePromptOnLeaveValue=pThis.toBool(value);pThis.updateControlText(false);pThis.putPostDataValue("HidePromptOnLeave",value,(value==null||value==""));}}
this.get_HidePromptOnLeave=function(){return pThis.HidePromptOnLeaveValue;}
this.set_InvalidInputColor=function(value){pThis.InvalidInputColor=value;pThis.putPostDataValue("InvalidInputColor",value,(value==null||value==""));}
this.get_InvalidInputColor=function(){return pThis.InvalidInputColor;}
this.set_IsPassword=function(value){pThis.C1MaskedTextProvider_.IsPassword=pThis.toBool(value);pThis.updateControlText(false);pThis.putPostDataValue("IsPassword",value,(value==null||value==""));}
this.get_IsPassword=function(){return pThis.C1MaskedTextProvider_.IsPassword;}
this.set_mask=this.set_Mask=function(value){if(value==undefined||value.length<=0)
{pThis.isMaskNull=true;return;}else{pThis.isMaskNull=false;}
if(!pThis.IsInitialized())
return;var aText=pThis.get_Text();pThis.C1MaskedTextProvider_.mask=value;pThis.C1MaskedTextProvider_.initialMask=value;pThis.C1MaskedTextProvider_.Initialize();pThis.C1MaskedTextProvider_.Set(aText);pThis.updateControlText(false);pThis.putPostDataValue("Mask",value,(value==null||value==""));}
this.get_Mask=function(value){return pThis.C1MaskedTextProvider_.initialMask;}
this.set_PasswordChar=function(value){if((value+"").length>0){pThis.set_IsPassword(true);}else{pThis.set_IsPassword(false);}
value=value+" ";pThis.C1MaskedTextProvider_.PasswordChar=value.charAt(0);pThis.updateControlText(false);pThis.putPostDataValue("PasswordChar",value,(value==null||value==""));}
this.get_PasswordChar=function(){if(!pThis.IsInitialized()){return"_";}
return pThis.C1MaskedTextProvider_.PasswordChar;}
this.set_UseSystemPasswordChar=function(value){pThis.UseSystemPasswordCharValue=value;}
this.get_UseSystemPasswordChar=function(){return pThis.UseSystemPasswordCharValue;}
this.set_PromptChar=function(value){value=value+" ";if(!pThis.IsInitialized()){return false;}
pThis.C1MaskedTextProvider_.set_PromptChar(value.charAt(0));pThis.updateControlText(false);pThis.putPostDataValue("PromptChar",value,(value==null||value==""));}
this.get_PromptChar=function(){return pThis.C1MaskedTextProvider_.PromptChar;}
this.set_ResetOnPrompt=function(value){pThis.C1MaskedTextProvider_.ResetOnPrompt=pThis.toBool(value);pThis.updateControlText(false);pThis.putPostDataValue("ResetOnPrompt",value,(value==null||value==""));}
this.get_ResetOnPrompt=function(){return pThis.C1MaskedTextProvider_.ResetOnPrompt;}
this.set_ResetOnSpace=function(value){pThis.C1MaskedTextProvider_.ResetOnSpace=pThis.toBool(value);pThis.putPostDataValue("ResetOnSpace",value,(value==null||value==""));}
this.get_ResetOnSpace=function(){return pThis.C1MaskedTextProvider_.ResetOnSpace;}
this.set_ShowHintForEnumParts=function(value){pThis.ShowHintForEnumPartsValue=pThis.toBool(value);pThis.putPostDataValue("ShowHintForEnumParts",value,(value==null||value==""));}
this.get_ShowHintForEnumParts=function(){return pThis.ShowHintForEnumPartsValue;}
this.set_SkipLiterals=function(value){pThis.C1MaskedTextProvider_.SkipLiterals=pThis.toBool(value);pThis.putPostDataValue("SkipLiterals",value,(value==null||value==""));}
this.get_SkipLiterals=function(){return pThis.C1MaskedTextProvider_.SkipLiterals;}
this.set_Text=function(value){if(!pThis.IsInitialized()){window[pThis._cache_id]["elem"].value=value;pThis.updatePostData();return;}
pThis.C1MaskedTextProvider_.Set(value);pThis.updateControlText(false);}
this.get_Text=function(){if(!pThis.IsInitialized())
return window[pThis._cache_id]["elem"].value;return pThis.C1MaskedTextProvider_.ToString(true,false,false);}
this.get_TextWithPrompts=function(){if(!pThis.IsInitialized())
return window[pThis._cache_id]["elem"].value;return pThis.C1MaskedTextProvider_.ToString(true,true,false);}
this.get_TextWithLiterals=function(){if(!pThis.IsInitialized())
return window[pThis._cache_id]["elem"].value;return pThis.C1MaskedTextProvider_.ToString(true,false,true);}
this.get_TextWithPromptAndLiterals=function(){if(!pThis.IsInitialized())
return window[pThis._cache_id]["elem"].value;return pThis.C1MaskedTextProvider_.ToString(true,true,true);}
this.set_smartInputMode=this.set_SmartInputMode=function(bVal){try{pThis._smartInputMode=bVal;pThis.putPostDataValue("SmartInputMode",bVal);}catch(ex){}}
this.get_smartInputMode=this.get_SmartInputMode=function(){try{return pThis._smartInputMode;}catch(ex){return false;}}
this.set_startYear=this.set_StartYear=function(aVal){try{pThis._startYear=aVal;pThis.putPostDataValue("StartYear",aVal);}catch(ex){}}
this.get_startYear=this.get_StartYear=function(){return pThis._startYear;}
this.set_nullText=this.set_NullText=function(aVal){try{pThis._nullText=aVal;pThis.putPostDataValue("NullText",aVal);pThis.updateControlText(false);}catch(ex){}}
this.get_nullText=this.get_NullText=function(){return pThis._nullText;}
this.set_showNullText=this.set_ShowNullText=function(aVal){try{if(aVal==true){pThis.HidePromptOnLeaveValue=true;}
pThis._showNullText=aVal;pThis.putPostDataValue("ShowNullText",aVal);pThis.updateControlText(false);}catch(ex){}}
this.get_showNullText=this.get_ShowNullText=function(){return pThis._showNullText;}
this.isDateNull=this.isDateNull=function(){try{return pThis.C1MaskedTextProvider_.isDateNull();}catch(ex){}}
this.isValueNull=function(){try{return pThis.C1MaskedTextProvider_.isValueNull();}catch(ex){}}
this.get_Value=this.get_value=function(){try{return pThis.C1MaskedTextProvider_.get_Value();}catch(ex){return pThis.get_Text();}}
this.set_Value=this.set_value=function(aValue){try{pThis.C1MaskedTextProvider_.set_Value(aValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.get_MinValue=function(){try{return pThis.C1MaskedTextProvider_.get_MinValue();}catch(ex){return null;}}
this.set_MinValue=function(aValue){try{pThis.C1MaskedTextProvider_.set_MinValue(aValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.get_MaxValue=function(){try{return pThis.C1MaskedTextProvider_.get_MaxValue();}catch(ex){return null;}}
this.set_MaxValue=function(aValue){try{pThis.C1MaskedTextProvider_.set_MaxValue(aValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.get_ThousandsSeparator=function(){try{return pThis.C1MaskedTextProvider_.get_ThousandsSeparator();}catch(ex){return null;}}
this.set_ThousandsSeparator=function(aBoolValue){try{pThis.C1MaskedTextProvider_.set_ThousandsSeparator(aBoolValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.get_DecimalPlaces=function(){try{return pThis.C1MaskedTextProvider_.get_DecimalPlaces();}catch(ex){return null;}}
this.set_DecimalPlaces=function(aValue){try{pThis.C1MaskedTextProvider_.set_DecimalPlaces(aValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.get_date=this.get_Date=function(){try{return pThis.C1MaskedTextProvider_.get_Date();}catch(ex){return null;}}
this.set_date=this.set_Date=function(aValue){try{pThis.C1MaskedTextProvider_.set_Date(aValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.get_DateFormat=function(){try{return pThis.C1MaskedTextProvider_.get_DateFormat();}catch(ex){return null;}}
this.set_DateFormat=function(aValue){try{pThis.C1MaskedTextProvider_.set_DateFormat(aValue);pThis.updateControlText(false);return true;}catch(ex){return false;}}
this.eventsAlreadyAdded=false;this._controlBoundsRepaired=false;this.IsInitialized=function(){if(pThis._controlBoundsRepaired!=true){pThis._controlBoundsRepaired=true;var tbl=get_element_by___id(pThis.id+"TBL");var el=get_element_by___id(pThis.id);var aTdTagU;var aTdTagD;var aTdTagC;if(tbl!=null&&el!=null){try{aTdTagU=get_element_by___id(pThis.id+"_sbu_td");aTdTagD=get_element_by___id(pThis.id+"_sbd_td");aTdTagC=get_element_by___id(pThis.id+"_cb_td");if(aTdTagU!=null&&aTdTagD!=null){if(aTdTagU.style!=null)
aTdTagU.style.width="16px";if(aTdTagD.style!=null)
aTdTagD.style.width="16px";}
if(aTdTagC!=null){var aTblRightX=tbl.offsetLeft+tbl.offsetWidth;var aBtnRightX=aTdTagC.offsetLeft+aTdTagC.offsetWidth;if(aTdTagC.style!=null)
aTdTagC.style.width="16px";}
el.style.width="100%";}catch(ex){}}
tbl=null;el=null;aTdTagU=null;aTdTagD=null;aTdTagC=null;}
if(pThis.eventsAlreadyAdded==false){pThis.eventsAlreadyAdded=true;Add__EventListener("keypress",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.dokeypress(e);}));Add__EventListener("keydown",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.dokeydown(e);}));Add__EventListener("keyup",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.dokeyup(e);}));Add__EventListener("focus",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.dofocus(e);}));Add__EventListener("blur",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.doblur(e);}));Add__EventListener("mouseup",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.doonmouseup(e);}));Add__EventListener("mousedown",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.doonmousedown(e);}));Add__EventListener("mouseover",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.doonmouseover(e);}));Add__EventListener("mouseout",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.doonmouseout(e);}));Add__EventListener("change",window[pThis._cache_id]["elem"],create__Delegate_CP(pThis,function(e){this.doonchange(e);}));window[pThis._cache_id]["elem"].onpropertychange=this.doonpropertychange;}
if(pThis.isControlInitialized==true){return!pThis.isMaskNull;}
if(pThis.isMaskNull==true)
return false;window[pThis._cache_id]["elem"].onbeforepaste=create__Delegate_CP(pThis,function(e){this.dobeforepaste(e);});window[pThis._cache_id]["elem"].onpaste=create__Delegate_CP(pThis,function(e){this.dopaste(e);});pThis.isControlInitialized=true;pThis.updateControlText();pThis.doClientEvent("OnClientInit");return true;}
this._prev_doonpropertychange=-1;this.doonpropertychange=function(){if(window.event!=null&&window.event.propertyName!=null){if(event.propertyName=="value"&&pThis.isControlFocused==false){var aCurDtMs=new Date().getTime();if(pThis._prev_doonpropertychange==-1){pThis._prev_doonpropertychange=aCurDtMs;}
if((pThis._prev_doonpropertychange+1000)<aCurDtMs){pThis._prev_doonpropertychange=aCurDtMs;pThis.doonchange();}}}}
this.additionalPostData="";this.putPostDataValue=function(aKey,aValue,aNeedRemoveKey){if(aNeedRemoveKey!=undefined&&aNeedRemoveKey==true){}
aValue=escape(""+aValue+"");pThis.additionalPostData+="|="+aKey+"|="+aValue;pThis.updatePostData();}
this.updatePostData=function(){if(pThis.isControlInitialized==false){window[pThis._cache_id]["ViewStateElem"].value="Text|="+escape(window[pThis._cache_id]["elem"].value);return;}
window[pThis._cache_id]["ViewStateElem"].value=pThis.C1MaskedTextProvider_.get_PostDataString()+pThis.additionalPostData;}
this.getInputElement=function(){return window[pThis._cache_id]["elem"];}
this.__updateControlText__prevTextValue__="";this.__updateControlText__prevDateValue__=null;this.updateControlText=function(aNeedToRestoreSelection,aCalledOnBlur){if(!pThis.IsInitialized())
return false;if(aNeedToRestoreSelection==undefined||aNeedToRestoreSelection==null||aNeedToRestoreSelection==false){window[pThis._cache_id]["elem"].value=pThis.C1MaskedTextProvider_.ToString(!pThis.get_IsPassword(),pThis.HidePromptOnLeaveValue==true?pThis.isControlFocused:true,true);}else{var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();window[pThis._cache_id]["elem"].value=pThis.C1MaskedTextProvider_.ToString(!pThis.get_IsPassword(),pThis.HidePromptOnLeaveValue==true?pThis.isControlFocused:true,true);if(window[pThis._cache_id]["elem"].disabled)
return;pThis.selectText(sel.start,sel.end);prevUpDownPos=sel.start;}
var aCurValue=pThis.C1MaskedTextProvider_.ToString(true,true,true);if(pThis.__updateControlText__prevTextValue__!=aCurValue){pThis.doClientEvent("OnClientTextChanged");pThis.__updateControlText__prevTextValue__=aCurValue;}
if(pThis.C1MaskedTextProvider_.get_date!=undefined){var aDtToCmp=pThis.C1MaskedTextProvider_.get_date();if(aDtToCmp instanceof Date){aDtToCmp=aDtToCmp.getTime();}
if(pThis.__updateControlText__prevDateValue__!=null&&pThis.__updateControlText__prevDateValue__!=aDtToCmp){pThis._raiseOnClientDateChanged();}
pThis.__updateControlText__prevDateValue__=aDtToCmp;}
if(pThis.C1MaskedTextProvider_.checkAndRepairBounds!=undefined){if(!pThis.C1MaskedTextProvider_.checkAndRepairBounds(false)){pThis.doClientEvent("OnClientValueBoundsExceeded");}}
pThis.updatePostData();}
this.selectText=function(begIndex,endIndex){if(window[pThis._cache_id]["elem"].disabled)
return;if(begIndex==undefined){begIndex=0;endIndex=window[pThis._cache_id]["elem"].value.length;}else if(endIndex==undefined){endIndex=begIndex;}
var selection=new Selection(window[pThis._cache_id]["elem"]);selection.setSelectionRange(begIndex,endIndex);}
this.deleteSelectedText=function(deleteByBackSpace){var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();sel.end=sel.end-1;if(sel.end<sel.start)
sel.end=sel.start;if(deleteByBackSpace!=undefined&&deleteByBackSpace==true&&sel.end==sel.start){if(sel.end>=1){sel.end=sel.end-1;sel.start=sel.start-1;}else{return;}}
var resultHint1=new MaskedTextResultHint();var aResult1=pThis.C1MaskedTextProvider_.RemoveAt(sel.start,sel.end,resultHint1);pThis.updateControlText();pThis.selectText(resultHint1.testPosition);}
this.fireIvalidInputEvent=function(resultHint){pThis.doClientEvent("OnClientInvalidInput");if(pThis.isInvalidInputColorShowing==false){if(pThis.InvalidInputColor!=undefined&&pThis.InvalidInputColor!=""){pThis.isInvalidInputColorShowing=true;var aPrevColor=window[pThis._cache_id]["elem"].style.color;setTimeout(function(){window[pThis._cache_id]["elem"].style.color=aPrevColor;pThis.isInvalidInputColorShowing=false;},100);try{window[pThis._cache_id]["elem"].style.color=pThis.InvalidInputColor;}catch(e){pThis.InvalidInputColor="";}}}}
this.isAllowEditControlValueByUser=function(){if((window[pThis._cache_id]["elem"].readOnly)||(window[pThis._cache_id]["elem"].disabled)){return false;}
return true;}
this.showEnumHintIfNeeded=function(aIndex){if(pThis.ShowHintForEnumPartsValue==false||pThis.C1MaskedTextProvider_.get_HaveEnumParts()==false)
return false;var aEnumObject=pThis.C1MaskedTextProvider_.Get_EnumPartObjectForPosition(aIndex);if(aEnumObject!=null){if(!pThis.isAllowEditControlValueByUser()){return false;}
if(aEnumObject.EnumPartType_!=EnumPartType.Degit){pThis.EnumPartsHelperWindow_.show(aEnumObject,1);}else{pThis.EnumPartsHelperWindow_.show(aEnumObject,1);}}else{pThis.doHideEnumarationsHint(1);}}
this.doHideEnumarationsHint=function(aHideInterval){if(aHideInterval==undefined)
aHideInterval=300;pThis.EnumPartsHelperWindow_.hide(aHideInterval);}
this.selectEditablePart=function(){return false;}
this.doonmousedown=function(e){var e=e||window.event;pThis.doClientEvent("OnClientMouseDown",new Array(e));return true;}
this.doonmouseup=function(e){var e=e||window.event;if(pThis.isControlInitialized==false)
return;pThis.doClientEvent("OnClientMouseUp",new Array(e));if(window[pThis._cache_id]["elem"].disabled)
return true;var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();pThis.showEnumHintIfNeeded(sel.start);pThis.selectEditablePart();prevUpDownPos=sel.start;return false;}
this.doonmouseover=function(e){var e=e||window.event;pThis.doClientEvent("OnClientMouseOver",new Array(e));pThis.doStopUpDownButton();return true;}
this.doonmouseout=function(e){var e=e||window.event;pThis.doClientEvent("OnClientMouseOut",new Array(e));pThis.doStopUpDownButton();return true;}
this.doonchange=function(){if(pThis._cache_id==null||window[pThis._cache_id]==null||window[pThis._cache_id]["elem"]==null){return false;}
var sVal=window[pThis._cache_id]["elem"].value;var sText=pThis.get_Text();if(sText!=sVal){sText=pThis.get_TextWithPrompts();if(sText!=sVal){sText=pThis.get_TextWithPromptAndLiterals();if(sText!=sVal){pThis.set_Text(sVal);return sText!=pThis.get_TextWithPromptAndLiterals();}}}
return false;}
this.tagwait_need_blur=false;this._focusNotCalledFirstTime=0;this.dofocus=function(e){if(pThis.breakRepeatingUpDownButtons==false){if(pThis.isControlFocused!=true){pThis.isControlFocused=true;pThis.doClientEvent("OnClientFocus");}
return;}
if(pThis.isControlInitialized==false)
return;pThis.tagwait_need_blur=false;if(!pThis.isAllowEditControlValueByUser()){return false;}
if(pThis._focusNotCalledFirstTime==0){pThis._focusNotCalledFirstTime=new Date().getTime();}
if(pThis.isControlFocused!=true){pThis.isControlFocused=true;window.setTimeout(function(){if(pThis.isControlFocused==true){pThis.doClientEvent("OnClientFocus");}},50);if(pThis.HidePromptOnLeaveValue==true){pThis.updateControlText();if(pThis.selectEditablePart()!=true){var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();pThis.selectText(sel.start);}}}
return true;}
this.doblur=function(e){pThis.doHideEnumarationsHint();if(pThis.breakRepeatingUpDownButtons==false){window[pThis._cache_id]["elem"].focus();if(prevUpDownPos!=-1)
pThis.selectText(prevUpDownPos);return;}
if(pThis.isControlInitialized==false)
return;if(pThis.isControlFocused==false)
return true;pThis.tagwait_need_blur=true;window.setTimeout(function(){if(pThis.tagwait_need_blur!=true)
return;pThis.tagwait_need_blur=false;pThis.isControlFocused=false;if(pThis.C1MaskedTextProvider_.checkAndRepairBounds!=undefined){if(!pThis.C1MaskedTextProvider_.checkAndRepairBounds(true)){pThis.updateControlText();}}
pThis.doonchange();pThis.updateControlText(null,true);window.setTimeout(function(){if(pThis.isControlFocused==false)
pThis.doClientEvent("OnClientBlur");},50);},100);return true;}
var prevUpDownPos=-1;this.doUpButton=function(aNeedRepeating){if(!pThis.isAllowEditControlValueByUser()){return;}
if(aNeedRepeating==undefined)
aNeedRepeating=false;if(aNeedRepeating&&pThis.breakRepeatingUpDownButtons==true)
return;var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();var resultHint=new MaskedTextResultHint();if(pThis._focusNotCalledFirstTime!=-9&&(new Date().getTime()-pThis._focusNotCalledFirstTime)<600){pThis._focusNotCalledFirstTime=-9;prevUpDownPos=0;}
if(prevUpDownPos==-1){prevUpDownPos=sel.start;}else{sel.start=prevUpDownPos;}
resultHint.testPosition=sel.start;pThis.C1MaskedTextProvider_.doIncrementEnumerationPart(sel.start,resultHint);pThis.updateControlText();prevUpDownPos=resultHint.testPosition;pThis.selectText(resultHint.testPosition);pThis.selectEditablePart();if(aNeedRepeating&&pThis.breakRepeatingUpDownButtons!=true){var aInterval=pThis.calculateUpDownButtonsRepeatingInterval();window.setTimeout(function(){pThis.doUpButton(true);},aInterval);}}
this.doDownButton=function(aNeedRepeating){if(!pThis.isAllowEditControlValueByUser()){return;}
if(aNeedRepeating==undefined)
aNeedRepeating=false;if(aNeedRepeating&&pThis.breakRepeatingUpDownButtons==true)
return;var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();var resultHint=new MaskedTextResultHint();if(prevUpDownPos==-1){prevUpDownPos=sel.start;}else{sel.start=prevUpDownPos;}
resultHint.testPosition=sel.start;pThis.C1MaskedTextProvider_.doDecrementEnumerationPart(sel.start,resultHint);pThis.updateControlText();prevUpDownPos=resultHint.testPosition;pThis.selectText(resultHint.testPosition);pThis.selectEditablePart();if(aNeedRepeating&&pThis.breakRepeatingUpDownButtons!=true){var aInterval=pThis.calculateUpDownButtonsRepeatingInterval();window.setTimeout(function(){pThis.doDownButton(true);},aInterval);}}
this.calculateUpDownButtonsRepeatingInterval=function(){var aInterval=400;pThis.repeatingUpDownCount++;if(pThis.repeatingUpDownCount>10)
aInterval=50;else if(pThis.repeatingUpDownCount>4)
aInterval=100;else if(pThis.repeatingUpDownCount>2)
aInterval=200;return aInterval;}
this.breakRepeatingUpDownButtons=true;this.repeatingUpDownCount=0;this.doStopUpDownButton=function(){pThis.breakRepeatingUpDownButtons=true;pThis.repeatingUpDownCount=0;}
this.dobeforepaste=function(){var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();pThis.beforePasteSelection=sel;pThis.beforePasteSelection.controlValueLength_=window[pThis._cache_id]["elem"].value.length;}
this.dopaste=function(){window.setTimeout(function(){if(!pThis.doonchange()){}},1);}
this.dokeyup=function(e){var e=e||window.event;var k=e.which||e.keyCode;pThis.doClientEvent("OnClientKeyUp",new Array(k,e));if(!pThis.IsInitialized()){pThis.updatePostData();return;}
if(k==27&&this._prevDownKeyCode==k){pThis.doonchange();}
var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();pThis.showEnumHintIfNeeded(sel.start);pThis.cancelBrowserResponseOnEvent(e);return false;}
this.dokeypress=function(e){prevUpDownPos=-1;var e=e||window.event;var k=e.which||e.keyCode;if(pThis.isControlInitialized==false)
return;pThis.doClientEvent("OnClientKeyPress",new Array(k,e));if(e.ctrlKey){switch(k){case 118:pThis.dopaste();return;default:}}
if(e.ctrlKey||e.altKey){return;}
switch(k){case 112:case 113:case 114:case 115:case 116:case 117:if(this._prevDownKeyCode==k){return;}else{break;}
case 13:if(!pThis.HideEnterValue)
return;break;case 8:case 18:case 9:case 35:case 36:case 37:case 38:case 39:case 40:if(this._prevDownKeyCode==k){return;}else{break;}
case 46:case 27:if(this._prevDownKeyCode==k){pThis.cancelBrowserResponseOnEvent(e);return false;}else{break;}
case 16:return;}
if(!pThis.isAllowEditControlValueByUser()){return false;}
var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();var chValue=String.fromCharCode(k);if(sel.start<sel.end){var resultHint1=new MaskedTextResultHint();var aResult1=pThis.C1MaskedTextProvider_.RemoveAt(sel.start,sel.end-1,resultHint1);}
pThis.showEnumHintIfNeeded(sel.start);var resultHint=new MaskedTextResultHint();var aOperationResult=pThis.C1MaskedTextProvider_.InsertAt(chValue,sel.start,resultHint);if(aOperationResult){pThis.updateControlText();pThis.selectText(resultHint.testPosition+1);}else{pThis.fireIvalidInputEvent(resultHint);}
pThis.cancelBrowserResponseOnEvent(e);return false;}
this._prevDownKeyCode=-1;this.dokeydown=function(e){prevUpDownPos=-1;var e=e||window.event;var k=e.which||e.keyCode;this._prevDownKeyCode=k;if(pThis.isControlInitialized==false)
return;pThis.doClientEvent("OnClientKeyDown",new Array(k,e));if(e.ctrlKey){switch(k){case 45:case 67:return true;case 86:pThis.dobeforepaste();return;default:}}
if((e.ctrlKey||e.altKey)){return false;}
switch(k){case 112:case 113:case 114:case 115:case 116:case 117:return;case 9:case 20:case 35:case 36:case 17:break;case 37:if(!e.shiftKey){var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();pThis.showEnumHintIfNeeded(sel.start-1);}
return;case 39:if(!e.shiftKey){var selection=new Selection(window[pThis._cache_id]["elem"]);var sel=selection.create();pThis.showEnumHintIfNeeded(sel.start+1);}
return;case 8:pThis.deleteSelectedText(true);pThis.cancelBrowserResponseOnEvent(e);return;case 46:pThis.deleteSelectedText();pThis.cancelBrowserResponseOnEvent(e);return false;case 38:pThis.doUpButton();pThis.cancelBrowserResponseOnEvent(e);return false;case 40:pThis.doDownButton();pThis.cancelBrowserResponseOnEvent(e);return false;case 13:if(!pThis.HideEnterValue)
return;case 33:case 34:case 27:case 18:pThis.cancelBrowserResponseOnEvent(e);return false;case 16:return;}}
this.cancelBrowserResponseOnEvent=function(e)
{if(e==null)
e=window.event;if(e==null)
return false;if(e.stopPropagation!=null)e.stopPropagation();if(e.preventDefault!=null)e.preventDefault();e.cancelBubble=true;e.returnValue=false;return false;}
this.setStyleFromCssString=function(aHtmlNode,aCssString){if(aHtmlNode!=null&&aHtmlNode!=undefined)
aHtmlNode.style.cssText=aCssString;}
this.initializeImageButtonEvents=function(aImgTag,aTdTag,aImagesArr,aStylesArr,aMousePressedFunction,aIsCustomButton){var aUId="iibe"+Generate__UniqIdWebInputUsage();window[pThis._cache_id][aUId+"_OldImg"]=aImgTag;window[pThis._cache_id][aUId+"_TdTag"]=aTdTag;aImgTag=null;aTdTag=null;var aCurState=0;window[pThis._cache_id][aUId+"_TdTag"].onmouseover=function(ev){pThis.doStopUpDownButton();aCurState=1;pThis.setStyleFromCssString(window[pThis._cache_id][aUId+"_TdTag"],aStylesArr[1]);var aNewImg=aImagesArr[1];if(aNewImg!=window[pThis._cache_id][aUId+"_OldImg"]&&(aNewImg!=null)){try{window[pThis._cache_id][aUId+"_TdTag"].replaceChild(aNewImg,window[pThis._cache_id][aUId+"_OldImg"]);window[pThis._cache_id][aUId+"_OldImg"]=aNewImg;}catch(exInImg){}}
return pThis.cancelBrowserResponseOnEvent(ev);}
window[pThis._cache_id][aUId+"_TdTag"].onmouseout=function(ev){pThis.doStopUpDownButton();aCurState=0;window.setTimeout(function(){if(aCurState!=0){return;}
pThis.setStyleFromCssString(window[pThis._cache_id][aUId+"_TdTag"],aStylesArr[0]);var aNewImg=aImagesArr[0];if(aNewImg!=window[pThis._cache_id][aUId+"_OldImg"]&&(aNewImg!=null)){try{window[pThis._cache_id][aUId+"_TdTag"].replaceChild(aNewImg,window[pThis._cache_id][aUId+"_OldImg"]);window[pThis._cache_id][aUId+"_OldImg"]=aNewImg;}catch(exInImg){}}},1);return pThis.cancelBrowserResponseOnEvent(ev);}
window[pThis._cache_id][aUId+"_TdTag"].onmousedown=function(ev){aCurState=2;pThis.setStyleFromCssString(window[pThis._cache_id][aUId+"_TdTag"],aStylesArr[2]);var aNewImg=aImagesArr[2];if(aNewImg!=window[pThis._cache_id][aUId+"_OldImg"]&&(aNewImg!=null)){try{window[pThis._cache_id][aUId+"_TdTag"].replaceChild(aNewImg,window[pThis._cache_id][aUId+"_OldImg"]);window[pThis._cache_id][aUId+"_OldImg"]=aNewImg;}catch(exInImg){}}
if(aMousePressedFunction!=undefined){if(pThis.isControlFocused!=true){try{pThis.isControlFocused=true;window[pThis._cache_id]["elem"].focus();pThis.doClientEvent("OnClientFocus");}catch(ex){}}
if(aMousePressedFunction=="!spin_up"){pThis.breakRepeatingUpDownButtons=false;pThis.doUpButton(true);}else if(aMousePressedFunction=="!spin_down"){pThis.breakRepeatingUpDownButtons=false;pThis.doDownButton(true);}else if(aMousePressedFunction!=""){pThis.doClientEvent(aMousePressedFunction);}}
return pThis.cancelBrowserResponseOnEvent(ev);}
window[pThis._cache_id][aUId+"_TdTag"].onmouseup=function(ev){pThis.doStopUpDownButton();aCurState=1;pThis.setStyleFromCssString(window[pThis._cache_id][aUId+"_TdTag"],aStylesArr[1]);var aNewImg=aImagesArr[1];if(aNewImg!=window[pThis._cache_id][aUId+"_OldImg"]&&(aNewImg!=null)){try{window[pThis._cache_id][aUId+"_TdTag"].replaceChild(aNewImg,window[pThis._cache_id][aUId+"_OldImg"]);window[pThis._cache_id][aUId+"_OldImg"]=aNewImg;}catch(exInImg){}}
if(aIsCustomButton==true){pThis.doClientEvent("OnClientCustomButtonClick");}
return pThis.cancelBrowserResponseOnEvent(ev);}
try{window[pThis._cache_id][aUId+"_TdTag"].parentNode.parentNode.onmouseout=function(){pThis.doStopUpDownButton();};window[pThis._cache_id][aUId+"_TdTag"].parentNode.parentNode.onmouseover=function(){pThis.doStopUpDownButton();};}catch(ex){}}
this.checkAndRepairBtnImageSizeBounds=function(aImage,aIsCustomButton,aButtonWidth,aCtrlHeight){try{if(aCtrlHeight==undefined)
return;var cs=parseFloat(window[pThis._cache_id]["elemTbl"].style.cellSpacing*1);if(isNaN(cs))
cs=0;aCtrlHeight=aCtrlHeight*1-cs*2-(aIsCustomButton==true?0:1);var del=1;if(!aIsCustomButton){del=2;}
if(aImage!=undefined){if(!isNaN(parseFloat(aImage.height))&&aImage.height>aCtrlHeight/del){aImage.height=aCtrlHeight/del;}
if(aButtonWidth!=undefined&&!isNaN(parseFloat(aImage.width))){if(aImage.width>aButtonWidth-2){aImage.width=aButtonWidth-2;}}}}catch(ex){}}
this.initBtn=function(aTdImgIdPostfix,aImgIdPostfix,aHoverImageUrl,aPressedImageUrl,aBtnHoverStyle,aBtnPressedStyle,aMousePressedFunction,aIsCustomButton,aButtonWidth,aControlHeight){var aImgTag=get_element_by___id(pThis.id+aImgIdPostfix);var aTdTag=get_element_by___id(pThis.id+aTdImgIdPostfix);if(aTdTag!=null){}
var aHoverImage=null;if(aHoverImageUrl!=undefined&&aHoverImageUrl!=""){aHoverImage=new Image();aHoverImage.src=aHoverImageUrl;}
var aPressedImage=null;if(aPressedImageUrl!=undefined&&aPressedImageUrl!=""){aPressedImage=new Image();aPressedImage.src=aPressedImageUrl;}
try{this.checkAndRepairBtnImageSizeBounds(aImgTag,aIsCustomButton,aButtonWidth,aControlHeight);this.checkAndRepairBtnImageSizeBounds(aHoverImage,aIsCustomButton,aButtonWidth,aControlHeight);this.checkAndRepairBtnImageSizeBounds(aPressedImage,aIsCustomButton,aButtonWidth,aControlHeight);}catch(ex){}
pThis[pThis.id+"btnimagesArr_"+aImgIdPostfix]=new Array();pThis[pThis.id+"btnimagesArr_"+aImgIdPostfix].push(aImgTag);pThis[pThis.id+"btnimagesArr_"+aImgIdPostfix].push(aHoverImage);pThis[pThis.id+"btnimagesArr_"+aImgIdPostfix].push(aPressedImage);pThis[pThis.id+"btnstylesArr_"+aImgIdPostfix]=new Array();pThis[pThis.id+"btnstylesArr_"+aImgIdPostfix].push(aTdTag.style.cssText);pThis[pThis.id+"btnstylesArr_"+aImgIdPostfix].push(aBtnHoverStyle);pThis[pThis.id+"btnstylesArr_"+aImgIdPostfix].push(aBtnPressedStyle);pThis.initializeImageButtonEvents(aImgTag,aTdTag,pThis[pThis.id+"btnimagesArr_"+aImgIdPostfix],pThis[pThis.id+"btnstylesArr_"+aImgIdPostfix],aMousePressedFunction,aIsCustomButton);}
this.cutomButtonImagesArr;this.initCustomButton=function(aHoverImageUrl,aPressedImageUrl,aBtnHoverStyle,aBtnPressedStyle,aButtonWidth,aControlHeight){pThis.initBtn("_cb_td","_cb_img",aHoverImageUrl,aPressedImageUrl,aBtnHoverStyle,aBtnPressedStyle,"",true,aButtonWidth,aControlHeight);}
this.initSpinButtons=function(aHoverImageUrlUp,aHoverImageUrlDown,aPressedImageUrlUp,aPressedImageUrlDown,aBtnUpHoverStyle,aBtnUpPressedStyle,aBtnDownHoverStyle,aBtnDownPressedStyle,aButtonWidth,aControlHeight){pThis.initBtn("_sbu_td","_sbu_img",aHoverImageUrlUp,aPressedImageUrlUp,aBtnUpHoverStyle,aBtnUpPressedStyle,"!spin_up",false,aButtonWidth);pThis.initBtn("_sbd_td","_sbd_img",aHoverImageUrlDown,aPressedImageUrlDown,aBtnDownHoverStyle,aBtnDownPressedStyle,"!spin_down",false,aButtonWidth,aControlHeight);}
this._raiseOnClientDateChanged=function(){pThis.doClientEvent("OnClientDateChanged");}
this._smartInputMode=true;this._startYear=1950;this._showNullText=false;this._nullText="Empty";}
function Selection(textareaElement){this.element=textareaElement;}
Selection.prototype.setSelectionRange=function(start,end){if(document.selection!=null&&this.element.selectionStart==null){var range=this.element.createTextRange();range.collapse(true);range.moveStart("character",start);range.moveEnd("character",end-start);range.select();}else{this.element.setSelectionRange(start,end);}};Selection.prototype.create=function(){if(document.selection!=null&&this.element.selectionStart==null){return this._ieGetSelection();}else{return this._mozillaGetSelection();}}
Selection.prototype._mozillaGetSelection=function(){return{start:this.element.selectionStart,end:this.element.selectionEnd};}
Selection.prototype._ieGetSelection=function(){var aStart=0;var aEnd=0;try{aStart=Math.abs(document.selection.createRange().moveStart("character",-1000000));aEnd=aStart;}catch(e){}
try{aEnd=aStart+document.selection.createRange().text.length;}catch(e){}
var result={};result.start=aStart;result.end=aEnd;return result;}