
var ITC={};ITC.widget={};ITC.localization={DecimalPoint:'.',ThousandSeparator:',',DateFormat:'DD.MM.YYYY'};ITC.util={IsFunction:function(pObject){return typeof pObject=='function';},IsObject:function(pObject){return typeof pObject=='object'||ITC.util.IsFunction(pObject);},IsArray:function(pObject){if(!pObject)
return false;if(pObject.constructor&&pObject.constructor.toString().indexOf('Array')>-1)
return true;else
return ITC.util.IsObject(pObject)&&pObject.constructor==Array;},IsBoolean:function(pObject){return typeof pObject=='boolean';},IsNull:function(pObject){return pObject===null;},IsNumber:function(pObject){return!isNaN(pObject);},IsString:function(pObject){return typeof pObject=='string';},IsUndefined:function(pObject){return typeof pObject=='undefined';},IsBrowserInternetExplorer8Below:function(){if(!ITC.util.IsBrowserInternetExplorer())return false;var agt=navigator.userAgent.toLowerCase();var ind=agt.indexOf("msie ");if(ind==-1)return false;return(parseInt(agt.substr(ind+5,3)))<8;},IsBrowserInternetExplorer6OrBelow:function(){if(!ITC.util.IsBrowserInternetExplorer())return false;var agt=navigator.userAgent.toLowerCase();var ind=agt.indexOf("msie ");if(ind==-1)return false;return(parseInt(agt.substr(ind+5,3)))<7;},IsBrowserInternetExplorer55Up:function(){var agt=navigator.userAgent.toLowerCase();var major=parseInt(navigator.appVersion,10);return(ITC.util.IsBrowserInternetExplorer()&&(major>=4)&&(agt.indexOf("msie 4")==-1)&&(agt.indexOf("msie 5")==-1));},IsBrowserInternetExplorer:function(){var agt=navigator.userAgent.toLowerCase();var isIE=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));return isIE&&window.ActiveXObject;},IsBrowserOpera:function(){return navigator.userAgent.toLowerCase().indexOf("opera")!=-1;},IsVisible:function(pObject){if(pObject.style.display=="none"||pObject.style.visibility=='hidden')return false;if(pObject&&pObject.parentNode&&pObject.parentNode.style)return ITC.util.IsVisible(pObject.parentNode);return true;},EncodeForRegEx:function(pString){if(!pString)
return null;return pString.replace(/\\/,'\\\\').replace(/\(/,'\\(').replace(/\)/,'\\)').replace(/\./,'\\.').replace(/\*/,'.*');},EncodeForURL:function(pString){var i,unicode,ch,result='';if(!pString)return result;for(i=0;i<pString.length;i++){unicode=pString.charCodeAt(i);if(unicode<=32)
{if(unicode<16)result+="%0";else result+="%";result+=unicode.toString(16).toUpperCase();}
else
{if(unicode>127){result+="%26%23"+unicode.toString()+"%3B";}
else{ch=pString.charAt(i);switch(ch){case'$':result+='%24';break;case'&':result+='%26';break;case'+':result+='%2B';break;case',':result+='%2C';break;case'/':result+='%2F';break;case':':result+='%3A';break;case';':result+='%3B';break;case'=':result+='%3D';break;case'?':result+='%3F';break;case'@':result+='%40';break;case'"':result+='%22';break;case'<':result+='%3C';break;case'>':result+='%3E';break;case'#':result+='%23';break;case'%':result+='%25';break;default:result+=ch;}}}}
return result;},FormatMoneyField:function(name,maxDecimals,minDecimals){var i,k,el,str,strChar,tmpStr,val,tmpStyle,valArray=new Array();el=ITC.dom.GetElement(name);str=el.value;tmpStr='';k=0;i=0;while(i<=str.length){strChar=str.charAt(i);if(strChar=='+'||strChar=='-'||strChar=='*'||strChar=='/'||strChar=='('||strChar==')'){valArray[k]=ITC.util.StringToFloat(tmpStr);valArray[k+1]=strChar;tmpStr='';k+=2;}else{tmpStr+=strChar;valArray[k]=ITC.util.StringToFloat(tmpStr);};i+=1;};tmpStr='';i=0;while(i<valArray.length){if(!(ITC.util.IsUndefined(valArray[i])||(valArray[i]==null)))
tmpStr=tmpStr+valArray[i];i+=1;};try{val=eval(tmpStr);}catch(e){};if(ITC.util.IsUndefined(val)||(val==null)||(val=="Infinity")||(val=="-Infinity")||(val=="NaN")||(!val)){el.className='error';}else{el.value=ITC.util.FloatToStringWithMinimalDecimals(val,maxDecimals,minDecimals);el.className='';}},FloatToStringWithMinimalDecimals:function(pFloat,maxDecimals,minDecimals){var i,str,strTmp,val,dpPos,floatTmp;floatTmp=pFloat*1;str=ITC.util.FloatToString(floatTmp,maxDecimals);val=Math.abs(ITC.util.StringToFloat(str));i=str.length-1;strTmp='';if(val!=0){strTmp=str;if(Math.round(val)!=val){while((str.charAt(i)=='0')||(str.charAt(i)==ITC.localization.DecimalPoint)){strTmp=str.substr(0,i);i=i-1;}}else{strTmp=str.substr(0,i-maxDecimals);}
if(minDecimals!=0){i=strTmp.length-1;dpPos=strTmp.indexOf(ITC.localization.DecimalPoint);if(dpPos!=-1){val=strTmp.substr(dpPos,i).length-1;if(val<minDecimals){for(i=val;i<minDecimals;i++)
strTmp=strTmp+'0';}}else{strTmp=strTmp+ITC.localization.DecimalPoint;for(i=0;i<minDecimals;i++)
strTmp=strTmp+'0';}}}else{if(minDecimals==0){strTmp='0';}else{strTmp='0'+ITC.localization.DecimalPoint;for(i=0;i<minDecimals;i++)
strTmp=strTmp+'0';}}
return(strTmp);},StringToDate:function(pString){var df=ITC.localization.DateFormat;var str,tokens,monthIndex,dayIndex,yearIndex,day,month,year;if(!pString)
return null;str=pString.trimBlanks();yearIndex=2;if(df=='DD.MM.YYYY'){tokens=str.split('.');dayIndex=0;monthIndex=1;}else if(df=='MM/DD/YYYY'){tokens=str.split('/');dayIndex=1;monthIndex=0;}else if(df=='YYYY-MM-DD'){tokens=str.split('-');dayIndex=2;monthIndex=1;yearIndex=0;}else{return null;}
if((tokens.length<1)||(tokens.length>3))
return null;if((tokens.length==1)&&(yearIndex==2)&&str.isAllDigits()){if(str.length>4)
tokens=[str.substr(0,2),str.substr(2,2),str.substr(4)];else if(str.length>2)
tokens=[str.substr(0,2),str.substr(2)];}
day=(tokens.length-1)<dayIndex?0:parseInt(tokens[dayIndex],10);month=(tokens.length-1)<monthIndex?(new Date()).getMonth():parseInt(tokens[monthIndex],10)-1;year=(tokens.length-1)<yearIndex?0:parseInt(tokens[yearIndex],10);if(!year)
year=(new Date()).getFullYear();if(year<50)
year=2000+year;else if(year<100)
year=1900+year;if(!day||(day<0)||(day>31))
day=1;if(!month||(month<0)||(month>11))
month=0;return new Date(year,month,day);},DateToString:function(pDate){if(!pDate)
return'';return pDate.itcFormat(ITC.localization.DateFormat);},StringToFloat:function(pString,pDecimalPoint){var i,ch,purgedString,dp;if(!pString)
return null;purgedString='';dp=pDecimalPoint?pDecimalPoint:ITC.localization.DecimalPoint;for(i=0;i<pString.length;i++){ch=pString.charAt(i);if(ch>='0'&&ch<='9')
purgedString+=ch;else if(ch==dp)
purgedString+='.';else if((ch=='-')&&(i==0))
purgedString+=ch;}
return parseFloat(purgedString);},FloatToString:function(pFloat,pPrecision,pDecimalPoint,pThousandSeparator){var str,q,r,n,sign,dp,ts;if((!pFloat&&(pFloat!=0))||!(pFloat*1))
return'';dp=pDecimalPoint?pDecimalPoint:ITC.localization.DecimalPoint;ts=pThousandSeparator?pThousandSeparator:ITC.localization.ThousandSeparator;sign=pFloat<0?'-':'';n=Math.abs(pFloat);if(!pPrecision||(pPrecision==0))
return''+Math.floor(pFloat);str=''+Math.round(n*Math.pow(10.0,pPrecision)-(Math.floor(n)*Math.pow(10.0,pPrecision)));if(str.length>pPrecision)
return ITC.util.FloatToString((Math.floor(n)+1)*(pFloat<0?-1:1),pPrecision,pDecimalPoint,pThousandSeparator);while(str.length<pPrecision){str='0'+str;}
if(dp.length>0)
str=dp+str;if(ts.length==0)
return(sign+Math.floor(n)+str);q=Math.floor(n);r=q%1000;while(Math.floor(q/1000)!=0){str=r+str;if(r<10){str='00'+str;}else{if(r<100)
str='0'+str;}
str=ts+str;q=Math.floor(q/1000);r=q%1000;}
return(sign+q+str);},CalculateDate:function(fromDateField,untilDateField,daysField){var date=ITC.util.StringToDate(fromDateField.value);var daysToAdd=parseInt(daysField.value,10);if(isNaN(daysToAdd))daysToAdd=-1;if((date!=null)&&(daysToAdd>0)){date=date.addDays(daysToAdd);untilDateField.value=ITC.util.DateToString(date);}}};ITC.util.Hashtable=function(){this.m_Keys=new Array();this.m_Values=new Array();};ITC.util.Hashtable.prototype={_checkIntegrity:function(){if(this.m_Keys.length!=this.m_Values.length)
throw"Hashtable integrity failed!";},_indexOfKey:function(pKey){var i;if(pKey==null)
return-1;for(i=0;i<this.m_Keys.length;i++)
if(this.m_Keys[i]==pKey)
return i;return-1;},containsKey:function(pKey){return this._indexOfKey(pKey)>=0;},put:function(pKey,pValue){var index=this._indexOfKey(pKey);if(index<0)
index=this.m_Keys.length;this.m_Keys[index]=pKey;this.m_Values[index]=pValue;this._checkIntegrity();},get:function(pKey){var index=this._indexOfKey(pKey);if(index<0)
return null;return this.m_Values[index];},removeKey:function(pKey){var index=this._indexOfKey(pKey);if(index<0)
return false;this.m_Keys.splice(index,1);this.m_Values.splice(index,1);this._checkIntegrity();return true;},getKeys:function(){var i,result=new Array();for(i=0;i<this.m_Keys.length;i++)
result[i]=this.m_Keys[i];return result;},getValues:function(){var i,result=new Array();for(i=0;i<this.m_Values.length;i++)
result[i]=this.m_Values[i];return result;},size:function(){return this.m_Keys.length;},clear:function(){this.m_Keys=new Array();this.m_Values=new Array();}};Function.prototype.itcCreateDelegate=function(pScope,pArguments,pAppendArguments){var fnc=this;return function(){var applyArgs,callArgs=pArguments||arguments;if(pAppendArguments===true){callArgs=Array.prototype.slice.call(arguments,0);callArgs=callArgs.concat(pArguments);}else if(typeof pAppendArguments=="number"){callArgs=Array.prototype.slice.call(arguments,0);applyArgs=[appendArgs,0].concat(pArguments);Array.prototype.splice.apply(callArgs,applyArgs);}
return fnc.apply(pScope||window,callArgs);}};Date.prototype.addDays=function(pDays){var d=new Date();d.setTime(this.getTime());d.setDate(this.getDate()+pDays);return d;};Date.prototype.subtractDays=function(pDays){var d=new Date();d.setTime(this.getTime());d.setDate(this.getDate()+pDays);return d;};Date.prototype.getHours12=function(){return(this.getHours()<12)?this.getHours():this.getHours()-12;}
Date.prototype.itcFormat=function(fs){fs=fs.replace(/YYYY/,this.getFullYear().toString());fs=fs.replace(/YY/,this.getFullYear().toString().substr(2,2));fs=fs.replace(/MM/,(this.getMonth()+1)>9?(this.getMonth()+1).toString():'0'+(this.getMonth()+1).toString());fs=fs.replace(/M/,(this.getMonth()+1).toString());fs=fs.replace(/DD/,this.getDate()>9?this.getDate().toString():'0'+this.getDate().toString());fs=fs.replace(/D/,this.getDate().toString());fs=fs.replace(/HH/,this.getHours()>9?this.getHours().toString():'0'+this.getHours().toString());fs=fs.replace(/H/,this.getHours().toString());fs=fs.replace(/hh/,this.getHours12()>9?this.getHours12().toString():'0'+this.getHours12().toString());fs=fs.replace(/h/,this.getHours12());fs=fs.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0'+this.getMinutes().toString());fs=fs.replace(/m/,this.getMinutes().toString());fs=fs.replace(/ss/,this.getSeconds()>9?this.getSeconds().toString():'0'+this.getSeconds().toString());fs=fs.replace(/s/,this.getSeconds().toString());fs=fs.replace(/nnn/,this.getMilliseconds().toString());return fs;};String.prototype.trimBlanks=function(){var b=0;var e=this.length-1;while(this.substr(b,1)==' ')
b++;while(this.substr(e,1)==' ')
e--;return this.substring(b,e+1);};String.prototype.isAllDigits=function(){var i;for(i=0;i<this.length;i++){if((this.charAt(i)<'0')||(this.charAt(i)>'9'))
return false;}
return true;};String.prototype.htmlDecode=function(){return this.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&#39;/g,'\'').replace(/&quot;/g,'"').replace(/&#92;/g,'\\').replace(/&amp;/g,'&');};String.prototype.htmlEncode=function(){var i,ch,result='';for(i=0;i<this.length;i++){ch=this.charAt(i);switch(ch){case'<':result+='&lt;';break;case'>':result+='&gt;';break;case'&':result+='&amp;';break;case'\'':result+='&#39;';break;case'"':result+='&quot;';break;case'\\':result+='&#92;';break;default:result+=ch;}}
return result;};String.prototype.asUrlEncoded=function(){return ITC.util.EncodeForURL(this);};ITC.event={OnAvailableColl:[],_Interval:null,_OnAvailableLock:false,_RetryCount:0,PollInterval:20,PollRetries:200,AllRegisteredListeners:new ITC.util.Hashtable(),GetEvent:function(pEvent){var c,e=pEvent?pEvent:window.event;if(!e){c=this.GetEvent.caller;while(c){e=c.arguments[0];if(e&&(e.constructor==Event))
return e;c=c.caller;}}
return e;},StopPropagation:function(pEvent){if(pEvent.stopPropagation)
pEvent.stopPropagation();else
pEvent.cancelBubble=true;},PreventDefault:function(pEvent){if(pEvent.preventDefault)
pEvent.preventDefault();else
pEvent.returnValue=false;},StopEvent:function(pEvent){this.StopPropagation(pEvent);this.PreventDefault(pEvent);},GetCharCode:function(pEvent){return pEvent.charCode?pEvent.charCode:pEvent.keyCode;},AddListener:function(pEventName,pElement,pFunction,pClientObject){var h,a;if(pElement)
{if(pElement.attachEvent)
pElement.attachEvent('on'+pEventName,pFunction);else
pElement.addEventListener(pEventName,pFunction,true);};if(pClientObject){h=this.AllRegisteredListeners.get(pElement);if(!h){h=new ITC.util.Hashtable();this.AllRegisteredListeners.put(pElement,h);}
a=h.get(pClientObject);if(!a){a=new Array();h.put(pClientObject,a);}
a[a.length]=[pEventName,pFunction];}},RemoveListener:function(pEventName,pElement,pFunction){if(pElement.detachEvent)
pElement.detachEvent('on'+pEventName,pFunction);else
pElement.removeEventListener(pEventName,pFunction,true);},RemoveAllListenersForClient:function(pClientObject){var i,j,eventObjects,h,a;eventObjects=this.AllRegisteredListeners.getKeys();for(i=0;i<eventObjects.length;i++){h=this.AllRegisteredListeners.get(eventObjects[i]);a=h.get(pClientObject);if(a!=null){for(j=0;j<a.length;j++)
this.RemoveListener(a[j][0],eventObjects[i],a[j][1]);}
h.removeKey(pClientObject);if(h.size()==0)
this.AllRegisteredListeners.removeKey(eventObjects[i]);}},RemoveAllListenersForElement:function(pElement){var i,j,clientObjects,h,a;h=this.AllRegisteredListeners.get(pElement);if(h!=null){clientObjects=h.getValues();for(i=0;i<clientObjects.length;i++){a=clientObjects[i];for(j=0;j<a.length;j++)
this.RemoveListener(a[j][0],pElement,a[j][1]);}
this.AllRegisteredListeners.removeKey(pElement);}},RemoveAllListeners:function(){var i,j,eventObjects,clientObjects,h,a;eventObjects=this.AllRegisteredListeners.getKeys();for(i=0;i<eventObjects.length;i++){h=this.AllRegisteredListeners.get(eventObjects[i]);clientObjects=h.getValues();for(i=0;i<clientObjects.length;i++){a=clientObjects[i];for(j=0;j<a.length;j++)
this.RemoveListener(a[j][0],eventObjects[i],a[j][1]);}}
this.AllRegisteredListeners.clear();},OnAvailable:function(pElementId,pFunction,pObject,pOverride){this.OnAvailableColl.push({id:pElementId,fn:pFunction,obj:pObject,override:pOverride});this._RetryCount=this.PollRetries;this._StartInterval();},_StartInterval:function(){var th=this;if(!this._Interval){setInterval(function(){th._TryOnAvailable()},this.PollInterval);}},_StopInterval:function(){try{if(this._Interval)
clearInterval(this._Interval);}catch(e){}
this._Interval=null;},_GetEl:function(pId){return document.getElementById(pId);},_TryOnAvailable:function(){var i,item,el,scope,notAvailCount=0;if(this._OnAvailableLock||(this._RetryCount<=0))
return;this._OnAvailableLock=true;for(i=0;i<this.OnAvailableColl.length;i++){item=this.OnAvailableColl[i];if(item){el=this._GetEl(item.id);if(el&&(el.nextSibling||(document&&document.body))){scope=el;if(item.override){if(item.override===true)
scope=item.obj;else
scope=item.override;}
item.fn.call(scope,item.obj);this.OnAvailableColl[i]=null;}else{notAvailCount++;}}}
this._RetryCount=notAvailCount>0?this._RetryCount-1:0;if(this._RetryCount>0)
this._StartInterval();else
this._StopInterval();this._OnAvailableLock=false;}};ITC.dom={_RegisteredUndercovers:new ITC.util.Hashtable(),UndercoverStructure:function(){this.m_IFrame=null;this.m_HideAllDropDowns=false;},GetElement:function(pHtmlElementOrIdOrName,pForm){var dom,frm,i,el;if(!pHtmlElementOrIdOrName)
return null;if(pHtmlElementOrIdOrName.nodeName){dom=pHtmlElementOrIdOrName;}else{dom=(document.all&&!document.getElementById)?document.all[pHtmlElementOrIdOrName]:document.getElementById(pHtmlElementOrIdOrName);if(!dom){if(document.getElementsByName){dom=document.getElementsByName(pHtmlElementOrIdOrName);if(dom){if(dom.length==1){dom=dom[0];}else if(!pForm){dom=null;}else{for(i=0;i<dom.length;i++){el=dom[i];if(ITC.dom.FindParentFormFor(el)==pForm){dom=el;break;}}
if(dom.length)
dom=null;}}else{dom=null;}}}}
if(!dom)
dom=null;return dom;},GetTopWindow:function(){var currWin=window;while(currWin!=currWin.parent){currWin=currWin.parent;}
return currWin;},GetDocumentWidth:function(){if(window.innerWidth)
return window.innerWidth;else if(document.all&&document.documentElement&&document.documentElement.clientWidth)
return document.documentElement.clientWidth;return document.body.clientWidth;},GetDocumentHeight:function(){if(window.innerHeight)
return window.innerHeight;else if(document.documentElement&&(document.documentElement.clientHeight>0))
return document.documentElement.clientHeight;return document.body.clientHeight;},GetWindowWidth:function(){var win=ITC.dom.GetTopWindow();if(win.innerWidth!=window.undefined)
return win.innerWidth;if(document.compatMode=='CSS1Compat')
return win.document.documentElement.clientWidth;if(document.body)
return win.document.body.clientWidth;return 0;},GetWindowHeight:function(){var win=ITC.dom.GetTopWindow();if(win.innerHeight!=window.undefined)
return win.innerHeight;if(document.compatMode=='CSS1Compat')
return win.document.documentElement.clientHeight;if(document.body)
return win.document.body.clientHeight;return 0;},CenterElement:function(pElement){var w,h,vw,vh,sl,st;w=pElement.offsetWidth;h=pElement.offsetHeight;vw=ITC.dom.GetWindowWidth();vh=ITC.dom.GetWindowHeight();sl=parseInt(document.documentElement.scrollLeft,10);st=parseInt(document.documentElement.scrollTop,10);pElement.style.left=(((vw-w)/2)+sl)+'px';pElement.style.top=(((vh-h)/2)+st)+'px';},GetElementPositionLeft:function(pElement){var result=0,border,el=pElement;result=pElement.offsetLeft;el=pElement.offsetParent;while(el){result+=el.offsetLeft;border=parseInt(ITC.css.GetElementStyle(el,'border-left-width'),10)||0;result+=border;if(!document.all&&(el!=pElement)&&ITC.css.GetElementStyle(el,'overflow')!='visible')
result+=border;el=el.offsetParent;}
return result;},GetElementPositionTop:function(pElement){var result=0,border,el=pElement;result=pElement.offsetTop;el=pElement.offsetParent;while(el){result+=el.offsetTop;border=parseInt(ITC.css.GetElementStyle(el,'border-top-width'),10)||0;result+=border;if(!document.all&&(el!=pElement)&&ITC.css.GetElementStyle(el,'overflow')!='visible')
result+=border;el=el.offsetParent;}
return result;},GetElementScrollLeft:function(pElement){var result=0,tmpEl=pElement.parentNode;if(tmpEl)
{while(tmpEl!=document.body)
{if(tmpEl.scrollLeft)
{result+=tmpEl.scrollLeft;};tmpEl=tmpEl.parentNode;}};return result;},GetElementScrollTop:function(pElement){var result=0,tmpEl=pElement.parentNode;if(tmpEl)
{while(tmpEl!=document.body)
{if(tmpEl.scrollTop)
{result+=tmpEl.scrollTop;};tmpEl=tmpEl.parentNode;}};return result;},GetInlineElementPositionLeft:function(pElement,pContainerElement){var result=0;if(!pContainerElement)
return ITC.dom.GetElementPositionLeft(pElement);if(pElement.offsetParent){while(pElement.offsetParent&&(pElement.offsetParent!=pContainerElement)){result+=pElement.offsetLeft
pElement=pElement.offsetParent;}}else if(pElement.x){result+=pElement.x;}
return result;},GetInlineElementPositionTop:function(pElement,pContainerElement){var result=0;if(!pContainerElement)
return ITC.dom.GetElementPositionTop(pElement);if(pElement.offsetParent){while(pElement.offsetParent&&(pElement.offsetParent!=pContainerElement)){result+=pElement.offsetTop
pElement=pElement.offsetParent;}}else if(pElement.y){result+=pElement.y;}
return result;},GetOffsetBetween:function(pElement1,pElement2){var result,current=pElement1;result={x:0,y:0};while(current&&(current!=pElement2)&&(current.tagName!='HTML')){result.x+=current.offsetLeft;result.y+=current.offsetTop;current=current.offsetParent;}
return result;},ScrollElementIntoView:function(pElement,pContainer,pHorizontalScroll){var offset,bottom,right,containerBottom,containerRight,container=pContainer||document.body;offset=ITC.dom.GetOffsetBetween(pElement,container);right=offset.x+pElement.offsetWidth;bottom=offset.y+pElement.offsetHeight;containerBottom=container.scrollTop+container.clientHeight;containerRight=container.scrollLeft+container.clientWidth;if(offset.y<container.scrollTop)
container.scrollTop=offset.y;else if(bottom>containerBottom)
container.scrollTop=bottom-container.clientHeight;if(pHorizontalScroll!=false){if(offset.x<container.scrollLeft)
container.scrollLeft=offset.x;else if(right>containerRight)
container.scrollLeft=right-container.clientWidth;}},IsMouseInsideElement:function(pElement,pEvent){var relTarget;var e=pEvent;if(!e)
e=window.event;if(typeof e.toElement!='undefined'&&e.toElement&&typeof pElement.contains!='undefined'){return pElement.contains(e.toElement);}else if(typeof e.relatedTarget!='undefined'&&e.relatedTarget){relTarget=e.relatedTarget;while(relTarget&&(relTarget!=pElement))
relTarget=relTarget.parentNode
return pElement==relTarget;}
return true;},FindParentFormFor:function(pElement){var el=pElement;while(el){if(el.nodeName=='FORM')
return el;el=el.parentNode;}
return null;},FindMatchingParentFor:function(pElement,pParentElement){var el=pElement;while(el){if(el==pParentElement)
return true;el=el.parentNode;}
return false;},ToggleDropDowns:function(pShow){var dropDownLists=document.getElementsByTagName('select');var i,parent,parentId;var visibilityString=pShow?'visible':'hidden';if(dropDownLists){for(i=0;i<dropDownLists.length;i++){parent=dropDownLists[i].parentElement;if(dropDownLists[i].name&&parent&&parent.id){parentId=parent.id.split('_');if((parentId.length!=2)||(parentId[1]!='dropDown')||((parentId[0]+'_list')!=dropDownLists[i].name))
dropDownLists[i].style.visibility=visibilityString;}else{dropDownLists[i].style.visibility=visibilityString;}}}},GetRadioButtonValue:function(pElement){for(var i=0;i<pElement.length;i++)if(pElement[i].checked)return pElement[i].value;return null;},SetPointerCursorFor:function(pElement){try{pElement.style.cursor='pointer';}catch(e){try{pElement.style.cursor='hand';}catch(e1){}}},IEDisableSelectFor:function(pElement,pClient){if(document.all){ITC.event.AddListener('dragstart',pElement,function(){return false;},pClient);ITC.event.AddListener('selectstart',pElement,function(){return false;},pClient);}},InitializeUndercoverFor:function(pElement){var el,undercoverStruc;if(!pElement||!document.all)
return false;undercoverStruc=new ITC.dom.UndercoverStructure();ITC.dom._RegisteredUndercovers.put(pElement,undercoverStruc);if(!ITC.util.IsBrowserInternetExplorer55Up()){undercoverStruc.m_HideAllDropDowns=true;return true;}
el=document.createElement('iframe');el.src='javascript:false';el.scrolling='no';el.frameborder='0';el.style.position=pElement.style.position?pElement.style.position:'absolute';el.style.filter='Alpha(style=0,opacity=0)';el.style.zIndex=997;el.style.display='none';if(pElement.style.zIndex<=el.style.zIndex)
pElement.style.zIndex=el.style.zIndex+1;pElement.parentElement.appendChild(el);undercoverStruc.m_IFrame=el;return true;},ShowUndercoverFor:function(pElement,pX,pY){var el,undercoverStruc=ITC.dom._RegisteredUndercovers.get(pElement);if(!undercoverStruc)
return false;if(undercoverStruc.m_HideAllDropDowns==true){ITC.dom.ToggleDropDowns(false);}else if(undercoverStruc.m_IFrame){el=undercoverStruc.m_IFrame;el.style.left=(pX||pElement.offsetLeft)+'px';el.style.top=(pY||pElement.offsetTop)+'px';el.style.width=pElement.offsetWidth+'px';el.style.height=pElement.offsetHeight+'px';el.style.display='block';}else{return false;}
return true;},HideUndercoverFor:function(pElement){var undercoverStruc=ITC.dom._RegisteredUndercovers.get(pElement);if(!undercoverStruc)
return false;if(undercoverStruc.m_HideAllDropDowns==true)
ITC.dom.ToggleDropDowns(true);else if(undercoverStruc.m_IFrame)
undercoverStruc.m_IFrame.style.display='none';else
return false;return true;},ForceGet:function(pTarget,pUrl){var newUrl=pUrl;if(pUrl.indexOf("?")>=0)newUrl+="&";else newUrl+="?";newUrl+="_rnd="+(new Date()).getTime();if(pTarget)ITC.dom.GetElement(pTarget).src=newUrl;else document.location.href=newUrl;},DisposeElement:function(d,recursive){if(!d)
return;if(ITC.util.IsBrowserInternetExplorer8Below()){var a=d.attributes,i,l,n,garbageBin;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]=='function')
d[n]=null;}}
a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1)
ITC.dom.DisposeElement(d.childNodes[i],true);}
if(!recursive){garbageBin=document.getElementById('IELeakGarbageBin');if(!garbageBin){garbageBin=document.createElement('div');garbageBin.id='IELeakGarbageBin';garbageBin.style.display='none';document.body.appendChild(garbageBin);}
garbageBin.appendChild(d);garbageBin.innerHTML='';}}else{document.body.removeChild(d);}}};ITC.dom.Element=function(pHtmlElementOrIdOrName){this.dom=ITC.dom.GetElement(pHtmlElementOrIdOrName);if(!this.dom)
return null;};ITC.dom.Element.Cache={};ITC.dom.Element.Count=0;ITC.dom.Element.GenName='itcGen_';ITC.dom.Element.NextId=function(){return ITC.dom.Element.GenName+ITC.dom.Element.Count++;};ITC.dom.Element.Get=function(pHtmlElementOrIdOrName){var dom,id,result;dom=ITC.dom.GetElement(pHtmlElementOrIdOrName);if(!dom)
return null;id=dom.id||dom.name;if(!id){id=ITC.dom.Element.NextId();dom.id=id;}
result=ITC.dom.Element.Cache[id];if(!result){result=new ITC.dom.Element(dom);ITC.dom.Element.Cache[id]=result;}
return result;};ITC.dom.Element.prototype={indicatorText:'<div class="itcLoadingIndicator">Loading...</div>',getLeft:function(){return ITC.dom.GetElementPositionLeft(this.dom);},getTop:function(){return ITC.dom.GetElementPositionTop(this.dom);},getScrollLeft:function(){return ITC.dom.GetElementScrollLeft(this.dom);},getScrollTop:function(){return ITC.dom.GetElementScrollTop(this.dom);},getWidth:function(){return this.dom.offsetWidth;},getHeight:function(){return this.dom.offsetHeight;},showLoading:function(pIndicatorText){this.dom.innerHTML=pIndicatorText||this.indicatorText;},updateAjax:function(pOptions){this.showLoading(pOptions.indicatorText);ITC.ajax.Request({url:pOptions.url,callback:{success:this.onUpdateSuccess.itcCreateDelegate(this)},loadScripts:pOptions.loadScripts});},onUpdateSuccess:function(pResponse){this.update(pResponse.responseText,pResponse.options.loadScripts);},update:function(pHtml,pLoadScripts){var id,html=pHtml;if(!pLoadScripts){this.dom.innerHTML=html;return this;}
id=ITC.dom.Element.NextId();html+='<span id="'+id+'"></span>';ITC.event.OnAvailable(id,function(){var hd=document.getElementsByTagName('head')[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var srcRe=/\ssrc=([\'\"])(.*?)\1/i;var typeRe=/\stype=([\'\"])(.*?)\1/i;var match,srcMatch,typeMatch,attrs,s;while(match=re.exec(html)){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=document.createElement('script');s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2])
s.type=typeMatch[2];hd.appendChild(s);}else if(match[2]&&match[2].length>0){eval(match[2]);}}
var el=document.getElementById(id);if(el)
el.parentNode.removeChild(el);});this.dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");},scrollIntoView:function(pContainer,pHorizontalScroll){ITC.dom.ScrollElementIntoView(this.dom,pContainer,pHorizontalScroll);},focus:function(){this.dom.focus();},addListener:function(pEventName,pFunction,pClientObject){ITC.event.AddListener(pEventName,this.dom,pFunction,pClientObject);},removeListener:function(pEventName,pFunction){ITC.event.RemoveListener(pEventName,this.dom,pFunction);}};ITC.css={RulesCache:null,GetRules:function(pReload){var i,j,rules;if(!this.RulesCache||pReload){this.RulesCache=new ITC.util.Hashtable();for(i=0;i<document.styleSheets.length;i++){try{rules=document.styleSheets[i].cssRules||document.styleSheets[i].rules;for(j=0;j<rules.length;j++){this.RulesCache.put(rules[j].selectorText,rules[j]);}}catch(e){}}}
return this.RulesCache;},GetRule:function(pSelector,pReload){var rules=this.GetRules(pReload);return rules.get(pSelector);},GetElementStyle:function(pElement,pProperty){var cssProp,i,len,prevCh,result=null;if(pElement.currentStyle){cssProp='';prevCh=pProperty.charAt(0);len=pProperty.length;for(i=1;i<=len;i++){cssProp+=(prevCh=='-')?pProperty.charAt(i++).toUpperCase():prevCh;if(i<len)
prevCh=pProperty.charAt(i);}
result=pElement.currentStyle[cssProp];}else if(window.getComputedStyle){result=document.defaultView.getComputedStyle(pElement,null).getPropertyValue(pProperty);}
return result;}};ITC.ajax={_RegisteredErrorGroups:null,_GetRegisteredErrorGroups:function(){if(!this._RegisteredErrorGroups)
this._RegisteredErrorGroups=new Hashtable();return this._RegisteredErrorGroups;},_FillElement:function(pElement,pData){var i,str;if(pElement.length){for(i=0;i<pElement.lenght;i++){if((pElement[i].nodeName!='INPUT')||(pElement[i].type.toUpperCase()!='RADIO'))
throw'ItcAjax._FillElement: pElement should be an array of radio buttons!';pElement[i].checked=pElement[i].value==pData;}
return;}
switch(pElement.nodeName){case'INPUT':if((pElement.type.toUpperCase()=='TEXT')||(pElement.type.toUpperCase()=='HIDDEN'))
pElement.value=pData;else if(pElement.type.toUpperCase()=='CHECKBOX')
pElement.checked=pData==true;else
throw'ItcAjax._FillElement: pElement should be either TEXT or CHECKBOX';break;case'SELECT':if(typeof pData=='object'){pElement.innerHTML='';str='';for(i=0;i<pData.options.length;i++)
str+='<option value="'+pData.options[i].value+'"'+(pData.options[i].value==pData.value?' selected="selected"':'')+'>'+(pData.options[i].text?pData.options[i].text:'')+'</option>';pElement.innerHTML=str;}else{for(i=0;i<pElement.options;i++){if(pElement.options[i].value==pData){pElement.options[i].selected=true;return;}}}
break;case'TEXTAREA':pElement.text=pData;break;default:throw'ItcAjax._FillElement: nodeName '+pElement.nodeName+' not supported!';}},FillElementsFromJSON:function(pJSON){var el,key,value;for(key in pJSON){value=pJSON[key];if(el=ITC.dom.GetElement(key)){}}},FindFormFor:function(pElement){var el=pElement;while(el){if(el.tagName=='FORM')
return el;el=el.parentNode;}
return null;},AddErrorToField:function(pFieldName,pErrorText,pHashtable){var el,errorFieldName,field=ITC.dom.GetElement(pFieldName);if(!field)
return;errorFieldName=pFieldName+'_error___';if(!(el=ITC.dom.GetElement(errorFieldName))){el=document.createElement('span');el.id=errorFieldName;el.className='ErrorMessage';field.parentNode.appendChild(el);pHashtable.put(pFieldName,el);}
el.innerHTML='<br />'+pErrorText;},AddErrors:function(pErrors,pErrorGroup){var i,el,newDict,dict,keys;if(!pErrorGroup)
return;if(!pErrors)
return;newDict=new Hashtable();for(i=0;i<pErrors.length;i++)
this.AddErrorToField(pErrors[i][0],pErrors[i][1],newDict);if(dict=this._GetRegisteredErrorGroups().get(pErrorGroup)){keys=dict.getKeys();for(i=0;i<keys.length;i++){if(!newDict.containsKey(keys[i])){try{el=dict.get(keys[i]);el.parentNode.removeChild(el);}catch(e){alert('ItcAjax.AddError: '+e);}}}
dict.clear();}
this._GetRegisteredErrorGroups().put(pErrorGroup,newDict);}};ITC.ajax.Request=function(pOptions){var dr,cb,url,fnc;cb={onSuccess:function(pData){var result={};result.responseText=pData;result.options=pOptions;fnc=ITC.util.IsFunction(pOptions.callback)?pOptions.callback:(pOptions.callback?pOptions.callback.success:null);if(ITC.util.IsFunction(fnc))
fnc(result);}};dr=new ITC.ajax.DataRetriever(cb,'onSuccess',true,true,null,true);dr.sendRequest(pOptions.url);};ITC.ajax.DataRetriever=function(pHandlerObject,pResponseFunctionName,pUseXmlHttp,pShowWholePage,pMaxTimeForResponse,pReturnRawData){this.m_HandlerObject=pHandlerObject;this.m_ResponseFunctionName=pResponseFunctionName;this.m_UseXmlHttp=pUseXmlHttp==false?false:true;this.m_ShowWholePage=pShowWholePage==true?true:false;this.m_MaxTimeForResponse=pMaxTimeForResponse?pMaxTimeForResponse:10000;this.m_ReturnRawData=pReturnRawData==true?true:false;this.m_XmlHttp=null;this.m_XmlDataFrame=null;this.m_DataFrameReady=false;this.m_UrlPrefix='';this.m_ResponseTimer=null;this.m_WaitingForResponse=false;this.m_RequestQueue=new Array();this.m_RequestDataQueue=new Array();this._initialize();}
ITC.ajax.DataRetriever.prototype={setUrlPrefix:function(pUrlPrefix){this.m_UrlPrefix=pUrlPrefix?pUrlPrefix:'';},sendRequest:function(pUrl,pFormOrName){this._sendRequestSynchronized(pUrl,pFormOrName);},_clearWaitForResponseTimer:function(){this.m_WaitingForResponse=false;if(this.m_ResponseTimer)
clearTimeout(this.m_ResponseTimer);},_sendRequestSynchronized:function(pUrl,pFormOrName){this.m_RequestQueue[this.m_RequestQueue.length]=pUrl;this.m_RequestDataQueue[this.m_RequestDataQueue.length]=this._createRequestStringForForm(pFormOrName);if(this.m_WaitingForResponse!=true)
this._sendNextRequest();},_sendNextRequest:function(){var nextUrl,nextData;var dr=this;if(this.m_RequestQueue.length==0)
return;nextUrl=this.m_RequestQueue[this.m_RequestQueue.length-1];nextData=this.m_RequestDataQueue[this.m_RequestDataQueue.length-1];this.m_RequestQueue.splice(this.m_RequestQueue.length-1,1);this.m_RequestDataQueue.splice(this.m_RequestDataQueue.length-1,1);try{if(this.m_ResponseTimer)
clearTimeout(this.m_ResponseTimer);}catch(e){}
if(this.m_MaxTimeForResponse>0){this.m_ResponseTimer=setTimeout(function(){dr._clearWaitForResponseTimer();if(dr.m_XmlHttp)
dr.m_XmlHttp.abort();dr._sendNextRequest();},this.m_MaxTimeForResponse);}
this._sendRequest(nextUrl,3);},_collectFormDataFor:function(pFormOrName){var form,el,i,allElements,type,includeInRequest;var result=new Array();if(!pFormOrName)
return result;form=(pFormOrName.nodeName=='FORM')?pFormOrName:ITC.dom.GetElement(pFormOrName);allElements=form.getElementsByTagName('INPUT');for(el in allElements){type=el.type.toUpperCase();includeInRequest=true;if((type=='CHECKBOX')||(type=='RADIO')){if(el.checked==false)
includeInRequest=false;}
if(includeInRequest==true)
result[el.name]=el.value;}
allElements=form.getElementsByTagName('SELECT');for(el in allElements)
result[el.name]=el.options[el.selectedIndex].value;return result;},_createRequestStringForForm:function(pFormOrName){var formData=this._collectFormDataFor(pFormOrName);var result='';for(var n in formData){if(result.length==0)
result+='&';result+=escape(n)+'='+escape(formData[n]);}
return result;},_sendRequest:function(pUrl,pNumOfTries){var dr=this;try{this.m_WaitingForResponse=true;if(this.m_XmlHttp){this.m_XmlHttp.open('GET',this.m_UrlPrefix+pUrl,true);this.m_XmlHttp.onreadystatechange=function(){dr._onResponseReceived();};this.m_XmlHttp.send(null);}else{this.m_XmlDataFrame.location.href=this.m_UrlPrefix+pUrl+'&isFrame=true';}}catch(e){if(pNumOfTries&&(pNumOfTries>0))
this._sendRequest(pUrl,pNumOfTries-1);else
this._invokeOnDataRetrieved(null);}},_initialize:function(){if(this.m_UseXmlHttp==true){try{this.m_XmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{this.m_XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){try{this.m_XmlHttp=new XMLHttpRequest();}catch(e){this.m_XmlHttp=null;}}}}
if(!this.m_XmlHttp){this._initializeXmlDataFrame();this.m_DataFrameReady=true;}},_initializeXmlDataFrame:function(){var el,name,dr=this;name='DataFrame_'+Math.random(100000);el=document.createElement('iframe');el.name=name;el.id=name;el.style.display='none';el.src='javascript:false';document.body.appendChild(el);if(frames&&frames[name])
el=frames[name];else
el=ITC.dom.GetElement(name);ITC.event.AddListener('load',ITC.dom.GetElement(name),function(){dr._onXmlDataFrameLoaded();});this.m_XmlDataFrame=el;},_onXmlDataFrameLoaded:function(){var retrievedData;if(!this.m_DataFrameReady||(this.m_XmlDataFrame.location.toString().indexOf('javascript:false')==0))
return;if(this.m_ShowWholePage==true)
retrievedData=this.m_XmlDataFrame.document.body.innerHTML;else
retrievedData=this.m_XmlDataFrame.xmlData;this._invokeOnDataRetrieved(retrievedData);},_onResponseReceived:function(){var retrievedData;if(this.m_XmlHttp.readyState!=4)return;if(this.m_ReturnRawData)
retrievedData=this.m_XmlHttp.responseText;else
retrievedData=(this.m_XmlHttp.responseText=='')?null:eval(this.m_XmlHttp.responseText);this._invokeOnDataRetrieved(retrievedData);},_invokeOnDataRetrieved:function(pData){var func,result=null;if(this.m_WaitingForResponse!=true)
return;if(this.m_HandlerObject){func=new Function('pObject','pData','return pObject.'+this.m_ResponseFunctionName+'(pData);');result=func(this.m_HandlerObject,pData);}else{if(this.m_ResponseFunctionName)
{func=new Function('pData','return '+this.m_ResponseFunctionName+'(pData);');result=func(pData);}
else{if(this.m_XmlHttp)this.m_XmlHttp.onreadystatechange=function(){};this.m_XmlHttp=null;eval(pData);}}
try{this.m_WaitingForResponse=false;this._sendNextRequest();}catch(e){}
return result;}};commonFormatMoneyField=ITC.util.FormatMoneyField;commonFloatToStringWithMinimalDecimals=ITC.util.FloatToStringWithMinimalDecimals;commonStringToDate=ITC.util.StringToDate;commonDateToString=ITC.util.DateToString;commonStringToFloat=ITC.util.StringToFloat;commonFloatToString=ITC.util.FloatToString;commonIsArray=ITC.util.IsArray;commonIsUndefined=ITC.util.IsUndefined;commonIsBrowserInternetExplorer55Up=ITC.util.IsBrowserInternetExplorer55Up;calculateDate=ITC.util.CalculateDate;commonEncodeForRegEx=ITC.util.EncodeForRegEx;Hashtable=ITC.util.Hashtable;commonGetTopWindow=ITC.dom.GetTopWindow;commonGetDocumentWidth=ITC.dom.GetDocumentWidth;commonGetDocumentHeight=ITC.dom.GetDocumentHeight;commonGetWindowWidth=ITC.dom.GetWindowWidth;commonGetWindowHeight=ITC.dom.GetWindowHeight;commonCenterElement=ITC.dom.CenterElement;commonGetElementPositionLeft=ITC.dom.GetElementPositionLeft;commonGetElementPositionTop=ITC.dom.GetElementPositionTop;commonGetInlineElementPositionLeft=ITC.dom.GetInlineElementPositionLeft;commonGetInlineElementPositionTop=ITC.dom.GetInlineElementPositionTop;commonIsMouseInsideElement=ITC.dom.IsMouseInsideElement;commonGetElementById=ITC.dom.GetElement;commonGetElement=ITC.dom.GetElement;commonSetPointerCursorFor=ITC.dom.SetPointerCursorFor;commonFindMatchingParentFor=ITC.dom.FindMatchingParentFor;commonToggleDropDowns=ITC.dom.ToggleDropDowns;commonIEDisableSelectFor=ITC.dom.IEDisableSelectFor;commonAddEvent=ITC.event.AddListener;commonRemoveEvent=ITC.event.RemoveListener;commonRemoveAllEventsForClient=ITC.event.RemoveAllListenersForClient;commonRemoveAllEventsForElement=ITC.event.RemoveAllListenersForElement;commonRemoveAllEvents=ITC.event.RemoveAllListeners;disposeElement=ITC.dom.DisposeElement;