/*
 * Zedcore CMS javascript framework.
 * Copyright 2009-2010 Zedcore Systems Ltd
 */
if(typeof ZC==="undefined"||!ZC){var ZC={}}ZC.Namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=ZC;for(B=(D[0]=="ZC")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]]}}return E};(function(){var L=YAHOO.lang,Dom=YAHOO.util.Dom,Evt=YAHOO.util.Event;var _ForEachArray=function(aArray,fnCallback,oThis){if(Array.forEach){_ForEachArray=Array.forEach}else{_ForEachArray=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}for(var i=0,iMax=aArray.length;i<iMax;i++){if(i in aArray){fnCallback.call(oThis,aArray[i],i,aArray)}}}}_ForEachArray(aArray,fnCallback,oThis)};var extraNames,extraLen,empty={};for(var i in {toString:1}){extraNames=[];break}extraNames=extraNames||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];extraLen=extraNames.length;var iScrollbarWidth;var sprintfRegex=/%%|%(\d+\$)?([-+#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;ZC.Util={sCurrentDomain:"Core",sprintf:function(){function pad(str,len,chr,leftJustify){var padding=(str.length>=len)?"":Array(1+len-str.length>>>0).join(chr);return leftJustify?str+padding:padding+str}function justify(value,prefix,leftJustify,minWidth,zeroPad){var diff=minWidth-value.length;if(diff>0){if(leftJustify||!zeroPad){value=pad(value,minWidth," ",leftJustify)}else{value=value.slice(0,prefix.length)+pad("",diff,"0",true)+value.slice(prefix.length)}}return value}function formatBaseX(value,base,prefix,leftJustify,minWidth,precision,zeroPad){var number=value>>>0;prefix=prefix&&number&&{"2":"0b","8":"0","16":"0x"}[base]||"";value=prefix+pad(number.toString(base),precision||0,"0",false);return justify(value,prefix,leftJustify,minWidth,zeroPad)}function formatString(value,leftJustify,minWidth,precision,zeroPad){if(precision!=null){value=value.slice(0,precision)}return justify(value,"",leftJustify,minWidth,zeroPad)}var a=arguments,i=0,format=a[i++];return format.replace(sprintfRegex,function(substring,valueIndex,flags,minWidth,ignore,precision,type){if(substring=="%%"){return"%"}var leftJustify=false,positivePrefix="",zeroPad=false,prefixBaseX=false;for(var j=0;flags&&j<flags.length;j++){switch(flags.charAt(j)){case" ":positivePrefix=" ";break;case"+":positivePrefix="+";break;case"-":leftJustify=true;break;case"0":zeroPad=true;break;case"#":prefixBaseX=true;break}}if(!minWidth){minWidth=0}else{if(minWidth=="*"){minWidth=+a[i++]}else{if(minWidth.charAt(0)=="*"){minWidth=+a[minWidth.slice(1,-1)]}else{minWidth=+minWidth}}}if(minWidth<0){minWidth=-minWidth;leftJustify=true}if(!isFinite(minWidth)){throw new Error("sprintf: (minimum-)width must be finite")}if(!precision){precision="fFeE".indexOf(type)>-1?6:(type=="d")?0:void (0)}else{if(precision=="*"){precision=+a[i++]}else{if(precision.charAt(0)=="*"){precision=+a[precision.slice(1,-1)]}else{precision=+precision}}}var value=valueIndex?a[valueIndex.slice(0,-1)]:a[i++];switch(type){case"s":return formatString(String(value),leftJustify,minWidth,precision,zeroPad);case"c":return formatString(String.fromCharCode(+value),leftJustify,minWidth,precision,zeroPad);case"b":return formatBaseX(value,2,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"o":return formatBaseX(value,8,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"x":return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"X":return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad).toUpperCase();case"u":return formatBaseX(value,10,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case"i":case"d":var number=parseInt(+value);var prefix=number<0?"-":positivePrefix;value=prefix+pad(String(Math.abs(number)),precision,"0",false);return justify(value,prefix,leftJustify,minWidth,zeroPad);case"e":case"E":case"f":case"F":case"g":case"G":var number=+value;var prefix=number<0?"-":positivePrefix;var method=["toExponential","toFixed","toPrecision"]["efg".indexOf(type.toLowerCase())];var textTransform=["toString","toUpperCase"]["eEfFgG".indexOf(type)%2];value=prefix+Math.abs(number)[method](precision);return justify(value,prefix,leftJustify,minWidth,zeroPad)[textTransform]();default:return substring}})},StrRepeat:function(sStr,iMultiplier){if(iMultiplier<0){YAHOO.log("StrRepeat: iMultiplier should be positive","error")}return new Array(iMultiplier+1).join("*")},Trim:function(sStr){return sStr.replace(/(^\s*|\s*$)/g,"")},TextDomain:function(sTextDomain){if(!L.isUndefined(sTextDomain)){this.sCurrentDomain=sTextDomain}return this.sCurrentDomain},GetText:function(sStr){var sTextDomain=ZC.Util.TextDomain();if(!L.isUndefined(ZC.oTranslations)){try{if(!L.isUndefined(ZC.oTranslations[sTextDomain][sStr][1])&&ZC.oTranslations[sTextDomain][sStr][1]){sStr=ZC.oTranslations[sTextDomain][sStr][1]}}catch(e){if(!(e instanceof TypeError)){throw e}}}return sStr},NGetText:function(sSingStr,sPlurStr,iCount){var sString,nplurals,plural,n=iCount,sTextDomain=ZC.Util.TextDomain();if(!L.isUndefined(ZC.oTranslations)){try{eval(ZC.oTranslations[sTextDomain][""]["Plural-Forms"]);plural=Number(plural)}catch(e){}finally{if(!L.isNumber(nplurals)||!L.isNumber(plural)||plural>nplurals){nplurals=2;plural=(iCount==1)?0:1}}try{if(!L.isUndefined(ZC.oTranslations[sTextDomain][sSingStr][plural+1])&&ZC.oTranslations[sTextDomain][sSingStr][plural+1]){sString=ZC.oTranslations[sTextDomain][sSingStr][plural+1]}}catch(e){if(!(e instanceof TypeError)){throw e}}}if(!sString){if(iCount==1){sString=sSingStr}else{sString=sPlurStr}}return sString},DGetText:function(sDomain,sStr){var sOldDomain=ZC.Util.TextDomain(),sTranslatedStr;ZC.Util.TextDomain(sDomain);sTranslatedStr=ZC.Util.GetText(sStr);ZC.Util.TextDomain(sOldDomain);return sTranslatedStr},DNGetText:function(sDomain,sSingStr,sPlurStr,iCount){var sOldDomain=ZC.Util.TextDomain(),sTranslatedStr;ZC.Util.TextDomain(sDomain);sTranslatedStr=ZC.Util.NGetText(sSingStr,sPlurStr,iCount);ZC.Util.TextDomain(sOldDomain);return sTranslatedStr},ReplaceTags:function(sContent,aTags,bBlankUnknownTags,oRegex){var fnReplace=function(sStr,sTagName){if(L.isUndefined(aTags[sTagName])){return bBlankUnknownTags?"":sStr}return aTags[sTagName]};if(L.isUndefined(oRegex)){oRegex=new RegExp("{(.*?)}","g")}sContent=sContent.replace(oRegex,fnReplace);sContent=sContent.replace('"/http','"http');return sContent},ReplaceHashTags:function(sContent,aTags){return ZC.Util.ReplaceTags(sContent,aTags,false,new RegExp("#(.+?)\\b","g"))},WrapContents:function(elSrc){var aChildren=elSrc.childNodes,elDiv=document.createElement("div");while(aChildren.length){elDiv.appendChild(aChildren[0])}elSrc.appendChild(elDiv);return elDiv},ScrollPage:function(mTo,fDuration,fnEasing){var aToXY,oAnim;if(L.isArray(mTo)){aToXY=mTo}else{aToXY=Dom.getXY(mTo)}if(L.isUndefined(fDuration)){fDuration=1}if(L.isUndefined(fnEasing)){fnEasing=YAHOO.util.Easing.easeOut}if(aToXY){if(L.isUndefined(this.bUseDocumentElement)){var iExistingScrollTop=document.documentElement.scrollTop;document.documentElement.scrollTop=iExistingScrollTop+1;this.bUseDocumentElement=(document.documentElement.scrollTop==iExistingScrollTop+1);document.documentElement.scrollTop=iExistingScrollTop}oAnim=new YAHOO.util.Scroll(this.bUseDocumentElement?document.documentElement:document.body,{scroll:{to:aToXY}},fDuration,fnEasing);oAnim.animate()}},UpdateElement:function(sID,oAttribs){var el=Dom.get(sID),sAnimation,oAnimOut,oAnimIn;if(L.isUndefined(oAttribs.OnStart)){oAttribs.OnStart=function(){}}if(L.isUndefined(oAttribs.OnHalfway)){oAttribs.OnHalfway=function(){}}if(L.isUndefined(oAttribs.OnComplete)){oAttribs.OnComplete=function(){}}if(L.isUndefined(oAttribs.Scope)){oAttribs.Scope=el}if(el){sAnimation="fade";if(YAHOO.env.ua.ie||!YAHOO.env.getVersion("animation")||Dom.hasClass(el,"hidden")||Dom.hasClass(el,"hide")){sAnimation="none"}else{if(!L.isUndefined(oAttribs.Animation)){sAnimation=oAttribs.Animation}}switch(sAnimation){case"fade":oAnimIn=new YAHOO.util.Anim(el,{opacity:{to:1}},0.1);oAnimOut=new YAHOO.util.Anim(el,{opacity:{from:Dom.getStyle(el,"opacity"),to:0}},0.1);oAnimOut.onStart.subscribe(oAttribs.OnStart,oAttribs.Scope,true);oAnimOut.onComplete.subscribe(function(){if(!L.isUndefined(oAttribs.HTML)){el.innerHTML=oAttribs.HTML}oAttribs.OnHalfway.call(oAttribs.Scope);ZC.JSManager.AutoTooltips(el);oAnimIn.animate()});oAnimIn.onComplete.subscribe(function(){oAttribs.OnComplete.call(oAttribs.Scope);L.later(10,el,function(){Dom.setStyle(this,"opacity","")})},this,true);oAnimOut.animate();break;case"none":default:oAttribs.OnStart.call(oAttribs.Scope);oAttribs.OnHalfway.call(oAttribs.Scope);if(!L.isUndefined(oAttribs.HTML)){el.innerHTML=oAttribs.HTML}ZC.JSManager.AutoTooltips(el);oAttribs.OnComplete.call(oAttribs.Scope);break}}else{YAHOO.log("UpdateElement: unable to locate element with id "+sID,"warn","UpdateElement");oAttribs.OnStart.call(oAttribs.Scope);oAttribs.OnHalfway.call(oAttribs.Scope);oAttribs.OnComplete.call(oAttribs.Scope)}},InArray:function(Value,aSearch){return(this.IndexOf(aSearch,Value)>=0)},IndexOf:function(aSearch,SearchElement,iFrom){if(Array.indexOf){this.IndexOf=Array.indexOf}else{this.IndexOf=function(aSearch,SearchElement,iFrom){iFrom=Number(iFrom)||0;var iLen=aSearch.length;if(iFrom<0){iFrom+=iLen}for(;iFrom<iLen;iFrom++){if(iFrom in aSearch&&aSearch[iFrom]===SearchElement){return iFrom}}return -1}}return this.IndexOf(aSearch,SearchElement,iFrom)},LastIndexOf:function(aSearch,SearchElement,iFrom){if(Array.indexOf){this.LastIndexOf=Array.lastIndexOf}else{this.LastIndexOf=function(aSearch,SearchElement,iFrom){var iLen=aSearch.length;iFrom=Number(iFrom)||0;if(isNaN(iFrom)){iFrom=iLen-1}else{if(iFrom<0){iFrom+=iLen}else{if(iFrom>=iLen){iFrom=iLen-1}}}for(;iFrom>-1;iFrom--){if(iFrom in aSearch&&aSearch[iFrom]===SearchElement){return iFrom}}return -1}}return this.LastIndexOf(aSearch,SearchElement,iFrom)},ForEach:function(aArray,fnCallback,oThis){if(L.isUndefined(aArray)){return }if(!L.isFunction(fnCallback)){throw new TypeError()}if(L.isArray(aArray)){return _ForEachArray(aArray,fnCallback,oThis)}if(!L.isUndefined(aArray.length)){for(var i=0,iMax=aArray.length;i<iMax;i++){fnCallback.call(oThis,aArray[i],i,aArray)}}else{for(var Key in aArray){if(L.hasOwnProperty(aArray,Key)){fnCallback.call(oThis,aArray[Key],Key,aArray)}}}},Map:function(aArray,fnCallback,oThis){if(Array.map){this.Map=Array.map}else{this.Map=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;var aResult=new Array(iLen);for(var i=0;i<iLen;i++){if(i in aArray){aResult[i]=fnCallback.call(oThis,aArray[i],i,aArray)}}return aResult}}return this.Map(aArray,fnCallback,oThis)},Filter:function(aArray,fnCallback,oThis){if(Array.filter){this.Filter=Array.filter}else{this.Filter=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;var aResult=new Array();for(var i=0;i<iLen;i++){if(i in aArray){var Val=aArray[i];if(fnCallback.call(oThis,Val,i,aArray)){aResult.push(Val)}}}return aResult}}return this.Filter(aArray,fnCallback,oThis)},Some:function(aArray,fnCallback,oThis){if(Array.some){this.Some=Array.some}else{this.Some=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;for(var i=0;i<iLen;i++){if(i in aArray&&fnCallback.call(oThis,aArray[i],i,aArray)){return true}}return false}}return this.Some(aArray,fnCallback,oThis)},Every:function(aArray,fnCallback,oThis){if(Array.every){this.Every=Array.every}else{this.Every=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;for(var i=0;i<iLen;i++){if(i in aArray&&!fnCallback.call(oThis,aArray[i],i,aArray)){return false}}return true}}return this.Every(aArray,fnCallback,oThis)},Keys:function(o){if(Object.keys){this.Keys=Object.keys}else{this.Keys=function(o){var aKeys=[];this.ForEach(o,function(v,k){aKeys.push(k)});return aKeys}}return this.Keys(o)},Flatten:function(aFlatten){var aResult=[];U.ForEach(aFlatten,function(mVal){if(L.isArray(mVal)){aResult.push.apply(aResult,this.Flatten(mVal))}else{aResult.push(mVal)}},this);return aResult},ObjectsEqual:function(oA,oB,bStrict,aSeen){if(!L.isArray(oA)&&!L.isObject(oA)&&!L.isArray(oB)&&!L.isObject(oB)){return bStrict?(oA===oB):(oA==oB)}if(L.isArray(oA)!=L.isArray(oB)||typeof oA!=typeof oB){return false}var aKeysA=this.Keys(oA),aKeysB=this.Keys(oB),i,iMax,k,iIndexB;if(aKeysA.length!=aKeysB.length){return false}for(i=0,iMax=aKeysA.length;i<iMax;i++){k=aKeysA[i];iIndexB=this.IndexOf(aKeysB,k);if(iIndexB==-1){return false}aKeysB.splice(iIndexB,1);if(bStrict&&typeof oA[k]!=typeof oB[k]){return false}if(typeof oA[k]=="object"){if(L.isUndefined(aSeen)||(!this.InArray(oA[k],aSeen)&&!this.InArray(oB[k],aSeen))){var aNewSeen=aSeen||[];aNewSeen.unshift(oA,oB);if(!this.ObjectsEqual(oA[k],oB[k],bStrict,aNewSeen)){return false}}}else{if(oA[k]!=oB[k]){return false}}}if(aKeysB.length>0){return false}return true},Clone:function(o){if(!o||typeof o!="object"||L.isFunction(o)){return o}if(o.nodeType&&"cloneNode" in o){return o.cloneNode(true)}if(o instanceof Date){return new Date(o.getTime())}var r,i,l,s,name;if(L.isArray(o)){r=[];for(i=0,l=o.length;i<l;++i){if(i in o){r.push(this.Clone(o[i]))}}}else{r=o.constructor?new o.constructor():{}}for(name in o){s=o[name];if(!(name in r)||(r[name]!==s&&(!(name in empty)||empty[name]!==s))){r[name]=this.Clone(s)}}if(extraLen){for(i=0;i<extraLen;++i){name=extraNames[i];s=o[name];if(!(name in r)||(r[name]!==s&&(!(name in empty)||empty[name]!==s))){r[name]=s}}}return r},InsertAtCursor:function(elInput,sText){var iScrollPos=elInput.scrollTop,iStrPos=0,bSelStart=!L.isUndefined(elInput.selectionStart),oRange,sStart,sEnd;if(bSelStart){iStrPos=elInput.selectionStart}else{elInput.focus();oRange=document.selection.createRange();oRange.moveStart("character",-elInput.value.length);iStrPos=oRange.text.length}sStart=elInput.value.substring(0,iStrPos);sEnd=elInput.value.substring(iStrPos);elInput.value=sStart+sText+sEnd;iStrPos+=sText.length;elInput.focus();if(bSelStart){elInput.selectionStart=iStrPos;elInput.selectionEnd=iStrPos}else{oRange=document.selection.createRange();oRange.moveStart("character",-elInput.value.length);oRange.moveStart("character",strPos);oRange.moveEnd("character",0);oRange.select()}elInput.scrollTop=iScrollPos},GetScrollbarWidth:function(){if(!L.isUndefined(iScrollbarWidth)){return iScrollbarWidth}var elScroll=null,elInner=null,iNoScroll=0,iScroll=0;elScroll=document.createElement("div");Dom.setStyle(elScroll,"position","absolute");Dom.setStyle(elScroll,"top","-1000px");Dom.setStyle(elScroll,"left","-1000px");Dom.setStyle(elScroll,"width","100px");Dom.setStyle(elScroll,"height","50px");Dom.setStyle(elScroll,"overflow","hidden");elInner=document.createElement("div");Dom.setStyle(elInner,"width","100%");Dom.setStyle(elInner,"height","200px");elScroll.appendChild(elInner);document.body.appendChild(elScroll);iNoScroll=elInner.offsetWidth;Dom.setStyle(elScroll,"overflow","scroll");iScroll=elInner.offsetWidth;if(iNoScroll==iScroll){iScroll=elScroll.clientWidth}document.body.removeChild(elScroll);iScrollbarWidth=(iNoScroll-iScroll);return iScrollbarWidth},Alert:function(sMessage,oParams){if(L.isUndefined(oParams)){oParams={}}else{if(L.isFunction(oParams)){oParams={OKHandler:oParams}}}if(L.isUndefined(oParams.OKHandler)){oParams.OKHandler=function(){}}if(L.isUndefined(oParams.Scope)){oParams.Scope=window}if(!L.isUndefined(YAHOO.widget.SimpleDialog)){var oPanelConfig,oPanel;oPanelConfig={width:oParams.width||"300px",fixedcenter:"contained",visible:false,draggable:false,close:false,modal:true,text:sMessage,icon:YAHOO.widget.SimpleDialog.ICON_ALARM,constraintoviewport:true,buttons:[{text:"OK",handler:function(){this.destroy();oParams.OKHandler.call(oParams.Scope)},isDefault:true}]};if(!L.isUndefined(YAHOO.widget.SimpleDialog["ICON_"+oParams.Icon])){oPanelConfig.icon=YAHOO.widget.SimpleDialog["ICON_"+oParams.Icon]}oPanel=new YAHOO.widget.SimpleDialog("alert"+Math.floor(Math.random()*1000),oPanelConfig);oPanel.render(document.body);oPanel.show()}else{alert(sMessage);oParams.OKHandler.call(oParams.Scope)}},Confirm:function(sMessage,oScope,fnOKHandler,fnCancelHandler){if(L.isUndefined(fnOKHandler)){fnOKHandler=function(){}}if(L.isUndefined(fnCancelHandler)){fnCancelHandler=function(){}}if(!L.isUndefined(YAHOO.widget.SimpleDialog)){if(L.isUndefined(this.oConfirmPanel)){this.oConfirmPanel=new YAHOO.widget.SimpleDialog("alert",{width:"300px",fixedcenter:true,visible:false,draggable:false,close:false,modal:true,icon:YAHOO.widget.SimpleDialog.ICON_HELP,constraintoviewport:true});this.oConfirmPanel.render(document.body)}this.oConfirmPanel.cfg.setProperty("text",sMessage);this.oConfirmPanel.cfg.setProperty("buttons",[{text:"Yes",handler:function(){this.hide();fnOKHandler.call(oScope)},isDefault:true},{text:"No",handler:function(){this.hide();fnCancelHandler.call(oScope)}}]);this.oConfirmPanel.show()}else{if(confirm(sMessage)){fnOKHandler()}else{fnCancelHandler()}}},DefaultLoadingIndicator:{Show:function(){if(L.isUndefined(this.elLoadingIndicator)){this.elLoadingIndicator=document.createElement("div");this.elLoadingIndicator.id="ajaxloading";this.elLoadingIndicator.className="hide";this.elLoadingIndicator.appendChild(document.createTextNode(ZC.Util.GetText("Please wait…")));Dom.setStyle(this.elLoadingIndicator,"opacity",0);document.body.appendChild(this.elLoadingIndicator);if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<7){var fnAlignDiv=function(){this.elLoadingIndicator.style.top=Dom.getClientRegion().top+"px"};fnAlignDiv.call(this);Evt.on(window,"resize",fnAlignDiv,this,true);Evt.on(window,"scroll",fnAlignDiv,this,true)}Evt.on(window,"unload",function(){this.elLoadingIndicator=null},this,true)}if(YAHOO.util.Anim){var oAnim=new YAHOO.util.Anim(this.elLoadingIndicator,{opacity:{from:0,to:0.75}},0.4);oAnim.onStart.subscribe(function(){Dom.removeClass(this.elLoadingIndicator,"hide")},this,true);oAnim.animate()}else{Dom.setStyle(this.elLoadingIndicator,"opacity",1);Dom.removeClass(this.elLoadingIndicator,"hide")}},Hide:function(){if(YAHOO.util.Anim){var oAnim=new YAHOO.util.Anim(this.elLoadingIndicator,{opacity:{from:0.75,to:0}},0.4);oAnim.onComplete.subscribe(function(){Dom.addClass(this.elLoadingIndicator,"hide")},this,true);oAnim.animate()}else{Dom.addClass(this.elLoadingIndicator,"hide")}}}};var U=ZC.Util,_GT=U.GetText;var AttribProvider=function(){};AttribProvider.prototype={GetAttrib:function(sName){if(sName in this.aDef){return this.aDef[sName]}else{if(!L.isUndefined(this._elInput)&&!L.isArray(this._elInput)&&Dom.getAttribute(this._elInput,sName)){return Dom.getAttribute(this._elInput,sName)}else{YAHOO.log("Attrib "+sName+" is not set","error",this.sName+"::GetAttrib")}}},GetAttribDefault:function(sName,mDefault){if(L.isUndefined(mDefault)){mDefault=false}return this.AttribIsset(sName)?this.GetAttrib(sName):mDefault},AttribIsset:function(sName){if(!L.isUndefined(this.aDef[sName])){return true}if(!L.isUndefined(this._elInput)&&!L.isArray(this._elInput)&&Dom.getAttribute(this._elInput,sName)){return true}return false},AttribsAreSet:function(aAttribs){return U.Every(aAttribs,this.AttribIsset,this)},SetAttrib:function(sName,Value){var OldValue=this.aDef[sName];this.aDef[sName]=Value;if(OldValue!=Value&&L.isFunction(this["AttribMethod_"+sName])){this["AttribMethod_"+sName](Value,OldValue)}},SetAttribs:function(oAttribs){U.ForEach(oAttribs,function(Value,sName){this.SetAttrib(sName,Value)},this)},AttribProviderSetup:function(){this._bAttribProviderSetup=true;U.ForEach(this.aDef,function(Value,sKey){if(L.isFunction(this["AttribMethod_"+sKey])){this["AttribMethod_"+sKey](Value)}},this);this._bAttribProviderSetup=false}};var GetWidgetProvider=function(){};GetWidgetProvider.prototype={GetWidget:function(sSearch){var iNumSearchObjects,iDotPos,i,oSearchObject,sSearchPart,sSearchRest,sName,oChildSearch;if(L.isObject(sSearch)){if(sSearch instanceof ZC.Core.Widget){return sSearch}else{if(!L.isUndefined(sSearch.name)){sSearch=sSearch.name}else{if(!L.isUndefined(sSearch.id)){sSearch=sSearch.id}else{sSearch=sSearch.toString()}}}}iNumSearchObjects=this._aSearchObjects.length;iDotPos=sSearch.indexOf(".");if(iDotPos>-1){sSearchPart=sSearch.substr(0,iDotPos);sSearchRest=sSearch.substr(iDotPos+1);for(i=0;i<iNumSearchObjects;++i){oSearchObject=this[this._aSearchObjects[i]];if(!L.isUndefined(oSearchObject[sSearchPart])){return oSearchObject[sSearchPart].GetWidget(sSearchRest)}}return undefined}for(i=0;i<iNumSearchObjects;++i){oSearchObject=this[this._aSearchObjects[i]];if(!L.isUndefined(oSearchObject[sSearch])){return oSearchObject[sSearch]}for(sName in oSearchObject){if(L.hasOwnProperty(oSearchObject,sName)&&L.isObject(oSearchObject[sName])){oChildSearch=oSearchObject[sName].GetWidget(sSearch);if(!L.isUndefined(oChildSearch)){return oChildSearch}}}}return undefined},GetWidgetsBy:function(fnMethod,oScope){var iNumSearchObjects,i,oSearchObject,sSearchPart,sSearchRest,sName,oChildSearch,aResult=[];iNumSearchObjects=this._aSearchObjects.length;for(i=0;i<iNumSearchObjects;++i){oSearchObject=this[this._aSearchObjects[i]];U.ForEach(oSearchObject,function(oSearch){if(fnMethod.call(oScope,oSearch)){aResult.push(oSearch)}});for(sName in oSearchObject){if(L.hasOwnProperty(oSearchObject,sName)){aChildSearch=oSearchObject[sName].GetWidgetsBy(fnMethod,oScope);aResult.push.apply(aResult,aChildSearch)}}}return aResult}};var EventProvider=function(){};EventProvider.prototype={EventProviderDestruct:function(){if(!L.isUndefined(this.aEventListeners)){U.ForEach(this.aEventListeners,function(aELs){U.ForEach(aELs,function(oEventListener){try{oEventListener.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}})})}this.aEventListeners={};this.aEvents={}},AddEvent:function(EventNameOrFunction,aOn,oScope,iOrder,oObjectOverride){var elEvent=this.GetEventElement();if(!elEvent&&(L.isUndefined(this.HasChildWidgets)||!this.HasChildWidgets())){YAHOO.log("this.GetEventElement() is not valid, no child widgets and AddEvent is not overridden","error",this.sName+"#AddEvent");return undefined}if(L.isUndefined(oObjectOverride)){oObjectOverride=this}if(!(this instanceof ZC.Core.Form)&&!L.isUndefined(this.aChildWidgets)){U.ForEach(this.aChildWidgets,function(oWidget){oWidget.AddEvent(EventNameOrFunction,aOn,oScope,iOrder,oObjectOverride)},this)}if(!elEvent){return }if(L.isUndefined(iOrder)){if(L.isUndefined(this._iEventHandlerOrder)){this._iEventHandlerOrder=100}iOrder=this._iEventHandlerOrder++}if(!L.isArray(aOn)){aOn=[aOn]}U.ForEach(aOn,function(sEvent){var i,iMax,oEventDef,oCustomEvent;if(L.isUndefined(this.aEvents)){this.aEvents={}}if(L.isUndefined(this.aEvents[sEvent])){this.aEvents[sEvent]=[];this._WireUpEvent(sEvent)}oEventDef={Scope:oScope,ObjectOverride:oObjectOverride,Order:iOrder};if(typeof EventNameOrFunction=="function"){oEventDef.Func=EventNameOrFunction}else{if(EventNameOrFunction instanceof YAHOO.util.CustomEvent){oCustomEvent=EventNameOrFunction}else{EventNameOrFunction=this._InternalEventName(EventNameOrFunction);oCustomEvent=ZC.JSManager.GetEvent(EventNameOrFunction)}oEventDef.CustomEvent=oCustomEvent}for(i=0,iMax=this.aEvents.length;i<iMax;i++){if(U.ObjectsEqual(this.aEvents[i],oEventDef)){return }}this.aEvents[sEvent].push(oEventDef)},this)},AddEvents:function(aDef){U.ForEach(aDef,function(aOn,sEventName){this.AddEvent(sEventName,aOn)},this)},_WireUpEvent:function(sEvent){switch(sEvent){case"load":ZC.JSManager.GetEvent("OnLoadEvent").subscribe(function(oEvent){this._EventDispatcher("load",oEvent)},this,true);break;case"EnableDisable":case"ShowHide":break;default:if(!Evt.addListener(this.GetEventElement(),sEvent,function(oEvent){this._EventDispatcher(sEvent,oEvent)},this,true)){YAHOO.log("addListener returned false for "+sEvent,"warn",this.sName+"._WireUpEvent")}break}},_EventDispatcher:function(){var aArgs=[],sEvent=arguments[0],i,iMax;for(i=1,iMax=arguments.length;i<iMax;i++){aArgs.push(arguments[i])}if(L.isUndefined(this.aEvents)||L.isUndefined(this.aEvents[sEvent])){return }this.aEvents[sEvent].sort(function(a,b){return(a.Order-b.Order)});U.ForEach(this.aEvents[sEvent],function(oEventDef){var aThisArgs=[];if(oEventDef.Func){[].push.apply(aThisArgs,aArgs);aThisArgs.push(this);oEventDef.Func.apply(oEventDef.Scope,aThisArgs)}else{aThisArgs.push(oEventDef.ObjectOverride);[].push.apply(aThisArgs,aArgs);aThisArgs.push(this);oEventDef.CustomEvent.fire.apply(oEventDef.CustomEvent,aThisArgs)}},this)},_SubscribeEventHandler:function(sType,aArgs,oObj){var fnEventHandler=aArgs[0],aEHArgs=[oObj,aArgs[1]],oOverride=aArgs[2];if(oOverride===true){oOverride=aArgs[1]}fnEventHandler.call(oOverride,oEvent.type,aEHArgs)},AddEventListener:function(sEventName,aDef){sEventName=this._InternalEventName(sEventName);var oEvent=ZC.JSManager.GetEvent(sEventName),i,iMax,oEL,fnEventListenerConstructor=ZC.JSManager.GetComponent(aDef.EventListenerType,aDef.Module||"Core","EventListener");YAHOO.log("Adding event listener for "+sEventName+" ("+this._InternalEventName(sEventName)+") to "+this.sName,"debug","AddEventListener");if(fnEventListenerConstructor){if(L.isUndefined(this.aEventListeners)){this.aEventListeners={}}if(L.isUndefined(this.aEventListeners[sEventName])){this.aEventListeners[sEventName]=[]}else{for(i=0,iMax=this.aEventListeners[sEventName].length;i<iMax;++i){if(U.ObjectsEqual(this.aEventListeners[sEventName][i].aDef,aDef)){YAHOO.log("Listener already exists, not adding another.","debug","AddEventListener");return this.aEventListeners[sEventName][i]}}}oEL=new fnEventListenerConstructor(this,oEvent,aDef);this.aEventListeners[sEventName].push(oEL);return oEL}else{throw new Error("Unable to load event listener: "+(aDef.Module||"Core")+"/"+aDef.EventListenerType)}},AddEventListeners:function(aDef){U.ForEach(aDef,function(aELDefs,sEventName){U.ForEach(aELDefs,function(aELDef){try{this.AddEventListener(sEventName,aELDef)}catch(ex){YAHOO.log("Unable to add event listener "+aELDef.EventListenerType+" for event "+sEventName+" to "+this.sName+": "+ex.message+" ("+ex.fileName+":"+ex.lineNumber+")","error",this.sName)}},this)},this)},_InternalEventName:function(sEventName){if(this instanceof ZC.Core.Block){return sEventName.replace("BLOCK",this.UniqueID())}if(this instanceof ZC.Core.Widget){var oBlock=this.FindContainingBlock();return sEventName.replace("WIDGET",this._WidgetNameToID()).replace("FORM",this.oForm?this.oForm.sName:"NoForm").replace("BLOCK",oBlock?oBlock.sName:"NoBlock")}},_FireEventHandlers:function(sEvent){var elEvent=this.GetEventElement(),oDOMEvent,aHandlers,aEventArgs=[],i,iMax;if(L.isArray(elEvent)){elEvent=elEvent[0]}aHandlers=Evt.getListeners(elEvent,sEvent);if(aHandlers){for(i=1,iMax=arguments.length;i<iMax;i++){aEventArgs.push(arguments[i])}if(aEventArgs.length&&!L.isUndefined(aEventArgs[0].clientY)){oDOMEvent=aEventArgs.shift()}U.ForEach(aHandlers,function(aHandler){var oScope=aHandler.scope,fnHandler=aHandler.fn,oArg=aHandler.obj||oScope,mEvent=oDOMEvent||aHandler.type;fnHandler.call(oScope,mEvent,oArg,aEventArgs)})}}};ZC.Namespace("Core");ZC.JSManager={aClientSideObjects:{},aEvents:{},aForms:{},aBlocks:{},aValidators:{},aFormValidators:{},bUnloading:false,Init:function(oConfig,bIframeInit){Dom.addClass(document.documentElement,"yui-pe");if(document.compatMode=="CSS1Compat"){Dom.addClass(document.documentElement,"docmode-standard")}else{Dom.addClass(document.documentElement,"docmode-quirks")}this.oConfig=oConfig;if(this.oConfig.DEBUG){Evt.throwErrors=true;if(YAHOO.widget.Logger){if(window.console&&console.log){YAHOO.widget.Logger.enableBrowserConsole()}else{Evt.onDOMReady(function(){var myContainer=document.createElement("div");document.body.appendChild(myContainer);this.oYUILogReader=new YAHOO.widget.LogReader(myContainer,{width:"800px"})},null,this)}}}Evt.onDOMReady(function(){Dom.addClass(document.body,"yui-skin-sam");this.oOverlayManager=new YAHOO.widget.OverlayManager();if(!L.isUndefined(this.oConfig.ClientSideObjects)){U.ForEach(this.oConfig.ClientSideObjects,function(aDef,sName){var fnConstructor=ZC.JSManager.GetComponent(aDef.Type,aDef.Module||"Core","ClientSideObject");if(fnConstructor){this.aClientSideObjects[sName]=new fnConstructor(aDef)}},this)}if(!L.isUndefined(this.oConfig.Blocks)){U.ForEach(this.oConfig.Blocks,function(aDef,sName){this.aBlocks[sName]=ZC.Core.Block.NewFromDef(sName,aDef)},this)}if(!L.isUndefined(this.oConfig.Forms)){U.ForEach(this.oConfig.Forms,function(aDef,sName){this.RegisterForm(new ZC.Core.Form(sName,aDef,this))},this)}var oInitEvent=this.GetEvent("ManagerInit");oInitEvent.fireOnce=true;oInitEvent.subscribe(function(){this.AutoTooltips()},this,true);oInitEvent.subscribe(this._AutoPopups,this,true);oInitEvent.fire();var oAfterInitEvent=this.GetEvent("AfterManagerInit");oAfterInitEvent.fireOnce=true;oAfterInitEvent.fire();this.GetEvent("OnLoadEvent").fire();if(YAHOO.env.ua.ie){document.body.style.display="none";document.body.style.display=""}Dom.removeClass(document.documentElement,"yui-pe")},null,this);Evt.on(window,"beforeunload",function(){this.bUnloading=true},this,true);Evt.on(window,"unload",function(){U.ForEach(this.aBlocks,function(oBlock){try{oBlock.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}});U.ForEach(this.aClientSideObjects,function(oCSO){try{oCSO.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}});if(this.oOverlayManager){var aOverlays=this.oOverlayManager.cfg.getProperty("overlays");if(aOverlays){U.ForEach(aOverlays,function(oOverlay){oOverlay.destroy();oOverlay=null});aOverlays=null}this.oOverlayManager=null}this.aClientSideObjects={};this.aEvents={};this.aForms={};this.aBlocks={};this.aValidators={};this.aFormValidators={};this.oAutoTooltips=null;this.oYUILogReader=null;ZC.JSManager=null;ZC=null},this,true)},AutoTooltips:function(elScan){var aTooltips,oTTCfg,aContext;if(YAHOO.env.getVersion("container")){aTooltips=Dom.getElementsByClassName("tooltip",undefined,elScan);if(aTooltips.length){if(L.isUndefined(this.oAutoTooltips)){oTTCfg={context:aTooltips,autofillheight:false,autodismissdelay:120000,zIndex:45};if(!L.isUndefined(YAHOO.util.Anim)){oTTCfg.effect={effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}}this.oAutoTooltips=new YAHOO.widget.Tooltip("zcb_auto_tt",oTTCfg);this.oOverlayManager.register(this.oAutoTooltips);this.oAutoTooltips.beforeShowEvent.subscribe(function(){this.oOverlayManager.bringToTop(this.oAutoTooltips)},this,true)}else{aContext=this.oAutoTooltips.cfg.getProperty("context");aContext.push.apply(aContext,aTooltips);this.oAutoTooltips.cfg.setProperty("context",aContext)}}}},_AutoPopups:function(){var fnOpenPopup=function(elLink,sURL,iWidth,iHeight){var sOptions="status=1, resizable=1, scrollbars=yes";if(!L.isUndefined(iWidth)){sOptions+=", width = "+iWidth}if(!L.isUndefined(iHeight)){sOptions+=", height = "+iHeight}window.open(sURL,"_blank",sOptions)};var aPopups=Dom.getElementsByClassName("popup");if(aPopups.length){Evt.on("click",function(oEvent){var elLink=Evt.getTarget(oEvent);var aMatches=elLink.className.match(/(w(\d+))?(h(\d+))?/);var iWidth=aMatches[2];var iHeight=aMatches[4];fnOpenPopup(elLink,elLink.href,iWidth,iHeight)})}},RegisterForm:function(oForm){this.aForms[oForm.sName]=oForm;U.ForEach(oForm.aChildWidgets,function(oWidget){oWidget.oForm=oForm})},GetComponent:function(sCmpName,sModule,sType){var sFirstPart,sSecondPart,iFirstPos,iSecondPos,aTry=[],i,iMax;if(L.isUndefined(sCmpName)){return false}iFirstPos=sCmpName.indexOf("_");if(iFirstPos!=-1){sFirstPart=sCmpName.substring(0,iFirstPos)}iSecondPos=sCmpName.indexOf("_",iFirstPos+1);if(iSecondPos!=-1){sSecondPart=sCmpName.substring(iFirstPos+1,iSecondPos)}if(sFirstPart&&sSecondPart){aTry.push([sFirstPart,sSecondPart,sCmpName.substring(iSecondPos+1)])}if(sFirstPart){aTry.push([sModule||"Core",sFirstPart,sCmpName.substring(iFirstPos+1)]);aTry.push([sFirstPart,sCmpName.substring(iFirstPos+1),undefined])}aTry.push([sModule||"Core",sType,sCmpName]);for(i=0,iMax=aTry.length;i<iMax;i++){var sM=aTry[i][0];var sT=aTry[i][1];var sST=aTry[i][2];if(L.isUndefined(ZC[sM])){continue}if(L.isUndefined(ZC[sM][sT])){continue}if(L.isUndefined(sST)){return ZC[sM][sT]}if(L.isUndefined(ZC[sM][sT][sST])){continue}return ZC[sM][sT][sST]}YAHOO.log("Unable to load component ("+[sCmpName,sModule,sType].join(", ")+")","warn","ZC.JSManager#GetComponent");return undefined},LoadYUILib:function(oConfig){var oYUILoader=this.GetCSO("YUILoader"),fnConstructor;if(L.isUndefined(oYUILoader)){fnConstructor=ZC.JSManager.GetComponent("YUILoader","Core","ClientSideObject");if(!fnConstructor){YAHOO.log("Unable to locate YUILoader CSO","error","ZC.JSManager");return false}this.aClientSideObjects.YUILoader=new fnConstructor(aDef)}oYUILoader.LoadYUILib(oConfig)},GetBlockByUniqueID:function(sUniqueID){for(var sName in this.aBlocks){if(L.hasOwnProperty(this.aBlocks,sName)){if(this.aBlocks[sName].UniqueID()==sUniqueID){return this.aBlocks[sName]}var oChildBlock=this.aBlocks[sName].GetBlockByUniqueID(sUniqueID);if(oChildBlock){return oChildBlock}}}return undefined},GetBlocksBy:function(fnMethod,mRoot,oScope){var aBlocks=[],aRoot=false;if(!L.isUndefined(mRoot)){if(L.isString(mRoot)){mRoot=this.GetBlockByUniqueID(mRoot)}if(L.isObject(mRoot)){aRoot=mRoot.aChildBlocks}}else{aRoot=this.aBlocks}if(!aRoot){return[]}ZC.Util.ForEach(aRoot,function(oBlock){if(fnMethod.call(oScope,oBlock)){aBlocks.push(oBlock)}aBlocks=aBlocks.concat(ZC.JSManager.GetBlocksBy(fnMethod,oBlock,oScope))});return aBlocks},_aSearchObjects:["aForms","aBlocks"],GetCSO:function(sSearch){return this.aClientSideObjects[sSearch]},GetEvent:function(sName){if(L.isUndefined(this.aEvents[sName])){this.aEvents[sName]=new YAHOO.util.CustomEvent(sName)}return this.aEvents[sName]},GetValidator:function(sName){if(L.isUndefined(this.oValidatorRegex)){this.oValidatorRegex=/^(.*)_Validator_(.*)$/}return this._GetValidator(sName,this.aValidators,this.oValidatorRegex)},GetFormValidator:function(sName){if(L.isUndefined(this.oFormValidatorRegex)){this.oFormValidatorRegex=/^(.*)_FormValidator_(.*)$/}return this._GetValidator(sName,this.aFormValidators,this.oFormValidatorRegex)},_GetValidator:function(sName,aValidators,oValidatorRegex){if(!L.isUndefined(aValidators[sName])){return aValidators[sName]}var aMatches=oValidatorRegex.exec(sName);if(!aMatches){if(L.isUndefined(ZC.Core.Validator[sName])){return undefined}return(aValidators[sName]=new ZC.Core.Validator[sName]())}else{if(L.isUndefined(ZC[aMatches[1]])||L.isUndefined(ZC[aMatches[1]].Validator)||L.isUndefined(ZC[aMatches[1]].Validator[aMatches[2]])){return undefined}return(aValidators[sName]=new ZC[aMatches[1]].Validator[aMatches[2]]())}},URL:function(oParams,sURL){var iQSPos,fnURLArray,aParamParts;oParams=oParams||{};sURL=sURL||window.location.href.replace(/(\?|#).*/,"");if(L.isString(oParams)){oParams=this.ParseQueryString(oParams)}if(this.oConfig.StateID&&L.isUndefined(oParams._ts)){oParams._ts=this.oConfig.StateID}if(sURL.lastIndexOf("/")==(sURL.length-1)){sURL+=ZC.JSManager.oConfig.PAGE_INDEX}iQSPos=sURL.indexOf("?");if(iQSPos>-1){oParams=L.merge(this.ParseQueryString(sURL.substr(iQSPos+1)),oParams);sURL=sURL.substr(0,iQSPos)}fnEncodeURLParams=function(mVar,sArg){if(mVar.length==0){return""}var aParamParts=[];U.ForEach(mVar,function(Value,Key){if(L.isObject(Value)&&Value.GetValue){Value=Value.GetValue()}var sQSVar=(sArg?sArg+"["+Key+"]":Key);if(L.isArray(Value)||L.isObject(Value)){aParamParts.push(fnEncodeURLParams(Value,sQSVar))}else{aParamParts.push(encodeURIComponent(sQSVar)+"="+encodeURIComponent(Value))}});return aParamParts.join("&")};sURL=sURL+"?"+fnEncodeURLParams(oParams);return sURL},ParseQueryString:function(sParamString){var aTmpParams=sParamString.split(/&/),oParams={};U.ForEach(aTmpParams,function(sParamPair){var aPair=U.Map(sParamPair.split(/=/,2),decodeURIComponent);if(!aPair[0].length||!L.isUndefined(oParams[aPair[0]])){return }oParams[aPair[0]]=aPair[1]||""});return oParams},Alert:U.Alert,CreateDialog:function(sCaption,elBody,elContainer,oConfig){var elDialogContainer=document.createElement("div"),elDialogHeader=document.createElement("div"),elDialogBody=document.createElement("div"),oDialog,fnConstructor;if(!elContainer.appendChild){throw new Error("Invalid elContainer: "+L.dump(elContainer))}elDialogHeader.className="hd";elDialogHeader.innerHTML=sCaption;elDialogBody.className="bd clearfix";if(L.isString(elBody)){elDialogBody.innerHTML=elBody}else{elDialogBody.appendChild(elBody)}elDialogContainer.appendChild(elDialogHeader);elDialogContainer.appendChild(elDialogBody);(elContainer||document.body).appendChild(elDialogContainer);oConfig=L.merge({close:true,draggable:true,visible:false},(oConfig||{}));if(L.isUndefined(oConfig.effect)&&YAHOO.env.getVersion("animation")){oConfig.effect={effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}}fnConstructor=YAHOO.widget.Panel;if(!L.isUndefined(oConfig.buttons)){fnConstructor=YAHOO.widget.Dialog}oDialog=new fnConstructor(elDialogContainer,oConfig);Dom.addClass(oDialog.element,YAHOO.widget.Dialog.CSS_DIALOG);Dom.addClass(oDialog.element,YAHOO.widget.Overlay.CSS_HIDDEN);this.oOverlayManager.register(oDialog);oDialog.render();oDialog.hide();return oDialog},DestroyDialog:function(oDialog){if(oDialog&&oDialog.element){this.oOverlayManager.remove(oDialog);oDialog.body.innerHTML=" ";oDialog.destroy(true)}}};L.augmentObject(ZC.JSManager,GetWidgetProvider.prototype);ZC.Core.Block=function(sName,aDef,oParent){this.sName=("_blk_name" in aDef)?aDef._blk_name:sName;this.aDef=aDef;this.oParent=oParent;this.aChildBlocks={};this.aWidgets={};this.aForms={};if(!this.CustomSetupStart()){throw new Error("CustomSetupStart returned false")}this.ProcessConfig(aDef,true);if(!this.CustomSetupEnd()){try{this.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}throw new Error("CustomSetupEnd returned false")}this.AttribProviderSetup()};ZC.Core.Block.NewFromDef=function(sName,aDef,oParent){var fnConstructor;if(!L.isUndefined(aDef.Type)){fnConstructor=ZC.JSManager.GetComponent(aDef.Type,aDef.Module||"Core","Block")}if(L.isUndefined(fnConstructor)){fnConstructor=ZC.Core.Block}return new fnConstructor(sName,aDef,oParent)};ZC.Core.Block.Create=function(sBlockClassName,sModule,oParentClass,sType){sModule=sModule||"Core";oParentClass=oParentClass||ZC.Core.Block;sType=sType||"Block";var oNS=ZC.Namespace(sModule+"."+sType);oNS[sBlockClassName]=function(sName,aDef,oForm,oParent){oNS[sBlockClassName].superclass.constructor.call(this,sName,aDef,oForm,oParent)};L.extend(oNS[sBlockClassName],oParentClass);return oNS[sBlockClassName]};ZC.Core.Block.prototype={CustomSetupStart:function(){return true},ProcessConfig:function(aDef,bConstructor){if(!L.isUndefined(aDef.Blocks)){YAHOO.log("Started initialising child blocks","debug",this.sName);U.ForEach(aDef.Blocks,function(aBlockDef,sBlockName){if(L.isUndefined(this.aChildBlocks[sBlockName])||!Dom.inDocument(this.aChildBlocks[sBlockName].GetElement())){if(!L.isUndefined(this.aChildBlocks[sBlockName])){try{this.aChildBlocks[sBlockName].Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}this.aChildBlocks[sBlockName]=null;delete this.aChildBlocks[sBlockName]}try{this.AddChildBlock(sBlockName,aBlockDef)}catch(ex){YAHOO.log("Unable to add block "+sBlockName+" to "+this.sName+": "+ex.message+" ("+ex.fileName+":"+ex.lineNumber+")","error",this.sName)}}else{this.aChildBlocks[sBlockName].ProcessConfig(aBlockDef)}},this);YAHOO.log("Finished initialising child blocks","debug",this.sName);delete aDef.Blocks}if(!L.isUndefined(aDef.Widgets)){YAHOO.log("Started initialising widgets","debug",this.sName);U.ForEach(aDef.Widgets,function(aWidgetDef,sWidgetName){if(L.isUndefined(this.aWidgets[sWidgetName])||!Dom.inDocument(this.aWidgets[sWidgetName]._elInput)){if(!L.isUndefined(this.aWidgets[sWidgetName])){try{this.aWidgets[sWidgetName].Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}this.aWidgets[sWidgetName]=null;delete this.aWidgets[sWidgetName]}try{this.aWidgets[sWidgetName]=ZC.Core.Widget.NewFromDef(sWidgetName,aWidgetDef,undefined,this)}catch(ex){YAHOO.log("Unable to add widget "+sWidgetName+" to "+this.sName+": "+ex.message+" ("+ex.fileName+":"+ex.lineNumber+")","error",this.sName)}}else{this.aWidgets[sWidgetName].ProcessConfig(aWidgetDef)}},this);YAHOO.log("Finished initialising widgets","debug",this.sName);delete aDef.Widgets}if(!L.isUndefined(aDef.Forms)){YAHOO.log("Started initialising forms","debug",this.sName);U.ForEach(aDef.Forms,function(aFormDef,sFormName){if(L.isUndefined(this.aForms[sFormName])||!this.aForms[sFormName]||!Dom.inDocument(this.aForms[sFormName]._elInput)){if(!L.isUndefined(this.aForms[sFormName])&&this.aForms[sFormName]){try{this.aForms[sFormName].Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}this.aForms[sFormName]=null;delete this.aForms[sFormName]}try{this.aForms[sFormName]=new ZC.Core.Form(sFormName,aFormDef,this);ZC.JSManager.RegisterForm(this.aForms[sFormName])}catch(ex){YAHOO.log("Unable to add form "+sFormName+" to "+this.sName+": "+ex.message+" ("+ex.fileName+":"+ex.lineNumber+")","error",this.sName)}}else{this.aForms[sFormName].ProcessConfig(aFormDef)}},this);YAHOO.log("Finished initialising forms","debug",this.sName);delete aDef.Forms}if(!L.isUndefined(aDef.EventListeners)){this.AddEventListeners(aDef.EventListeners);delete aDef.EventListeners}if(!L.isUndefined(aDef.Events)){this.AddEvents(aDef.Events);delete aDef.Events}if(!bConstructor){this.SetAttribs(aDef)}},AddChildBlock:function(sBlockName,aBlockDef){return(this.aChildBlocks[sBlockName]=ZC.Core.Block.NewFromDef(sBlockName,aBlockDef,this))},CustomSetupEnd:function(){return true},Destruct:function(){this.EventProviderDestruct();U.ForEach(this.aChildBlocks,function(oBlock){try{oBlock.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}});U.ForEach(this.aWidgets,function(oWidget){try{oWidget.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}});U.ForEach(this.aForms,function(oForm){try{oForm.Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}});if(!L.isUndefined(this._ajaxDialog)){ZC.JSManager.DestroyDialog(this._ajaxDialog);this._ajaxDialog=undefined}this.oParent=null;this.aChildBlocks={};this.aWidgets={};this.aForms={};this.elBlock=null},_IDPrefix:"blk",GetElement:function(){if(L.isUndefined(this.elBlock)){this.elBlock=Dom.get(this._IDPrefix+this.UniqueID())}return this.elBlock},GetEventElement:function(){return this.GetElement()},UniqueID:function(){if(this.AttribIsset("BlockID")){return this.GetAttrib("BlockID").toString()}else{if(this.oParent){return this.oParent.UniqueID()+"_"+this.sName}else{return this.sName}}},GetBlockByUniqueID:function(sUniqueID){for(var sName in this.aChildBlocks){if(L.hasOwnProperty(this.aChildBlocks,sName)){if(this.aChildBlocks[sName].UniqueID()==sUniqueID){return this.aChildBlocks[sName]}var oChildBlock=this.aChildBlocks[sName].GetBlockByUniqueID(sUniqueID);if(oChildBlock){return oChildBlock}}}return undefined},AjaxRequest:function(oParams){var fnRequestSuccess,sServerError="",fnFormatErrors=function(oErr){sServerError+=oErr.Message;if(oErr.Backtrace){sServerError+=oErr.Backtrace}sServerError+="<br><br>"};if(L.isUndefined(oParams)){oParams={}}if(L.isString(oParams)){oParams={Transaction:oParams}}if(L.isUndefined(oParams.OnComplete)){oParams.OnComplete=function(){}}if(L.isUndefined(oParams.OnSuccess)){oParams.OnSuccess=function(){}}if(L.isUndefined(oParams.Scope)){oParams.Scope=this}if(L.isUndefined(oParams.LoadingIndicator)){oParams.LoadingIndicator=U.DefaultLoadingIndicator}if(L.isUndefined(oParams.OnFailure)){if(ZC.JSManager.oConfig.DEBUG){oParams.OnFailure=function(iCode,sStatus,oResp){if(iCode!=-2&&oResp&&oResp.responseText){try{oJSONResponse=YAHOO.lang.JSON.parse(oResp.responseText);if(oJSONResponse.Errors){U.ForEach(oJSONResponse.Errors,fnFormatErrors)}}catch(e){}}else{if(iCode==-2){sServerError=oResp.responseText}}U.Alert("AJAX processing error: "+iCode+" "+sStatus+"<br>"+sServerError+"<br>"+(oResp?oResp.responseXML:""),{width:"800px"})}}else{oParams.OnFailure=function(){}}}fnRequestSuccess=function(oResp){var Get=YAHOO.util.Get,oParams=oResp.argument,sResponseText,oJSONResponse,oOnLoadEvent=ZC.JSManager.GetEvent("OnLoadEvent"),fnLoadJS,fnLoadCSS,fnProcessBlocks;oOnLoadEvent.unsubscribeAll();fnLoadJS=function(){YAHOO.log("Loading JS..","debug","AjaxRequest");var aJS=U.Filter(oJSONResponse.LoadJS,function(sJS){if(!sJS.match(/^https?:\/\//)){var sPort="";if(window.location.port!=80&&window.location.port!=443){sPort=":"+window.location.port}sJS=window.location.protocol+"//"+window.location.hostname+sPort+sJS}return L.isArray(Dom.getElementBy(function(el){return(el.src==sJS)},"script",document.getElementsByTagName("head")[0]))});Get.script(aJS,{onSuccess:fnLoadCSS,onFailure:function(o){oParams.LoadingIndicator.Hide();oParams.OnComplete.call(oParams.Scope,oResp);if(!ZC.JSManager.bUnloading){oParams.OnFailure.call(oParams.Scope,-4,"JS loading error: "+o.msg,oResp)}},scope:this})};fnLoadCSS=function(){YAHOO.log("Loading CSS..","debug","AjaxRequest");U.ForEach(oJSONResponse.LoadCSSMedia,function(sMedia,iIndex){var aCSS,elHead,oGetDef={attributes:{media:sMedia},onFailure:function(o){oParams.LoadingIndicator.Hide();oParams.OnComplete.call(oParams.Scope,oResp);if(!ZC.JSManager.bUnloading){oParams.OnFailure.call(oParams.Scope,-5,"CSS loading error: "+o.msg,oResp)}},scope:this};if(iIndex==(oJSONResponse.LoadCSSMedia.length-1)){oGetDef.onSuccess=fnProcessBlocks}elHead=document.getElementsByTagName("head")[0];aCSS=U.Filter(oJSONResponse.LoadCSS[sMedia],function(sCSS){var iLen=sCSS.length;return L.isArray(Dom.getElementBy(function(el){var iLen2=el.href.length;if(iLen2<iLen){return false}return(el.href.substr(iLen2-iLen)==sCSS)},"link",elHead))});elHead=null;Get.css(aCSS,oGetDef)},this)};fnProcessBlocks=function(){YAHOO.log("Processing block updates","debug","AjaxRequest");var oFinishEvent=new YAHOO.util.CustomEvent(),oFinishTimer;oFinishEvent._updateAnimDone=true;U.ForEach(oJSONResponse.Blocks,function(aBlockData,sBlockUID){YAHOO.log("Processing updates for "+sBlockUID,"debug","AjaxRequest");var oBlock;if(L.isFunction(this.UniqueID)&&sBlockUID==this.UniqueID()){oBlock=this}else{oBlock=ZC.JSManager.GetBlockByUniqueID(sBlockUID)}if(oBlock){oBlock.ProcessAjaxResponse(aBlockData,oParams.CustomObj,oFinishEvent)}else{YAHOO.log("Unable to find block with ID "+sBlockUID,"error","ProcessAjaxResponse")}},this);oFinishTimer=L.later(100,this,function(){if(oFinishEvent._updateAnimDone){oFinishEvent.fire();oOnLoadEvent.fire();oParams.LoadingIndicator.Hide();oParams.OnComplete.call(oParams.Scope);oParams.OnSuccess.call(oParams.Scope);oFinishTimer.cancel()}},{},true)};try{YAHOO.log("Parsing JSON response","debug","AjaxRequest");oJSONResponse=YAHOO.lang.JSON.parse(oResp.responseText);YAHOO.log("Parsed OK","debug","AjaxRequest")}catch(e){oParams.LoadingIndicator.Hide();oParams.OnComplete.call(oParams.Scope,oResp);oParams.OnFailure.call(oParams.Scope,-2,"JSON parse error",oResp);return }if(oJSONResponse.GoToPage){YAHOO.log("Redirecting to "+oJSONResponse.GoToPage,"debug","AjaxRequest");window.location=oJSONResponse.GoToPage;return }if(ZC.JSManager.oConfig.DEBUG&&oJSONResponse.Errors){U.ForEach(oJSONResponse.Errors,fnFormatErrors);U.Alert(sServerError,{width:"800px"})}if(!L.isUndefined(oJSONResponse.StateID)){ZC.JSManager.oConfig.StateID=oJSONResponse.StateID}ZC.JSManager.LoadYUILib({require:U.Filter(oJSONResponse.LoadYUI,function(sReq){return(YAHOO.env.getVersion(sReq)==null)}),onSuccess:fnLoadJS,onFailure:function(o){oParams.LoadingIndicator.Hide();oParams.OnComplete.call(oParams.Scope,oResp);if(!ZC.JSManager.bUnloading){oParams.OnFailure.call(oParams.Scope,-3,"YUI loading error: "+o.msg,oResp)}},scope:this})};ZC.JSManager.LoadYUILib({require:["connection","json"],scope:this,onFailure:function(o){U.Alert(o.msg)},onSuccess:function(){var Connect=YAHOO.util.Connect,bUseFileUpload,bSecure,aListeners,oGetPostVars=oParams.GetPostVars||{},oCallback={scope:this,argument:oParams,timeout:15000,failure:function(o){oParams.LoadingIndicator.Hide();oParams.OnComplete.call(oParams.Scope,o);if(!ZC.JSManager.bUnloading){oParams.OnFailure.call(oParams.Scope,o.status,o.statusText,o)}},upload:function(o){var b=o.responseXML.body;o.responseText=(b.textContent||b.innerText);fnRequestSuccess.call(this,o)},success:fnRequestSuccess};
/*@cc_on
					Connect.initHeader("X-IE-Version", YAHOO.env.ua.ie);
				@*/
if(L.isString(oGetPostVars)){oGetPostVars=ZC.JSManager.ParseQueryString(oGetPostVars)}if(!L.isUndefined(oParams.Form)){var elForm=oParams.Form._elInput;if(!L.isUndefined(YAHOO.widget.Button)){YAHOO.widget.Button.addHiddenFieldsToForm(elForm)}bUseFileUpload=(elForm.enctype=="multipart/form-data");bSecure=(bUseFileUpload&&YAHOO.env.ua.ie&&window.location.protocol.toLowerCase()=="https:");Connect.setForm(elForm,bUseFileUpload,bSecure);var oEndWidget=oParams.Form.GetSelectedEndWidget();if(oEndWidget){oGetPostVars._ajaxEndWidget=oEndWidget.sName}oParams.URL=oParams.URL||oParams.Form.action;oParams.Method=oParams.Method||oParams.Form.method}if(oParams.Transaction){oGetPostVars._ajaxTr=oParams.Transaction}if(oParams.Poll){oGetPostVars._ajaxPoll=1}else{oGetPostVars._ajaxBlk=this.UniqueID()}Connect.asyncRequest(oParams.Method||"POST",ZC.JSManager.URL(oGetPostVars,(oParams.URL||window.location.href.replace(/#.*$/,""))),oCallback);oParams.LoadingIndicator.Show()}})},AjaxPoll:function(){this.AjaxRequest({Poll:true})},ProcessAjaxResponse:function(oResponse,oCustom,oFinishEvent){U.ForEach(oResponse,function(oData,sAction){switch(sAction){case"UpdateElement":U.ForEach(oData,function(oContent,sID){oFinishEvent._updateAnimDone=false;oContent.OnComplete=function(){oFinishEvent._updateAnimDone=true};U.UpdateElement(sID,oContent)});break;case"Alert":U.Alert(oData.Message,oData);break;case"Dialog":if(!L.isUndefined(this._ajaxDialog)){ZC.JSManager.DestroyDialog(this._ajaxDialog)}this._ajaxDialog=ZC.JSManager.CreateDialog(oData.Header,oData.Body,document.body,oData);this._ajaxDialog.setFooter(oData.Footer);ZC.JSManager.GetEvent("OnLoadEvent").subscribe(function(){this.show();this.focus()},this._ajaxDialog,true);var aForms=this._ajaxDialog.element.getElementsByTagName("form");if(aForms){U.ForEach(aForms,function(elForm){elForm._ajaxDialog=this._ajaxDialog},this)}break;case"ProcessConfig":oFinishEvent.subscribe(function(){this.ProcessConfig(oData)},this,true);break;case"ScheduleRequest":if(L.isUndefined(this._aScheduledRequests)){this._aScheduledRequests=[]}U.ForEach(oData,function(mRequest){if(!U.Some(this._aScheduledRequests,function(o){return U.ObjectsEqual(o,mRequest)})){this._aScheduledRequests.push(mRequest)}},this);if(L.isUndefined(this._oScheduledRequestTimer)){this._oScheduledRequestTimer=oFinishEvent.subscribe(this._RunScheduledRequests,this,true)}break;case"FireEvent":U.ForEach(oData,function(aParamObjects,sEventName){var oEvent=ZC.JSManager.GetEvent(sEventName);U.ForEach(aParamObjects,oEvent.fire,oEvent)});break;case"PopulateForm":U.ForEach(oData,function(oArgs,sFormName){var oForm=this.GetWidget(sFormName);if(oForm){oForm.PopulateFromArray(oArgs.Values,oArgs.Original)}},this)}},this)},_RunScheduledRequests:function(){var mRequest;while(mRequest=this._aScheduledRequests.shift()){this.AjaxRequest(mRequest)}this._oScheduledRequestTimer=undefined},_aSearchObjects:["aWidgets","aChildBlocks","aForms"]};L.augment(ZC.Core.Block,AttribProvider);L.augment(ZC.Core.Block,GetWidgetProvider);L.augment(ZC.Core.Block,EventProvider);ZC.Core.Layout=function(sName,aDef,oParent){ZC.Core.Layout.superclass.constructor.call(this,sName,aDef,oParent)};L.extend(ZC.Core.Layout,ZC.Core.Block);ZC.Core.Page=function(sName,aDef,oParent){ZC.Core.Page.superclass.constructor.call(this,sName,aDef,oParent)};L.extend(ZC.Core.Page,ZC.Core.Block);ZC.Core.Widget=function(sName,aDef,oForm,oParent){this.sName=sName;this.aDef=aDef;this.oParent=oParent;this.oForm=oForm;this.aChildWidgets={};this.bEnabled=true;this._FindElements();if(!this.CustomSetupStart()){throw new Error("CustomSetupStart returned false")}this.ProcessConfig(this.aDef,true);if(!L.isUndefined(aDef.ValidateOnEvents)){this.AddEvent(this.Validate,aDef.ValidateOnEvents,this)}if(!this.CustomSetupEnd()){throw new Error("CustomSetupEnd returned false")}this.AttribProviderSetup()};ZC.Core.Widget.Create=function(sWidgetClassName,sModule,oParentClass){sModule=sModule||"Core";oParentClass=oParentClass||ZC.Core.Widget;var oNS=ZC.Namespace(sModule+".Widget");oNS[sWidgetClassName]=function(){oNS[sWidgetClassName].superclass.constructor.apply(this,arguments)};L.extend(oNS[sWidgetClassName],oParentClass);return oNS[sWidgetClassName]};ZC.Core.Widget.NewFromDef=function(sName,aDef,oForm,oParent){var fnConstructor=ZC.JSManager.GetComponent(aDef.WidgetType||aDef.Type,aDef.Module,"Widget");if(L.isUndefined(fnConstructor)){fnConstructor=ZC.Core.Widget}return new fnConstructor(sName,aDef,oForm,oParent)};ZC.Core.Widget.prototype={CustomSetupStart:function(){return true},ProcessConfig:function(aDef,bConstructor){if(!L.isUndefined(aDef.Widgets)){U.ForEach(aDef.Widgets,function(aWidgetDef,sWidgetName){if(L.isUndefined(this.aChildWidgets[sWidgetName])||!Dom.inDocument(this.aChildWidgets[sWidgetName]._elInput)){if(!L.isUndefined(this.aChildWidgets[sWidgetName])){try{this.aChildWidgets[sWidgetName].Destruct()}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}this.aChildWidgets[sWidgetName]=null;delete this.aChildWidgets[sWidgetName]}try{this.AddChildWidget(sWidgetName,aWidgetDef)}catch(ex){YAHOO.log("Unable to add widget "+sWidgetName+" to "+this.sName+": "+ex.message+" ("+ex.fileName+":"+ex.lineNumber+")","error",this.sName)}}else{this.aChildWidgets[sWidgetName].ProcessConfig(aWidgetDef)}},this);delete aDef.Widgets}if((!this._elInput||(L.isArray(this._elInput)&&this._elInput.length==0))&&!this.HasChildWidgets()){throw new Error("No input element or child widgets")}if(!L.isUndefined(aDef.EventListeners)){this.AddEventListeners(aDef.EventListeners);delete aDef.EventListeners}if(L.isUndefined(aDef.Validation)){aDef.Validation={}}else{if(L.isString(aDef.Validation)){var sValidator=aDef.Validation;aDef.Validation={};aDef.Validation[sValidator]=null}else{var oNumberRegex=/^\d+$/;U.ForEach(aDef.Validation,function(sValidator,Key,aValidation){if(oNumberRegex.test(Key)){aValidation[sValidator]=null;delete aValidation[Key]}})}}this.aDef.Validation=L.merge(this.aDef.Validation||{},aDef.Validation);if(!L.isUndefined(aDef.Events)){this.AddEvents(aDef.Events);delete aDef.Events}if(!bConstructor){this.SetAttribs(aDef)}},CustomSetupEnd:function(){return true},Destruct:function(){try{U.ForEach(this.aChildWidgets,function(oWidget){oWidget.Destruct()})}catch(e){YAHOO.log("Error during destruction: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}this.EventProviderDestruct();this.oParent=null;this.oForm=null;this.aChildWidgets={};this._elInput=null;this.elContainer=null;this.elValidationContainer=null;this.elRODisplay=null},ID:function(){var aArgs=arguments;var sID="";if(!L.isUndefined(this.aDef.ID)){sID=this.aDef.ID}else{if(!L.isUndefined(this.oForm)){sID+=this.oForm.sName+"."}if(this.AttribIsset("HTMLNamePrefix")){sID+=this.GetAttrib("HTMLNamePrefix")}sID+=this.sName}if(!L.isUndefined(aArgs[0])){sID+=aArgs[0]}return sID.replace(/[ ,()/]/g,"")},_WidgetNameToID:function(){var aArgs=arguments;if(!L.isUndefined(aArgs[0])){return this.ID(aArgs[0])}else{return this.ID()}},_FindElements:function(){var sID=this._WidgetNameToID();this._elInput=Dom.get(sID);if(this._elInput){this._FindContainers()}},bChangeRODisplay:true,_FindContainers:function(){var elInput;if(L.isArray(this._elInput)){if(this._elInput.length&&this._elInput[0]){elInput=this._elInput[0]}else{return }}else{if(this._elInput){elInput=this._elInput}else{return }}if(L.isUndefined(this.elContainer)){if(this.oParent&&this.oParent instanceof ZC.Core.Widget.Group&&this.oParent._elInput){this.elContainer=this.oParent._elInput}else{this.elContainer=Dom.getAncestorByClassName(elInput,"form_field")||Dom.get("tr_"+elInput.id)||elInput.parentNode}}if(this.elContainer){if(L.isUndefined(this.elContainer._zcRefCount)){this.elContainer._zcRefCount=1}else{++this.elContainer._zcRefCount}this.elValidationContainer=Dom.get(this.GetAttribDefault("ValidationID",elInput.id+"_validation"));if(!this.elValidationContainer){var aValContainers=Dom.getElementsByClassName("form_validation",null,this.elContainer);if(!aValContainers.length){aValContainers=Dom.getElementsByClassName("validation",null,this.elContainer)}if(aValContainers.length){this.elValidationContainer=aValContainers[0]}else{if(!this.aDef.NoCreateValidation){this.elValidationContainer=document.createElement("span");this.elValidationContainer.className="form_validation hide";elInput.parentNode.appendChild(this.elValidationContainer)}}}}this.elRODisplay=Dom.get(elInput.id+"_rodisplay");if(this.elRODisplay&&this.bChangeRODisplay){this.AddEvent(function(){this.elRODisplay.innerHTML=this.GetHTMLValue()},"change",this)}},GetValue:function(){if(!this._elInput||L.isUndefined(this._elInput.value)){return undefined}return this._elInput.value},HasValue:function(){var mValue=this.GetValue();if(L.isString(mValue)){mValue=mValue.replace(/(^\s*|\s*$)/g,"")}else{if(mValue===0){return true}}return Boolean(mValue)},SetValue:function(Value){if(!this._elInput||L.isUndefined(this._elInput.value)){return undefined}if(Value==this._elInput.value){return }this._elInput.value=Value;this._bIsValid=undefined;this._FireEventHandlers("change")},GetTextValue:function(){return this.GetValue()},GetHTMLValue:function(){return this.GetTextValue()},GetCaption:function(){if(this.aDef.Caption){return this.aDef.Caption}if(this._elInput){var elLabel=this.GetLabelEl();return L.isUndefined(elLabel)?undefined:(elLabel.innerText||elLabel.textContent)}return undefined},GetLabelEl:function(){var sInputId=this._WidgetNameToID(),elLabel;elLabel=Dom.getElementBy(function(el){return Dom.getAttribute(el,"for")==sInputId},"label");if(!elLabel&&this._elInput){Dom.batch(this._elInput,function(elInput){elLabel=elLabel||Dom.getElementBy(function(el){return Dom.getAttribute(el,"for")==elInput.id},"label")})}return elLabel},IsReadOnly:function(){return(this.GetAttribDefault("DisplayAs","").toLowerCase()=="readonly")},Clear:function(){if(!this._elInput&&!this.HasChildWidgets()){return }if(this._elInput&&this._elInput.type){var sInputType=L.isArray(this._elInput)?"array":this._elInput.type.toLowerCase();if(sInputType!="button"&&sInputType!="submit"){this.SetValue("")}}U.ForEach(this.aChildWidgets,function(oWidget){oWidget.Clear()})},Enable:function(bEnable,sEnableClass,sDisableClass){if(!this._elInput&&!this.HasChildWidgets()){return undefined}if(L.isUndefined(bEnable)){bEnable=true}this.bEnabled=bEnable;if(this._elInput){Dom.batch(this._elInput,function(el){if(L.isUndefined(el.parentNode)||!el.parentNode){return }if(L.isUndefined(el.parentNode.tagName)||!el.parentNode.tagName){return }if(!bEnable){el.blur()}el.disabled=!bEnable})}var sAddClass=bEnable?sEnableClass:sDisableClass;var sRemoveClass=bEnable?sDisableClass:sEnableClass;this.ReplaceClass(sRemoveClass,sAddClass);this._EventDispatcher("EnableDisable",bEnable)},Disable:function(sEnableClass,sDisableClass){this.Enable(false,sEnableClass,sDisableClass)},AttribMethod_Disabled:function(bValue){this.Enable(!bValue)},IsEnabled:function(){return this.bEnabled},Show:function(bShow){if(L.isUndefined(bShow)){bShow=true}if(bShow){Dom.removeClass(this.elContainer,"hide");if(this.GetAttribDefault("Overlabel")){this._ShowOverlabel(this.GetValue()==="")}}else{Dom.batch(this.elContainer,function(el){el.blur();Dom.addClass(el,"hide")});this._ShowOverlabel(false)}U.ForEach(this.aChildWidgets,function(oWidget){oWidget.Show(bShow)});this._EventDispatcher("ShowHide",bShow)},Hide:function(){this.Show(false)},AttribMethod_Visible:function(bValue){this.Show(bValue)},AttribMethod_Caption:function(sCaption){var elLabel=this.GetLabelEl();if(elLabel){if(this.HasValidator("NotBlank")){sCaption+=this.GetAttribDefault("RequiredSuffix",(ZC.JSManager.oConfig.REQUIRED_FIELD_CAPTION_SUFFIX||" *"))}elLabel.innerHTML=sCaption}},AttribMethod_Overlabel:function(bEnabled){var elLabel,bShow;if(bEnabled){if(this._elInput&&!L.isArray(this._elInput)&&(elLabel=this.GetLabelEl())){Dom.addClass(elLabel,"zcOverlabel");this._ShowOverlabel(this.GetValue()===""&&this.IsVisible());this.AddEvent(function(){this._ShowOverlabel(false)},"focus",this);this.AddEvent(function(){if(this.GetValue()===""){this._ShowOverlabel(true)}},"blur",this);if(YAHOO.env.ua.webkit){Evt.on(elLabel,"click",function(){this.focus()},this._elInput,true)}}else{this.SetAttrib("Overlabel",false)}}else{Dom.removeClass(elLabel,"zcOverlabel");Dom.setStyle(elLabel,"text-indent","0px")}},_ShowOverlabel:function(bShow){var elLabel=this.GetLabelEl(),oRegion,aXY;if(L.isUndefined(bShow)){bShow=true}if(bShow){oRegion=Dom.getRegion(this._elInput);aXY=[oRegion.x+5,oRegion.y];if(!YAHOO.env.ua.ie){aXY[1]+=5}Dom.setXY(elLabel,aXY)}Dom.setStyle(elLabel,"text-indent",(bShow)?"0px":"-4000px")},IsVisible:function(){return !(Dom.hasClass(this._elInput,"hide")||Dom.hasClass(this.elContainer,"hide"))},AddClass:function(sClassName){if(this.elContainer._zcRefCount==1){Dom.addClass(this.elContainer,sClassName)}if(this._elInput){Dom.addClass(this._elInput,sClassName)}},RemoveClass:function(sClassName){if(this.elContainer._zcRefCount==1){Dom.removeClass(this.elContainer,sClassName)}if(this._elInput){Dom.removeClass(this._elInput,sClassName)}},ReplaceClass:function(sOldClass,sNewClass){if(sNewClass){if(this.elContainer&&this.elContainer._zcRefCount==1){Dom.replaceClass(this.elContainer,sOldClass,sNewClass)}if(this._elInput){Dom.replaceClass(this._elInput,sOldClass,sNewClass)}}else{if(this.elContainer&&this.elContainer._zcRefCount==1){Dom.removeClass(this.elContainer,sOldClass)}if(this._elInput){Dom.removeClass(this._elInput,sOldClass)}}},Validate:function(){for(var sName in this.aDef.Validation){if(L.hasOwnProperty(this.aDef.Validation,sName)){var oValidator=ZC.JSManager.GetValidator(sName),Value=this.GetValue();if(L.isString(Value)){Value=U.Trim(Value)}if(!L.isUndefined(oValidator)&&!oValidator.Validate(Value,this)){this.SetValid(false,this.aDef.Validation[sName]||oValidator.GetDefaultValidationMsg());return false}}}try{var bValid=true;U.ForEach(this.aChildWidgets,function(oWidget){if(!oWidget.GetAttribDefault("SkipValidation")){bValid=oWidget.Validate()&&bValid}});this.SetValid(bValid);return bValid}catch(e){YAHOO.log("Error during validation: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName)}},IsValid:function(){if(L.isUndefined(this._bIsValid)){return this.Validate()}return this._bIsValid},HasBeenChanged:function(){return !U.ObjectsEqual(this.GetValue(),this.oForm.oOriginalValues[this.sName])},SetValid:function(bIsValid,sValMsg){var sOldClass,sNewClass,elValMsg;this._bIsValid=bIsValid;this.sValidationMessage=sValMsg;if(this.GetAttribDefault("ShowValidationStatus",true)){if(this.elContainer){var sOldClass=bIsValid?"invalid":"valid";var sNewClass=bIsValid?"valid":"invalid";Dom.replaceClass(this.elContainer,sOldClass,sNewClass)}if(this.elValidationContainer){if(!bIsValid&&sValMsg){elValMsg=document.createTextNode(sValMsg);if(this.elValidationContainer.firstChild){this.elValidationContainer.replaceChild(elValMsg,this.elValidationContainer.firstChild)}else{this.elValidationContainer.appendChild(elValMsg)}Dom.removeClass(this.elValidationContainer,"hide")}else{Dom.addClass(this.elValidationContainer,"hide")}}}},GetValidationMsg:function(){return this.sValidationMessage},GetEventElement:function(){return this._elInput},AddChildWidget:function(sName,aDef){this.aChildWidgets[sName]=ZC.Core.Widget.NewFromDef(sName,aDef,this.oForm,this)},RemoveChildWidget:function(sName){this.aChildWidgets[sName].Destruct();delete (this.aChildWidgets[sName])},HasChildWidgets:function(){for(var sName in this.aChildWidgets){if(L.hasOwnProperty(this.aChildWidgets,sName)){return true}}return false},FindContainingBlock:function(){if(this.oParent instanceof ZC.Core.Block){return this.oParent}else{if(!L.isUndefined(this.oForm)){return this.oForm.FindContainingBlock()}else{if(!L.isUndefined(this.oParent)){return this.oParent.FindContainingBlock()}else{return undefined}}}},HasValidator:function(sName){return !L.isUndefined((this.GetAttribDefault("Validation",{}))[sName])},_aSearchObjects:["aChildWidgets"]};L.augment(ZC.Core.Widget,AttribProvider);L.augment(ZC.Core.Widget,GetWidgetProvider);L.augment(ZC.Core.Widget,EventProvider);ZC.Core.Form=function(sName,aDef,oParent){var fnSubmitHandler,aHiddenIndices;if(L.isUndefined(aDef.ShowValidationStatus)){aDef.ShowValidationStatus=false}ZC.Core.Form.superclass.constructor.call(this,sName,aDef,this,oParent);fnSubmitHandler=function(oEvent){var oSelectedEndWidget=this.GetSelectedEndWidget();if(this.GetAttribDefault("ValidateOnSubmit")&&(!oSelectedEndWidget||!oSelectedEndWidget.GetAttribDefault("SkipValidation"))&&!this.IsValid()){this.SetSelectedEndWidget(undefined);Evt.stopEvent(oEvent);ZC.JSManager.Alert(_GT("There are still some errors on the form. Please check and re-submit."));return false}if(this.GetAttribDefault("SubmitWithAJAX")){Evt.preventDefault(oEvent);L.later(0,this,"AjaxSubmit");this.SetAttrib("SubmitWithAJAX",false)}return true};this.AddEvent(fnSubmitHandler,"submit",this,500);this.oOriginalValues=this.GetAllFieldValues();this.aHiddenFields={};aHiddenIndices={};Dom.getElementsBy(function(el){return(el.type=="hidden")},"input",this._elInput,function(el){var aMatches=el.name.match(/^(.*)\[(.*)\]$/);if(aMatches){if(L.isUndefined(this.aHiddenFields[aMatches[0]])){this.aHiddenFields[aMatches[0]]={}}if(aMatches[1]==""){if(L.isUndefined(aHiddenIndices[aMatches[0]])){aHiddenIndices[aMatches[0]]=0}aMatches[1]=aHiddenIndices[aMatches[0]]++}this.aHiddenFields[aMatches[0]][aMatches[1]]=el}else{this.aHiddenFields[el.name]=el}},this,true)};L.extend(ZC.Core.Form,ZC.Core.Widget);ZC.Core.Form.prototype.Destruct=function(){this.CloseAjaxDialog();this.oOriginalValues=null;U.ForEach(U.Keys(this.aHiddenFields),function(k){this.aHiddenFields[k]=null},this);this.aHiddenFields=null;ZC.Core.Form.superclass.Destruct.apply(this,arguments)};ZC.Core.Form.prototype.CloseAjaxDialog=function(){if(this._elInput&&this._elInput._ajaxDialog){ZC.JSManager.DestroyDialog(this._elInput._ajaxDialog);this._elInput._ajaxDialog=null}};ZC.Core.Form.prototype._WidgetNameToID=function(){return this.aDef.ID||this.sName};ZC.Core.Form.prototype.Enable=function(){var aArgs=arguments;U.ForEach(this.aChildWidgets,function(oWidget){oWidget.Enable.apply(oWidget,aArgs)})};ZC.Core.Form.prototype.GetAllFieldValues=function(){var oValues={};U.ForEach(this.aChildWidgets,function(oWidget){oValues[oWidget.sName]=oWidget.GetValue()});return oValues};ZC.Core.Form.prototype.PopulateFromArray=function(oValues,bOriginal){U.ForEach(oValues,function(Value,sFieldName){this.SetFieldValue(sFieldName,Value)},this);if(bOriginal){this.oOriginalValues=this.GetAllFieldValues()}};ZC.Core.Form.prototype.SetFieldValue=function(sFieldName,Value){if(!L.isUndefined(this.aChildWidgets[sFieldName])){this.aChildWidgets[sFieldName].SetValue(Value)}else{if(!L.isUndefined(this.aHiddenFields[sFieldName])){this.AddHiddenField(sFieldName,Value)}}};ZC.Core.Form.prototype.Clear=function(){var aArgs=arguments;U.ForEach(this.aChildWidgets,function(oWidget){oWidget.Clear.apply(oWidget,aArgs)})};ZC.Core.Form.prototype.Reset=function(){this.PopulateFromArray(this.oOriginalValues)};ZC.Core.Form.prototype.HasBeenChanged=function(){return !U.ObjectsEqual(this.oOriginalValues,this.GetAllFieldValues())};ZC.Core.Form.prototype.IsValid=function(){return this.Validate()};ZC.Core.Form.prototype.Validate=function(){try{var aValidation=this.GetAttribDefault("FormValidation",{}),bValid=true,sValidationMessage;U.ForEach(aValidation,function(oFormValParams,sName){var oValidator=ZC.JSManager.GetFormValidator(sName);if(!L.isUndefined(oValidator)&&!oValidator.Validate(oFormValParams,this)){bValid=false;sValidationMessage=this.GetAttribDefault("FormValidationMsg",oValidator.GetDefaultValidationMsg())}},this);U.ForEach(this.aChildWidgets,function(oWidget){if(!oWidget.GetAttribDefault("__IsField",true)){return }if(oWidget.AttribIsset("ValidationField")&&oWidget.AttribIsset("ValidationValue")){var oValidationWidget=this.GetWidget(oWidget.GetAttrib("ValidationField")),mValidationValue=oWidget.GetAttrib("ValidationValue"),mValidationFieldValue;if(oValidationWidget){mValidationFieldValue=oValidationWidget.GetValue()}else{YAHOO.log("Unable to find ValidationField "+oWidget.GetAttrib("ValidationField")+" for widget "+oWidget.sName,"warn");return }if(L.isArray(mValidationFieldValue)){if(mValidationFieldValue.length==1){mValidationFieldValue=mValidationFieldValue.pop()}else{YAHOO.log("Form::Validate(): "+oWidget.sName+" uses "+oValidationWidget.sName+" as a ValidationField but the latter returns an array of multiple values - the logic is undefined for this.","error");return }}if((L.isArray(mValidationValue)&&!U.InArray(mValidationFieldValue,mValidationValue))||(!L.isArray(mValidationValue)&&mValidationValue!=mValidationFieldValue)){return }}bValid=oWidget.Validate()&&bValid},this);this.SetValid(bValid,sValidationMessage);return bValid}catch(e){YAHOO.log("Error during validation: "+e.message+" ("+e.fileName+":"+e.lineNumber+")","warn",this.sName);return false}};ZC.Core.Form.prototype.AjaxSubmit=function(){if(!this.oParent||!this.oParent.AjaxRequest){return }var oAjaxRequestOptions,fnAjaxReset=function(){this.SetAttrib("SubmitWithAJAX",true)};oAjaxRequestOptions=L.merge({Form:this,OnComplete:fnAjaxReset,Scope:this},this.GetAttribDefault("ExtraAjaxRequestOptions",{}));this.oParent.AjaxRequest(oAjaxRequestOptions);if(!this.GetAttribDefault("KeepDialogOnSubmit")){this.CloseAjaxDialog()}};ZC.Core.Form.prototype.AddHiddenField=function(sName,mValue){var aResult={},fnAddHidden=function(sName,sValue){var elHidden;elHidden=document.createElement("input");elHidden.type="hidden";elHidden.name=sName;this.appendChild(elHidden);elHidden.value=sValue;return elHidden};if(!L.isUndefined(this.aHiddenFields[sName])){if("parentNode" in this.aHiddenFields[sName]){this.aHiddenFields[sName].parentNode.removeChild(this.aHiddenFields[sName])}else{U.ForEach(this.aHiddenFields[sName],function(el){el.parentNode.removeChild(el)})}}if(L.isArray(mValue)||L.isObject(mValue)){U.ForEach(mValue,function(sVal,sKey){aResult[sKey]=fnAddHidden.call(this,sName+"["+sKey+"]",sVal)},this._elInput);this.aHiddenFields[sName]=aResult}else{this.aHiddenFields[sName]=fnAddHidden.call(this._elInput,sName,String(mValue))}return this.aHiddenFields[sName]};ZC.Core.Form.prototype.SetSelectedEndWidget=function(oSelectedEndWidget){this.oSelectedEndWidget=oSelectedEndWidget};ZC.Core.Form.prototype.GetSelectedEndWidget=function(){return this.oSelectedEndWidget};ZC.Core.Form.prototype.FocusFirstElement=function(){var fnFilter=function(el){return el.tagName&&U.InArray(el.tagName.toLowerCase(),["input","select","textarea"])&&el.type!="hidden"&&!el.disabled};var aChildNodes=Dom.getElementsBy(fnFilter,false,this._elInput);if(aChildNodes.length==0){return }if(U.Some(aChildNodes,function(elNode){return(elNode.tabIndex&&elNode.tabIndex>0)})){var elLowestTabIndex;U.ForEach(aChildNodes,function(elNode){if(!elLowestTabIndex||elLowestTabIndex.tabIndex>elNode.tabIndex){elLowestTabIndex=elNode}});elLowestTabIndex.focus()}else{aChildNodes[0].focus()}};ZC.Core.Validator=function(){this.AttribProviderSetup()};ZC.Core.Validator.Create=function(sName,sModule){sModule=sModule||"Core";var oNS=ZC.Namespace(sModule+".Validator");oNS[sName]=function(){};L.extend(oNS[sName],ZC.Core.Validator);oNS[sName].sClassName=sModule+"_Validator_"+sName;return oNS[sName]};ZC.Core.Validator.prototype={GetDefaultValidationMsg:function(){return this.sDefaultValidationMessage||_GT("Invalid value")},Validate:function(Value,oWidget){if(L.isUndefined(this.oValidationRegex)){return undefined}if(Value instanceof Array){for(var Key in Value){if(L.hasOwnProperty(Value,Key)&&!this.oValidationRegex.test(Value[Key])){return false}}return true}else{return this.oValidationRegex.test(Value)}}};L.augment(ZC.Core.Validator,AttribProvider);ZC.Core.EventListener=function(oDestination,oEvent,aDef){this.oDestination=oDestination;this.oDestWidget=this.oDestination;this.oEvent=oEvent;this.aDef=aDef;if(this.Setup()){oEvent.subscribe(this._EventHandler,this,this)}else{throw new Error("Setup returned false")}this.AttribProviderSetup()};ZC.Core.EventListener.Create=function(sName,sModule){sModule=sModule||"Core";var oNS=ZC.Namespace(sModule+".EventListener");oNS[sName]=function(oDestination,oEvent,aDef){oNS[sName].superclass.constructor.call(this,oDestination,oEvent,aDef)};L.extend(oNS[sName],ZC.Core.EventListener);return oNS[sName]};ZC.Core.EventListener.prototype={Setup:function(){return true},Destruct:function(){YAHOO.log("destructing eventlistener for "+(this.oEvent?this.oEvent.type:"(null event)")+" on "+(this.oDestination?this.oDestination.sName:"(null destination)"),"debug","EventListener::Destruct");if(this.oEvent){this.oEvent.unsubscribe(this._EventHandler,this)}this.sDestName=this.oDestination.sName;this.oDestination=null;this.oDestWidget=null;this.oEvent=null},_EventHandler:function(sEventName,aArgs){var oEvent=ZC.JSManager.GetEvent(sEventName),oWidget=aArgs[0],oSrcEvent=aArgs[1];if(this.oDestination&&this.oEvent){this.HandleEvent(oWidget,oEvent,oSrcEvent)}},_SearchLists:function(Value,sEqualsAttrib,sNotEqualsAttrib,sContainsAttrib,sNotContainsAttrib){var aVal,i,iMax,j,jMax,bResult=false,aContains,aNotContains,fnCompare=function(Value,CompareValues,bReturnIfMatch){if(L.isArray(CompareValues)){for(var mVal in CompareValues){if(L.hasOwnProperty(CompareValues,mVal)&&U.ObjectsEqual(Value,CompareValues[mVal])){return bReturnIfMatch}}return !bReturnIfMatch}else{return U.ObjectsEqual(Value,CompareValues)?bReturnIfMatch:!bReturnIfMatch}};if(this.AttribIsset(sEqualsAttrib)){bResult=fnCompare(Value,this.GetAttrib(sEqualsAttrib),true)}if(this.AttribIsset(sNotEqualsAttrib)){bResult=bResult||fnCompare(Value,this.GetAttrib(sNotEqualsAttrib),false)}if((this.AttribIsset(sContainsAttrib)||this.AttribIsset(sNotContainsAttrib))&&(L.isArray(Value)||L.isObject(Value))){aContains=this.GetAttribDefault(sContainsAttrib,[]);aNotContains=this.GetAttribDefault(sNotContainsAttrib,[]);if(!L.isArray(aContains)){aContains=[aContains]}if(!L.isArray(aNotContains)){aNotContains=[aNotContains]}if(L.isObject(Value)){aVal=[];U.ForEach(Value,function(o){aVal.push(o)})}else{aVal=Value}for(i=0,iMax=aVal.length;i<iMax;++i){for(j=0,jMax=aContains.length;j<jMax;++j){if(U.ObjectsEqual(aVal[i],aContains[j])){bResult=true;break}}for(j=0,jMax=aNotContains.length;j<jMax;++j){if(U.ObjectsEqual(aVal[i],aNotContains[j])){bResult=false;break}}}}return bResult},_GetWidgetValue:function(oWidget){return(oWidget[this.GetAttribDefault("GetValueMethod","GetValue")])()},HandleEvent:function(oWidget,oEvent,oSrcEvent){throw new Error("EventListener::HandleEvent is abstract and must be overridden")}};L.augment(ZC.Core.EventListener,AttribProvider);ZC.Core.ClientSideObject=function(aDef){this.aDef=aDef;this.Setup();this.AttribProviderSetup()};ZC.Core.ClientSideObject.Create=function(sName,sModule){sModule=sModule||"Core";var oNS=ZC.Namespace(sModule+".ClientSideObject");oNS[sName]=function(aDef){oNS[sName].superclass.constructor.call(this,aDef)};L.extend(oNS[sName],ZC.Core.ClientSideObject);return oNS[sName]};ZC.Core.ClientSideObject.prototype={Setup:function(){},Destruct:function(){}};L.augment(ZC.Core.ClientSideObject,AttribProvider)})();function showelementsofclass(A,B,C){root=document.getElementById(C);if(C&&root){classitems=YAHOO.util.Dom.getElementsByClassName(B,A,root)}else{classitems=YAHOO.util.Dom.getElementsByClassName(B,A)}for(i=0;i<classitems.length;i++){if(A.toLowerCase()=="tr"&&navigator.appName!="Microsoft Internet Explorer"){classitems[i].style.display="table-row"}else{if(A.toLowerCase()=="span"){classitems[i].style.display="inline"}else{classitems[i].style.display="block"}}}}function hideelementsofclass(A,B,C){root=document.getElementById(C);if(C&&root){classitems=YAHOO.util.Dom.getElementsByClassName(B,A,root)}else{classitems=YAHOO.util.Dom.getElementsByClassName(B,A)}for(i=0;i<classitems.length;i++){classitems[i].style.display="none"}}function showelementwithid(A){element=document.getElementById(A);if(element==null){return }type=element.tagName;if(type.toLowerCase()=="tr"&&navigator.appName!="Microsoft Internet Explorer"){element.style.display="table-row"}else{element.style.display="block"}}function hideelementwithid(A){element=document.getElementById(A);if(element!=undefined){element.style.display="none"}}function toggleelementwithid(A){element=document.getElementById(A);if(element!=undefined){if(element.style.display=="none"){showelementwithid(A)}else{hideelementwithid(A)}}}function toggledivbyclass(A){classitems=YAHOO.util.Dom.getElementsByClassName(A,"div");for(i=0;i<classitems.length;i++){if(classitems[i].style.display!="none"){classitems[i].style.display="none"}else{classitems[i].style.display="block"}}}var timeout=Array;function displaydiv(A){document.getElementById(A).style.display="block";window.clearTimeout(timeout[A]);timeout[A]=window.setTimeout("hidediv('"+A+"');",10000)}function displaydivinline(A){document.getElementById(A).style.display="inline";window.clearTimeout(timeout[A]);timeout[A]=window.setTimeout("hidediv('"+A+"');",10000)}function displayspan(A){document.getElementById(A).style.display="inline";window.clearTimeout(timeout[A]);timeout[A]=window.setTimeout("hidediv('"+A+"');",10000)}function hidediv(A){window.clearTimeout(timeout[A]);timeout[A]=window.setTimeout("document.getElementById('"+A+"').style.display='none'",100)}function showdiv(A){document.getElementById(A).style.display="block"}function togglediv(A){if(document.getElementById(A).style.display!="none"){document.getElementById(A).style.display="none"}else{document.getElementById(A).style.display="block"}}function togglelabel(A,C,B){if(document.getElementById(A).innerHTML==C){document.getElementById(A).innerHTML=B}else{document.getElementById(A).innerHTML=C}}function toggledivandlabel(D,A,C,B){if(document.getElementById(D).style.display!="none"){document.getElementById(D).style.display="none";document.getElementById(A).innerHTML=B}else{document.getElementById(D).style.display="block";document.getElementById(A).innerHTML=C}}function nse(B,A){document.location="mailto:"+B+"@"+A}function highlight(B){var A=document.getElementById(B);if(!A){return }A.style.background="rgb(230,240,255)"}function nohighlight(B){var A=document.getElementById(B);if(!A){return }A.style.background="transparent"}function MM_swapImgRestore(){var C,A,B=document.MM_sr;for(C=0;B&&C<B.length&&(A=B[C])&&A.oSrc;C++){A.src=A.oSrc}}function MM_preloadImages(){var D=document;if(D.images){if(!D.MM_p){D.MM_p=new Array()}var C,B=D.MM_p.length,A=MM_preloadImages.arguments;for(C=0;C<A.length;C++){if(A[C].indexOf("#")!=0){D.MM_p[B]=new Image;D.MM_p[B++].src=A[C]}}}}function MM_findObj(E,D){var C,B,A;if(!D){D=document}if((C=E.indexOf("?"))>0&&parent.frames.length){D=parent.frames[E.substring(C+1)].document;E=E.substring(0,C)}if(!(A=D[E])&&D.all){A=D.all[E]}for(B=0;!A&&B<D.forms.length;B++){A=D.forms[B][E]}for(B=0;!A&&D.layers&&B<D.layers.length;B++){A=MM_findObj(E,D.layers[B].document)}if(!A&&document.getElementById){A=document.getElementById(E)}return A}function MM_swapImage(){var D,C=0,A,B=MM_swapImage.arguments;document.MM_sr=new Array;for(D=0;D<(B.length-2);D+=3){if((A=MM_findObj(B[D]))!=null){document.MM_sr[C++]=A;if(!A.oSrc){A.oSrc=A.src}A.src=B[D+2]}}}function ConfirmBlockDelete(){return confirm("This will delete the block AND ALL CHILD BLOCKS it may contain.")}function ConfirmFolderDelete(){return confirm("=== CAUTION ===\n\nThis will delete the folder and ALL PAGES AND SUBFOLDERS\nit may contain.")}function ConfirmPageDelete(){return confirm("This will delete the page and any contents.")}function ConfirmDelete(){return confirm("Are you sure you want to delete?")}function NotNull(A){if(document.getElementById(A).value==""){alert("You must put a reason for deleting the items.")}return document.getElementById(A).value!=""}function SelectDivFromDropDown(A){for(i=0;i<A.options.length;i++){if(A.options[i].value&&document.getElementById(A.options[i].value)){document.getElementById(A.options[i].value).style.display="none"}}if(document.getElementById(A.value)){document.getElementById(A.value).style.display="block"}}function LoadIframeFromForm(E,B,C,D){var E="";E=SendAsGetToURL(E,B)+D;var A=getIframeDocument("frame."+B);if(document.getElementById(C).style.display!="none"){document.getElementById(C).style.display="none"}else{document.getElementById(C).style.display="block";A.body.innerHTML="<p>Loading</p>";A.location.replace(E)}}function DocumentLocationFromFormField(sURLPrefix,sFormName,sFieldName,sExtraGetOptions){sURL=eval("document."+sFormName+"."+sFieldName+".value");if(sURL==""){return false}if(sURL[0]=="#"){document.location=sURL;return false}sURL=sURLPrefix+sURL;if(document.location.href.replace(/[#|\?].*$/,"")==sURL.replace(/[#|\?].*$/,"")){document.location="#"+sURL.replace(/^.*#/,"");return false}if(sExtraGetOptions){sURL+="?"+sExtraGetOptions}document.location=sURL;return false}function OpenWindowFromForm(B,A,C){B=SendAsGetToURL(B,A)+C;window.open(B,"","width=200,height=200,location=yes,scrollbars")}function SendAsGetToURL(sURL,sFormName){var sGetString="";if(FormCollection[sFormName]){for(sFieldName in FormCollection[sFormName]){if(eval("document."+sFormName+"."+sFieldName+".type")=="checkbox"){if(eval("document."+sFormName+"."+sFieldName+".checked")){sGetString+=sFieldName+"="+eval("document."+sFormName+"."+sFieldName+".checked")+"&"}}else{sGetString+=sFieldName+"="+eval("document."+sFormName+"."+sFieldName+".value")+"&"}}}return sURL+"?"+sGetString}function getIframeDocument(B){if(document.frames){return document.frames[B].document}var A=getid(B);if(A.contentDocument){return A.contentDocument}else{if(A.contentWindow){return A.contentWindow.document}else{if(A.document){return A.document}}}}function getid(A){if(document.getElementById){return document.getElementById(A)}else{if(document.all){return document.all(A)}}return false}function PleaseWait(A){A.value="PLEASE WAIT";A.style.color="red";A.onclick=function(){alert("Please Wait");return false};return false}function SendFormValue(A,C,B){document.location.replace(A+"?"+B+"="+C.value)}function setIDHTMLToVal(A,B){span=getElementById(B);if(span){span.innerHTML=this.value}}function docnoperm(A){alert(A);return false}function PutFormHere(A,B){var C;C=document.getElementById(A);if(C){B.appendChild(C)}}function SetHiddenValue(A,B,D){var C;C=document.getElementById(A);if(C&&C.elements[B]){C.elements[B].value=D}else{alert("could not find element "+B)}}function MoveCommentFormHere(A,B){oElement=document.getElementById(A);SetHiddenValue("FrmComment","parentcommentid",B);PutFormHere("FrmComment",oElement);return false}function ConfirmRecursiveCommentDelete(){return confirm("Are you sure you want to delete this comment\nincluding all those comments made upon it?")}function ConfirmArticleDelete(){return confirm("Are you sure you want to delete this item\nincluding all those comments made upon it?")}function SetupCommentReply(B,A){fromdiv=document.getElementById(B);todiv=document.getElementById("contextcomment");jumptothread_div=document.getElementById("jumptothread");title=document.getElementById("formtitle");link=document.getElementById("comment_"+A);link.href="javascript:void(0);";todiv.innerHTML=fromdiv.innerHTML;todiv.style.display="block";jumptothread_div.innerHTML='<a class="link" href="#anchor_comment_'+A+'">Jump to thread</a>';jumptothread_div.style.display="block";title.innerHTML="<strong>Reply to comment</strong>";document.forms.FrmComment.parentcommentid.value=A;ScrollToElement(todiv);return false}function ScrollToElement(C){var A=C.offsetTop;var B=C;while(B.offsetParent&&(B.offsetParent!=document.body)){B=B.offsetParent;A+=B.offsetTop}window.scrollTo(0,A)}function ScrollToID(A){var A=document.getElementById(A);ScrollToElement(A)}function SetupNewComment(){title=document.getElementById("formtitle");title.innerHTML="<strong>Add a comment</strong>";document.forms.FrmComment.parentcommentid.value="";todiv=document.getElementById("contextcomment");jumptothread_div=document.getElementById("jumptothread");todiv.innerHTML="";jumptothread_div.innerHTML="";return false}function showDebugWindow(){window.top.debugWindow=window.open("","Debug","left=0,top=0,width=300,height=700,scrollbars=yes,status=yes,resizable=yes");window.top.debugWindow.opener=self;window.top.debugWindow.document.open();window.top.debugWindow.document.write("<HTML><HEAD><TITLE>Debug Window</TITLE></HEAD><BODY><PRE>\n")}function debugToWindow(A){if(window.top.debugWindow&&!window.top.debugWindow.closed){window.top.debugWindow.document.write(A+"\n")}else{showDebugWindow();window.top.debugWindow.document.write(A+"\n")}}function _builddebugstr(B){var A="";for(x in B){if(typeof (x)=="object"){A+=_builddebugstr(B[x])}else{A+=x+": "+B[x]+"\n"}}return A}function debugObject(B){if(B==undefined){debugToWindow("undefined")}else{var A="";A=_builddebugstr(B);debugToWindow(A)}}function ClearForm(A){for(n=0;n<A.elements.length;n++){switch(A.elements[n].type){case"hidden":case"button":case"submit":break;case"text":case"textarea":case"password":case"fileupload":case"radio":A.elements[n].value="";break;case"checkbox":A.elements[n].checked=false;break;case"select-one":case"select-multiple":if(A.elements[n].options[0].value=="Any"||A.elements[n].options[0].value=="__Any__"||A.elements[n].options[0].value==""){A.elements[n].selectedIndex=0}break;default:}if(A.elements[n].onchange!=undefined){A.elements[n].onchange({target:A.elements[n]})}}}function SetInitialI18NWidget(){HideNonPreferredI18NWidgets();ShowPreferredI18NWidget()}function HideNonPreferredI18NWidgets(){for(sWidgetID in aI18NWidgets){for(sLangID in aLangs){oWidget=document.getElementById(aI18NWidgets[sWidgetID]+aLangs[sLangID]);if(oWidget){if(aLangs[sLangID]!=sPreferredLang){oWidget.style.display="none";oFlag=document.getElementById(aI18NWidgets[sWidgetID]+aLangs[sLangID]+"_img");oFlag.style.border="0px solid black"}}}}}function ShowPreferredI18NWidget(){for(sWidgetID in aI18NWidgets){for(sLangID in aLangs){oWidget=document.getElementById(aI18NWidgets[sWidgetID]+aLangs[sLangID]);if(oWidget){if(aLangs[sLangID]==sPreferredLang){oWidget.style.display="inline";oFlag=document.getElementById(aI18NWidgets[sWidgetID]+aLangs[sLangID]+"_img");oFlag.style.border="1px solid black"}}}}}function SetPreferredI18NWidget(A){sPreferredLang=A}function SwapI18NWidget(A){SetPreferredI18NWidget(A);HideNonPreferredI18NWidgets();ShowPreferredI18NWidget()}function ChangeI18NWidgetsFromCheckBox(A,B){if(B.checked){for(sWidgetID in aI18NWidgets){oWidget=document.getElementById(aI18NWidgets[sWidgetID]+A);oWidget.style.display="inline";oImage=document.getElementById(aI18NWidgets[sWidgetID]+A+"_img");oImage.style.display="inline"}}else{for(sWidgetID in aI18NWidgets){oWidget=document.getElementById(aI18NWidgets[sWidgetID]+A);oWidget.style.display="none";oImage=document.getElementById(aI18NWidgets[sWidgetID]+A+"_img");oImage.style.display="none"}}}function PreventI18NFlagJS(){var A="";for(sWidgetID in aI18NWidgets){for(sLangID in aLangs){oImage=document.getElementById(aI18NWidgets[sWidgetID]+aLangs[sLangID]+"_img");if(oImage){oImage.onclick=function(){};if(aLangs[sLangID]!=sPreferredLang){oImage.style.display="none"}}}}}function moveElementToElement(A,D){var E=document.getElementById(D);var C=findPosX(E);var B=findPosY(E);moveObject(A,C,B)}function moveObject(D,A,C){var B=getStyleObject(D);if(B){B.left=A;B.top=C;return true}else{return false}}var xOffset=30;var yOffset=-5;function showPopupDiv(B,E){if(window.currentPopupID){var F=getStyleObject(currentPopupID);if(F){F.visibility="hidden";window.currentPopupID=false}}if(E){var D=(E.pageX)?E.pageX+xOffset:E.x+xOffset+((document.body.scrollLeft)?document.body.scrollLeft:0);var C=(E.pageY)?E.pageY+yOffset:E.y+yOffset+((document.body.scrollTop)?document.body.scrollTop:0);moveObject(B,D,C);var A=getStyleObject(B);if(A){A.visibility="visible";window.currentPopupID=B}}}function hidePopupDiv(B){var A=getStyleObject(B);if(A){A.visibility="hidden";window.currentPopupID=false}}function hidePopupDivDelay(A){window.setTimeout("hidePopupDiv('"+A+"')",20)}function getStyleObject(A){if(document.getElementById&&document.getElementById(A)){return document.getElementById(A).style}else{if(document.all&&document.all(A)){return document.all(A).style}else{if(document.layers&&document.layers[A]){return document.layers[A]}else{return false}}}}function createRequestObject(){var B;var A=navigator.appName;if(A=="Microsoft Internet Explorer"){B=new ActiveXObject("Microsoft.XMLHTTP")}else{B=new XMLHttpRequest()}return B}var http=createRequestObject();var logIdToUpdate="";function sndMenuReq(A,B){sndReq(A,"div"+B.id)}function sndReq(B,A){http.open("get",B);http.onreadystatechange=handleResponse;http.send(null);logIdToUpdate=A;element=document.getElementById(logIdToUpdate);if(element&&element.innerHTML==""){element.innerHTML="<em>Loading...</em>"}}function handleResponse(){if(http.readyState==4){var A=http.responseText;element=document.getElementById(logIdToUpdate);if(element){element.innerHTML=A}}}function createCMSFolder(D){var B=new Date();var C="?aj=1&folder="+D+"&_tr=FrmMakeCMSFolder&_ts="+Math.round(B.getTime()/1000);var A=document.getElementById("Main");A.innerHTML="<em>Loading ...</em>";http.open("get",C);http.onreadystatechange=handleResponseCreateCMSFolder;http.send(null);logIdToUpdate="Main";element=document.getElementById(logIdToUpdate);if(element&&element.innerHTML==""){element.innerHTML="<em>Loading...</em>"}window.scrollTo(0,0)}function handleResponseCreateCMSFolder(){if(http.readyState==4){var response=http.responseXML.documentElement;var innerHTML="";var js="";var bGotJS;var items;element=document.getElementById(logIdToUpdate);items=response.getElementsByTagName("content");for(i=0;i<items.length;i++){if(items[i].childNodes.length>1){innerHTML+=items[i].childNodes[1].nodeValue}else{innerHTML+=items[i].firstChild.nodeValue}}if(element){element.innerHTML=innerHTML}bGotJS=false;items=response.getElementsByTagName("jscript");for(i=0;i<items.length;i++){bGotJS=true;if(items[i].childNodes.length>1){js+=items[i].childNodes[1].nodeValue}else{js+=items[i].firstChild.nodeValue}}eval(js)}}function createCMSPage(D){var B=new Date();var C="?aj=1&page="+D+"&_tr=FrmMakeCMSPage&_ts="+Math.round(B.getTime()/1000);var A=document.getElementById("Main");A.innerHTML="<em>Loading ...</em>";sndReq(C,"Main");window.scrollTo(0,0)}function displayMap(C){var A;var B;for(i=0;i<20;i++){B=document.getElementById("map_"+i);if(B){B.style.display="none"}}A=document.getElementById(C);if(A){A.style.display="block"}}function CharsRemaining(B){var A=parseInt(B.getAttribute("maxlength"),10);var C=B.value.length;return A-C}function CharsRemaining(B){var A=parseInt(B.getAttribute("maxlength"),10);var C=expandNewlines(B.value).length;return A-C}function expandNewlines(A){var B=A.replace(/\n/g,"\r\n").replace(/\r\r\n/g,"\r\n");return B}function isMaxLength(B){var A=B.getAttribute?parseInt(B.getAttribute("maxlength")):"";if(B.getAttribute&&B.value.length>A){B.value=B.value.substring(0,A)}}function IsNumeric(B){var D="0123456789.";var C=true;var A;for(i=0;i<B.length&&C==true;i++){A=B.charAt(i);if(D.indexOf(A)==-1){C=false}}return C}function findPosX(A){var B=0;if(A.offsetParent){while(1){B+=A.offsetLeft;if(!A.offsetParent){break}A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetTop;if(!B.offsetParent){break}B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function coordsInElement(A,C,B){e=document.getElementById(B);x1pos=findPosX(e);x2pos=x1pos+e.offsetWidth;y1pos=findPosY(e);y2pos=y1pos+e.offsetHeight;if(A>=x1pos&&A<=x2pos&&C>=y1pos&&C<=y2pos){return true}return false}function stopEventPropagation(A){if(A.stopPropagation){A.stopPropagation()}else{window.event.cancelBubble=true}}function parentNodeOfType(A,C){var B=A.parentNode;while(B.tagName.toLowerCase()!=C.toLowerCase()&&B.parentNode){B=B.parentNode}if(B.tagName.toLowerCase()==C.toLowerCase()){return B}return undefined}function eventTarget(A){if(!A){A=window.event}if(A.target){element=A.target}if(A.srcElement){element=A.srcElement}if(element.nodeType==3){element=element.parentNode}return element}function showNextTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }nextIndex=tr.rowIndex+1;nextTr=tr.parentNode.parentNode.rows[nextIndex];nextTr.style.display=""}function hideThisTableRow(A){thisElement=eventTarget(A);if(thisElement.tagName=="TR"){tr=thisElement}else{tr=parentNodeOfType(thisElement,"TR")}if(!tr){return }tr.style.display="none"}function hideNextTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }nextIndex=tr.rowIndex+1;nextTr=tr.parentNode.parentNode.rows[nextIndex];nextTr.style.display="none"}function hidePrevTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }prevIndex=tr.rowIndex-1;prevTr=tr.parentNode.parentNode.rows[prevIndex];prevTr.style.display="none"}function showPrevTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }prevIndex=tr.rowIndex-1;prevTr=tr.parentNode.parentNode.rows[prevIndex];prevTr.style.display=""}function addClass(A,B){if(!hasClass(A,B)){A.className+=(A.className?" ":"")+B;return true}return false}function hasClass(A,B){if(A.className==""){return false}return new RegExp("\\b"+B+"\\b").test(A.className)}function removeClass(A,B){if(hasClass(A,B)){A.className=A.className.replace(A.className.indexOf(" "+B)>=0?" "+B:B)}}(function(){var A=YAHOO.lang,C=ZC.Util,E=YAHOO.util.Dom,G=YAHOO.util.Event,B="yui-pe-content",F=ZC.Core.Block;var D=F.Create("Menu_Menu");D.prototype.CustomSetupEnd=function(){var I,J,H;I=this.GetElement();if(!I){return false}E.removeClass(I,B);H=new YAHOO.widget.MenuBar(I,{zindex:5});H.render();H.show();C.ForEach(H.getSubmenus(),function(K){K.cfg.setProperty("zindex",5)});this.oYUIMenuBar=H;J=E.getElementsByClassName("menulink","a");if(J.length){G.on(J,"click",function(M){var P=G.getTarget(M),L=H.getSubmenus(),O=P.href.replace(/.*#/,""),N,K;for(N=0,K=L.length;N<K;N++){if(L[N].id==O){L[N].show();L[N].parent.cfg.setProperty("selected",true);L[N].focus();G.stopEvent(M);return }}},this,true)}return true};D.prototype.Destruct=function(){F.Menu_Menu.superclass.Destruct.apply(this,arguments);if(this.oYUIMenuBar){this.oYUIMenuBar.body.innerHTML="";this.oYUIMenuBar=null}};D.prototype._IDPrefix="menu-";D=F.Create("Accordion","Core",undefined,"Layout");D.prototype.CustomSetupEnd=function(){var H=this.GetElement();if(!H){return false}E.removeClass(H,B);this.oYUIAccordionView=new YAHOO.widget.AccordionView(H,{animationSpeed:this.GetAttribDefault("AnimSpeed",0.5),collapsible:this.GetAttribDefault("Collapsible",true),expandable:this.GetAttribDefault("Multiple",false),width:this.GetAttribDefault("Width","100%")});this._aAccordionBlocks=this.GetAttribDefault("AccordionBlocks");if(this._aAccordionBlocks){this.oYUIAccordionView.on("panelOpen",function(I){var J=I.index;return this.LoadPanel(J,false,I.panel)},this,true);ZC.JSManager.GetEvent("AfterManagerInit").subscribe(function(){C.ForEach(this._aAccordionBlocks,function(K,J){var I;if(K.StartOpen){this.LoadPanel(J,false)}},this)},this,true)}return true};D.prototype.Destruct=function(){ZC.Core.Layout.Accordion.superclass.Destruct.apply(this,arguments);if(this.oYUIAccordionView){this.oYUIAccordionView.destruct();this.oYUIAccordionView=null}};D.prototype._IDPrefix="accordion-";D.prototype.LoadPanel=function(K,J,M){var H,P,N="zc-accordion-loading",O={Show:function(){E.addClass(M,N)},Hide:function(){E.removeClass(M,N)}};if(A.isUndefined(M)){H=E.get("accordion-"+this.UniqueID()+"--"+K);if(H){M=H.parentNode}else{return false}}else{H=M.lastChild}if(H&&!A.isUndefined(this._aAccordionBlocks[K])&&(J||!this._aAccordionBlocks[K].Loaded)){P=function(){this._aAccordionBlocks[K].Loaded=true;this._aAccordionBlocks[K].ForceReload=false;if(this.oYUIAccordionView){this.oYUIAccordionView.openPanel(K)}};if(this._aAccordionBlocks[K].ContentURL){var L={customevents:{onStart:O.Show,onComplete:O.Hide},success:function(Q){H.innerHTML=Q.responseText;P.call(this)},failure:function(){C.Alert(_GT("The server was unable to retreive the data, please try again."))},scope:this};YAHOO.util.Connect.asyncRequest("GET",this._aAccordionBlocks[K].ContentURL,L,null)}else{var I={panelid:K};if(J||this._aAccordionBlocks[K].ForceReload){I.reloadPanel=1}this.AjaxRequest({Transaction:"FetchBlockSection",GetPostVars:I,OnSuccess:P,LoadingIndicator:O})}return false}return true};D.prototype.ReloadPanels=function(H){if(A.isNumber(H)){H=[H]}else{if(!A.isArray(H)){H=C.Keys(this._aAccordionBlocks)}}C.ForEach(H,function(I){if(this.oYUIAccordionView.isPanelOpen(I)){this.LoadPanel(I,true)}else{this._aAccordionBlocks[I].Loaded=false;this._aAccordionBlocks[I].ForceReload=true}},this)};D.prototype.ProcessAjaxResponse=function(H,J,I){ZC.Core.Layout.Accordion.superclass.ProcessAjaxResponse.apply(this,arguments);C.ForEach(H,function(L,K){switch(K){case"ReloadPanels":this.ReloadPanels(L);break;case"SetInPage":this.SetInPage(L);break}},this)};D.prototype.SetInPage=function(H){C.ForEach(H,function(I){if(!A.isUndefined(this._aAccordionBlocks[I])){this._aAccordionBlocks[I].Loaded=true}},this)};D.prototype.AttribMethod_AccordionBlocks=function(J){if(J.length==0||A.isUndefined(J[0].Header)||this._bAttribProviderSetup){return }var I,H,K;for(I=0,H=J.length;I<H;++I){elPanel=this.oYUIAccordionView.getPanel(I);this.oYUIAccordionView.setPanelHeader(I,J[I].Header,J[I].HeaderClass)}};D=F.Create("TabView");D.prototype.CustomSetupEnd=function(){var U,T,L,O=this.GetAttribDefault("Orientation","top"),R=false,I,J,S,M,W,K,V,N,X,Q,P,H;U=this.GetElement();if(!U){YAHOO.log("unable to find element with ID "+(this._IDPrefix+this.UniqueID()),"debug","TabView");return false}if(O=="top+bottom"){R=true;O="top"}this.oYUITabView=new YAHOO.widget.TabView(U,{orientation:O});this.oTabs={};this.aTabIndices=[];P=H=0;C.ForEach(this.GetAttribDefault("Tabs",[]),function(a,Z){var Y,b;if(a.Selected){H=P}if(a.AjaxURL){var Y={label:a.Caption,dataSrc:a.AjaxURL,cacheData:(A.isUndefined(a.CacheData)?true:a.CacheData),active:(H==P)};b=new YAHOO.widget.Tab(Y);this.oYUITabView.addTab(b,P)}else{b=this.oYUITabView.getTab(P)}this.oTabs[Z]=b;this.aTabIndices[P]=Z;P++},this);if(R){J=this.oYUITabView.getElementsByClassName("yui-nav","ul")[0];S=this.oYUITabView.getElementsByClassName("yui-content")[0];if(J&&S){I=document.createElement("div");I.className="yui-navset-bottom";I.appendChild(J.cloneNode(true));E.insertAfter(I,S);M=function(Y,Z){G.stopEvent(Y);this.oYUITabView.set("activeIndex",Z)};C.ForEach(E.getChildren(I.firstChild),function(b,a){var c,Z,Y;c=this.oYUITabView.getTab(a);G.on(b,"click",M,a,this);Z=c.addClass;c.addClass=function(d){E.addClass(b,d);Z.apply(this,arguments)};Y=c.removeClass;c.removeClass=function(d){E.removeClass(b,d);Y.apply(this,arguments)}},this)}}L=E.getElementsByClassName("tabviewlink","a");if(L.length){G.on(L,"click",function(Y){var a=G.getTarget(Y),Z=a.href.replace(/.*#/,"");if(!A.isUndefined(this.oTabs[Z])){this.oYUITabView.set("activeTab",this.oTabs[Z]);G.stopEvent(Y)}},this,true)}V=this.GetAttribDefault("StoreSelectedTab");if(V){K=YAHOO.util.Cookie;N=K.getSub("TabViewSelectedTab",V,Number);if(N){this.oYUITabView.set("activeIndex",N)}this.oYUITabView.on("activeIndexChange",function(Y){var Z=new Date();Z.setUTCFullYear(Z.getUTCFullYear()+1);K.setSub("TabViewSelectedTab",V,this.oYUITabView.get("activeIndex"),{expires:Z})},this,true)}X=this.GetAttribDefault("ChangeTabEvent");if(X){Q=ZC.JSManager.GetEvent(X)}W=function(Y,Z){C.ForEach(T,function(c,a){var b=c.get("element").className.split(/\s/);C.ForEach(b,function(d){if(d=="selected"){return }if(d.substr(d.length-9)=="-selected"&&a!=Y){c.removeClass(d)}else{if(a==Y){c.addClass(d+"-selected")}}})});if(Q){Q.fire(this.aTabIndices[Y],this.aTabIndices[Z])}};this.oYUITabView.on("activeIndexChange",function(Y){W.call(this,Y.newValue,Y.prevValue)},this,true);ZC.JSManager.GetEvent("ManagerInit").subscribe(function(){W.call(this,this.oYUITabView.get("activeIndex"))},this,true);return true};D.prototype.Destruct=function(){F.TabView.superclass.Destruct.apply(this,arguments);this.oYUITabView=null;this.oTabs=null};D.prototype._IDPrefix="tabview-";D.prototype.EnableTab=function(I,H){if(A.isUndefined(H)){H=true}if(!A.isUndefined(this.oTabs[I])){this.oTabs[I].set("disabled",!H)}};D.prototype.DisableTab=function(H){this.EnableTab(H,false)};D.prototype.AddTabClass=function(H,I){if(!A.isUndefined(this.oTabs[H])){this.oTabs[H].addClass(I)}};D.prototype.RemoveTabClass=function(H,I){if(!A.isUndefined(this.oTabs[H])){this.oTabs[H].removeClass(I)}};D=F.Create("Recordset_Load_Search");D.prototype.CustomSetupEnd=function(){var I=E.get("list-inner-"+this.UniqueID()),H="dbad-list-loading",J=E.get("frmSorter.rstsortby"),K;if(!I){return true}K=function(M,N,L){G.stopEvent(M);this.AjaxRequest({Transaction:"SortOrPageChange",URL:N.href})};G.delegate(I,"click",K,".caption a, .pager a",this,true);if(J){J.onchange="";G.on(J,"change",function(){this.AjaxRequest({Transaction:"SortOrPageChange",GetPostVars:J.value})},this,true)}return true};D=F.Create("YUIProgressBar");D.prototype.CustomSetupEnd=function(){var J=this.GetElement(),I,H,K;if(!J){return false}E.removeClass(J,B);H={anim:Boolean(this.GetAttribDefault("Animation")),direction:this.GetAttribDefault("Direction","ltr"),height:this.GetAttribDefault("Height","20px"),width:this.GetAttribDefault("Width","200px"),value:this.GetAttrib("Value"),minValue:this.GetAttribDefault("MinValue"),maxValue:this.GetAttribDefault("MaxValue")};this.oYUIProgressBar=new YAHOO.widget.ProgressBar(H);this.oYUIProgressBar.render(J,E.getFirstChild(J));return true};D.prototype.AttribMethod_Animation=function(H,I){this.oYUIProgressBar.set("anim",(H!==false));if(A.isObject(H)){var J=this.oYUIProgressBar.get("anim");if(!A.isUndefined(H.Duration)){J.duration=Number(H.Duration)}if(!A.isUndefined(H.Easing)&&!A.isUndefined(YAHOO.util.Easing[H.Easing])){J.method=YAHOO.util.Easing[H.Easing]}}};D.prototype.AttribMethod_Value=function(H,I){if(H<this.GetAttribDefault("MinValue",0)||H>this.GetAttribDefault("MaxValue",100)){this.SetAttrib("Value",I);return }this.oYUIProgressBar.set("value",H);this._UpdateMessage()};D.prototype.AttribMethod_MinValue=function(H){this.oYUIProgressBar.set("minValue",H);this._UpdateMessage()};D.prototype.AttribMethod_MaxValue=function(H){this.oYUIProgressBar.set("maxValue",H);this._UpdateMessage()};D.prototype.AttribMethod_Width=function(H){this.oYUIProgressBar.set("width",H)};D.prototype.AttribMethod_Message=D.prototype._UpdateMessage=function(){var J=this.GetAttribDefault("Message"),L={},K=this.GetAttribDefault("Value"),I=this.GetAttribDefault("MinValue",0),H=this.GetAttribDefault("MaxValue",100);if(!J){return }if(A.isUndefined(this.elMessage)){this.elMessage=E.getFirstChildBy(this.GetElement(),function(M){return E.hasClass(M,"yui-pb-message")});if(!this.elMessage){this.elMessage=false}}if(this.elMessage===false){return }L={Value:K,MinValue:I,MaxValue:H,Remaining:H-K,Percent:Math.round((K/(H-I))*100)};this.elMessage.innerHTML=C.ReplaceTags(J,L)}})();(function(){var A=YAHOO.lang,F=ZC.Util.GetText,H=ZC.Util.sprintf;var E;E=ZC.Core.Validator.Create("AlphaNumericNoSpace");E.prototype.sDefaultValidationMessage=F("Only A-Z a-z 0-9 _ and - are valid (no spaces)");E.prototype.oValidationRegex=/^([A-Za-z0-9_-])*$/;E=ZC.Core.Validator.Create("AlphaNumericSpace");E.prototype.sDefaultValidationMessage=F("Only A-Z a-z 0-9 _ - and spaces are valid");E.prototype.oValidationRegex=/^([A-Za-z0-9_ -])*$/;E=ZC.Core.Validator.Create("ArrayElementCount");E.prototype.sDefaultValidationMessage=F("Please select the appropriate number of elements.");E.prototype.Validate=function(K,J){var L=J.aDef.MinArrayElements||0;var I=J.aDef.MaxArrayElements||0;var M;if(A.isArray(K)){M=K.length}else{if(A.isString(K)&&K.length){M=1}else{M=0}}if(M==0){return true}return(!((L&&M<L)||(I&&M>I)))};E=ZC.Core.Validator.Create("CompareTo");E.prototype.sDefaultValidationMessage=F("The selection in this field must be greater than the value of the other field.");E.prototype.Validate=function(K,J){if(A.isUndefined(J.aDef.GreaterThanField)&&A.isUndefined(J.aDef.LessThanField)){return true}var M=[];var L=true;if(J.aDef.GreaterThanField){var I=J.aDef.GreaterThanField;if(A.isString(I)){I=[I]}ZC.Util.ForEach(I,function(O){var N=ZC.JSManager.GetWidget(O);L=L&&(K>N.GetValue());M.push(H(F("greater than the value in %s"),N.GetCaption()))})}if(J.aDef.LessThanField){var I=J.aDef.LessThanField;if(A.isString(I)){I=[I]}ZC.Util.ForEach(I,function(O){var N=ZC.JSManager.GetWidget(O);L=L&&(K<N.GetValue());M.push(H(F("less than the value in %s"),oGreaterThanWidget.GetCaption()))})}this.sDefaultValidationMessage=H(F("The selection must be %s"),M.join(F(" and ")));return L};E=ZC.Core.Validator.Create("DomainName");E.prototype.sDefaultValidationMessage=F("Please enter a valid domain name; e.g. www.google.com:%");E.prototype.oValidationRegex=/^[0-9a-zA-Z._-]*$/;var D="[a-zA-Z\\d!#$%&'*+\\\\/=?^_`{|}~\\s-]+",B="['A-Za-z0-9_.-]+@(['A-Za-z0-9_-]+\\.['A-Za-z0-9_.-]+)",C="(("+D+")?\\s*<"+B+">|"+B+")?";E=ZC.Core.Validator.Create("EmailAddress");E.prototype.sDefaultValidationMessage=F("Please enter a valid e-mail address");E.prototype.oValidationRegex=new RegExp("^("+C+")?$");E=ZC.Core.Validator.Create("EmailAddresses");E.prototype.sDefaultValidationMessage=F("Please enter a valid e-mail address[es] (separated with commas)");E.prototype.oValidationRegex=new RegExp("^(("+C+"\\s*,\\s*)*"+C+")?$","m");E=ZC.Core.Validator.Create("EmailAddressesNewLineSeperated");E.prototype.sDefaultValidationMessage=F("Please enter a valid e-mail address[es] (one per line)");E.prototype.oValidationRegex=new RegExp("^(("+C+"\\s*\\n\\s*)*"+C+")?$","m");E=ZC.Core.Validator.Create("HTMLColour");E.prototype.sDefaultValidationMessage=F("Please enter a valid HTML colour");E.prototype.oValidationRegex=/^(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow|#[0-9A-F]{6})?$/i;E=ZC.Core.Validator.Create("Hex6Digits");E.prototype.sDefaultValidationMessage=F("Please ensure the data is of the format ff00aa (6 digits from 0-9 plus a,b,c,d,e and f)");E.prototype.oValidationRegex=/^([0-9A-F]{6})?$/i;E=ZC.Core.Validator.Create("HexHTMLColour");E.prototype.sDefaultValidationMessage=F("Please ensure the data is of the format #ff00aa (a hash followed by 6 digits from 0-9 plus a,b,c,d,e and f)");E.prototype.oValidationRegex=/^(#[0-9A-F]{6})?$/i;E=ZC.Core.Validator.Create("IsFutureDate");E.prototype.sDefaultValidationMessage=F("Please enter a date in the future.");E.prototype.Validate=function(J,I){if(!J){return true}var K=new Date();if(I.aDef.AllowToday){K.setHours(0);K.setMinutes(0);K.setSeconds(0)}else{K.setHours(23);K.setMinutes(59);K.setSeconds(59)}return J>K};E=ZC.Core.Validator.Create("IsHumanAge");E.prototype.sDefaultValidationMessage=F("Please enter a whole number less than 100.");E.prototype.oValidationRegex=/^\d{0,2}$/;E=ZC.Core.Validator.Create("IsInteger");E.prototype.sDefaultValidationMessage=F("Please enter a whole number.");E.prototype.oValidationRegex=/^-?\d*$/;E=ZC.Core.Validator.Create("IsNaturalNumber");E.prototype.sDefaultValidationMessage=F("Please enter a whole number greater than zero.");E.prototype.oValidationRegex=/^(\d*[1-9]\d*)*$/;E=ZC.Core.Validator.Create("IsNonNegativeInteger");E.prototype.sDefaultValidationMessage=F("Please enter a whole non-negative number.");E.prototype.oValidationRegex=/^\d*$/;E=ZC.Core.Validator.Create("IsPositive");E.prototype.sDefaultValidationMessage=F("Please enter a positive number.");E.prototype.oValidationRegex=/^\d*([,.]\d+)?$/;E=ZC.Core.Validator.Create("IsYear");E.prototype.sDefaultValidationMessage=F("Please enter a 4 digit year.");E.prototype.Validate=function(L,J){if(L==""){return true}var M=L.match(/^\d{4}$/);var K=J.aDef.MaxYear;var I=J.aDef.MinYear;if(I&&K){this.sDefaultValidationMessage=H(F("Please enter a 4 digit year between %d and %d."),I,K);M=M&&(L>=I&&L<=K)}else{if(K){this.sDefaultValidationMessage=H(F("Please enter a 4 digit year before %d."),K);M=M&&(L<=K)}else{if(I){this.sDefaultValidationMessage=H(F("Please enter a 4 digit year after %d."),I);M=M&&(L>=I)}}}return M};E=ZC.Core.Validator.Create("MassMail_AutomaticRecipients");E.prototype.sDefaultValidationMessage=F("The option you have selected is invalid");E.prototype.Validate=function(K,J){var I=J.oForm.GetWidget("MaxRecipients");var M=J.oForm.GetWidget("Role");var L=J.oForm.GetWidget("PresetEmailAddresses");switch(K){case 1:if(I.GetValue()==-1){this.sDefaultValidationMessage=F("This option is not valid when there are no manual recipients");return false}break;case 2:if(M.GetValue()==""){M.SetValid(false,F("You must specify a role"));this.sDefaultValidationMessage=F("You must specify a role below");return false}break;case 3:if(L.GetValue()==""){I.SetValid(false,F("You must specify at least one email address"));this.sDefaultValidationMessage=F("You must specify at least one preset email address below");return false}break}return true};E=ZC.Core.Validator.Create("MaxDecimalPlaces");E.prototype.Validate=function(J,I){this.sDefaultValidationMessage=H(F("Please specify this value using no more than %d decimal places."),I.aDef.MaxDP);var K=new RegExp("^\\d*([,.]\\d{1,"+I.aDef.MaxDP+"})?$");return K.test(J)};E=ZC.Core.Validator.Create("MaxLength");E.prototype.Validate=function(J,I){var K=I.aDef.MaxLength;this.sDefaultValidationMessage=H(F("Please reduce this to %d  characters, it is currently at %d."),K,J.length);return(J.length<=K)};E=ZC.Core.Validator.Create("NotBlank");E.prototype.sDefaultValidationMessage=F("Please complete this.");E.prototype.Validate=function(J,I){if(A.isUndefined(J)){return false}if(!A.isUndefined(J.length)){return J.length>0}return(J.toString)&&(J.toString().length>0)};E=ZC.Core.Validator.Create("PositiveCurrency");E.prototype.sDefaultValidationMessage=F("Please enter a number with no more than two decimal places.");E.prototype.oValidationRegex=/^\d*([.,]\d{1,2})?$/;E=ZC.Core.Validator.Create("RegEx");E.prototype.sDefaultValidationMessage=F("Please enter a valid value");E.prototype.Validate=function(K,I){var J,L;if(K&&K.length){L=I.GetAttrib("ValidationRegEx").match(/^(.)(.*)\1([imsxeADSUXJu]*)$/);if(L){if(L[3].match(/[^gim]/)){YAHOO.log("Warning: ValidationRegEx on "+I.sName+" contains flags not supported by Javascript; not performing client-side validation","warn","Core_Validator_RegEx");return true}J=new RegExp(L[2],L[3]);if(J){return J.test(K)}else{YAHOO.log("Error instantiating regexp object","error","Core_Validator_RegEx");return true}}else{YAHOO.log("Warning: Could not parse ValidationRegEx on "+I.sName+"; not performing client-side validation","warn","Core_Validator_RegEx");return true}}return true};E=ZC.Core.Validator.Create("Regex_Multiline");E.prototype.sDefaultValidationMessage=F("One or more lines are in an invalid format");E.prototype.Validate=function(L,J){var M=J.aDef.Validator_Regex_Multiline;if(!M){return true}var K=new RegExp(M);var I=L.split(/\n/);return !ZC.Util.Some(I,function(N){N=N.replace(/(^\s*|\s$)/g,"");return(N.length&&!K.test(N))})};var G="[1-9]\\d{8,15}";E=ZC.Core.Validator.Create("SMSNumber");E.prototype.sDefaultValidationMessage=F("Please enter a valid international number including the country code.  UK mobile numbers start with 44 and omit the first 0.");E.prototype.oValidationRegex=new RegExp("^("+G+")?$");E=ZC.Core.Validator.Create("SMSNumbers");E.prototype.sDefaultValidationMessage=F("Please enter valid international numbers including the country code, separated by commas or newlines.");E.prototype.oValidationRegex=new RegExp("^("+G+"([,\\n]"+G+")*)?$");E=ZC.Core.Validator.Create("SelectMinMax");E.prototype.sDefaultValidationMessage=F("You must select at least 1 and no more than 3 counties");E.prototype.Validate=function(K,J){if(K instanceof Array){var L=J.aDef.SelectMin||0;var I=J.aDef.SelectMax||0;if(I>0){this.sDefaultValidationMessage=H(F("You must select at least %d and no more than %d."),L,I)}else{this.sDefaultValidationMessage=H(F("You must select at least %d."),L)}if(K.length>=L&&(I==0||K.length<=I)){return true}}return false};E=ZC.Core.Validator.Create("TelephoneNumber");E.prototype.sDefaultValidationMessage=F("Please enter a valid telephone number excluding the country code.");E.prototype.oValidationRegex=/^[^a-zA-Z]*$/;E=ZC.Core.Validator.Create("TwoTokensValidator");E.prototype.sDefaultValidationMessage=F("A maximum of two words is allowed");E.prototype.oValidationRegex=/^(\S+( \S+)?)?$/;E=ZC.Core.Validator.Create("URL");E.prototype.sDefaultValidationMessage=F("Please enter a valid URL beginning http://");E.prototype.oValidationRegex=/^(https?:\/\/\S+)?$/;E=ZC.Core.Validator.Create("WhiteSpaceSeparatedIntegers");E.prototype.sDefaultValidationMessage=F('Please enter one or more whole numbers separated by a space e.g. "1 2 3".');E.prototype.oValidationRegex=/^(\d+\s+)*$/})();(function(){var L=YAHOO.lang,Dom=YAHOO.util.Dom,Evt=YAHOO.util.Event,U=ZC.Util,_GT=U.GetText,JSManager=ZC.JSManager,oEL,ZCEL=ZC.Core.EventListener;oEL=ZCEL.Create("Alert");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(this.AttribIsset("Message")){JSManager.Alert(this.GetAttrib("Message"))}};oEL=ZCEL.Create("EnableDisable");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var bEnable,sEnabledClass,sDisabledClass,sPopulateWhenDisabledFrom,mValueWhenDisabled,oPopulateFromWidget;bEnable=this._SearchLists(this._GetWidgetValue(oWidget),"EnableWhenSrcEquals","EnableWhenSrcNotEquals","EnableWhenSrcContains","EnableWhenSrcNotContains");sEnabledClass=this.GetAttribDefault("EnabledClass","");sDisabledClass=this.GetAttribDefault("DisabledClass","disabled");this.oDestWidget.Enable(bEnable,sEnabledClass,sDisabledClass);if(bEnable){if(!L.isUndefined(this.ValueWhenEnabled)){this.oDestWidget.SetValue(this.ValueWhenEnabled);delete this.ValueWhenEnabled}return }if(this.AttribIsset("ValueWhenDisabled")){mValueWhenDisabled=this.GetAttrib("ValueWhenDisabled")}else{if(sPopulateWhenDisabledFrom=this.GetAttribDefault("PopulateWhenDisabledFrom")){oPopulateFromWidget=JSManager.GetWidget(sPopulateWhenDisabledFrom);if(oPopulateFromWidget){mValueWhenDisabled=oPopulateFromWidget.GetValue()}}}if(L.isUndefined(this.ValueWhenEnabled)&&!L.isUndefined(mValueWhenDisabled)){this.ValueWhenEnabled=this.oDestWidget.GetValue();this.oDestWidget.SetValue(mValueWhenDisabled)}};oEL=ZCEL.Create("EnableDisableTab");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var oTabView=JSManager.GetWidget(this.GetAttrib("TabViewName")),bEnable;if(!L.isUndefined(oTabView)){bEnable=this._SearchLists(this._GetWidgetValue(oWidget),"EnableWhenSrcEquals","EnableWhenSrcNotEquals","EnableWhenSrcContains","EnableWhenSrcNotContains");oTabView.EnableTab(this.GetAttrib("TabID"),bEnable)}};oEL=ZCEL.Create("SetOptionsFromJSArray");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(!L.isUndefined(window[this.aDef.ArrayName])){var aNewOptions=window[this.aDef.ArrayName][this._GetWidgetValue(oWidget)];this.oDestWidget.SetAttrib("Options",aNewOptions)}};oEL=ZCEL.Create("SetOptionsFromAjax");oEL.prototype.Setup=function(){this.oSendFields={};JSManager.GetEvent("ManagerInit").subscribe(function(){U.ForEach(this.GetAttribDefault("SendFields",{}),function(sWidgetName,sQueryParam){var oWidget=this.oDestWidget.oForm.GetWidget(sWidgetName)||JSManager.GetWidget(sWidgetName);if(L.isNumber(sQueryParam)){sQueryParam=sWidgetName}if(oWidget){this.oSendFields[sQueryParam]=oWidget}},this)},this,true);return true};oEL.prototype.Destruct=function(){ZCEL.SetOptionsFromAjax.superclass.Destruct.apply(this,arguments);this.oSendFields={}};oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var oCallback={customevents:{onFailure:function(){JSManager.Alert(_GT("The server was unable to retrieve the data"))},onSuccess:function(sEventType,aArgs){var oResponse=YAHOO.lang.JSON.parse(aArgs[0].responseText);this.oDestWidget.SetAttrib("Options",oResponse)}},scope:this},sURL=JSManager.URL(this.oSendFields,this.GetAttrib("AjaxURL"));YAHOO.util.Connect.asyncRequest("GET",sURL,oCallback)};oEL=ZCEL.Create("SetValue_FromSource");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){oDestWidget.SetValue(this._GetWidgetValue(oWidget))};oEL=ZCEL.Create("ShowHideElements");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var Elements,bShow=this._SearchLists(this._GetWidgetValue(oWidget),"ShowWhenSrcEquals","ShowWhenSrcNotEquals","ShowWhenSrcContains","ShowWhenSrcNotContains");if(this.AttribIsset("ElementClass")){Elements=Dom.getElementsByClassName(this.GetAttrib("ElementClass"),this.GetAttribDefault("ElementType",undefined))}else{if(this.AttribIsset("ElementID")){Elements=this.GetAttrib("ElementID")}else{this.oDestWidget.Show(bShow);return }}if(bShow){Dom.removeClass(Elements,"hide")}else{Dom.batch(Elements,function(el){el.blur();Dom.addClass(el,"hide")})}};oEL=ZCEL.Create("CallJSFunction");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(this.aDef.JSArgs){eval(this.aDef.JSFunction+"("+this.aDef.JSArgs+");")}else{var fn=eval(this.aDef.JSFunction);if(L.isFunction(fn)){fn()}}};oEL=ZCEL.Create("CallObjectMethod");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var oObject=this.oDestination,sWidget=this.GetAttribDefault("Widget"),sBlockUID=this.GetAttribDefault("Block"),sMethod=this.GetAttrib("Method"),aArguments=this.GetAttribDefault("Arguments",[]);if(sWidget){oObject=JSManager.GetWidget(sWidget)}else{if(sBlockUID){oObject=JSManager.GetBlockByUniqueID(sBlockUID)}}if(oObject&&oObject[sMethod]){oObject[sMethod].apply(oObject,aArguments);if(this.GetAttribDefault("StopEvent")){Evt.stopEvent(oSrcEvent);return false}}};oEL=ZCEL.Create("SetRelatedOptions_FromSource");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var elDest=Dom.get(this.aDef.ID+".1");if(elDest){setOptionsRelatedTo(elDest,this._GetWidgetValue(oWidget))}};oEL=ZCEL.Create("SetRelatedOptions_FromInitialValue");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var sID=this.aDef.ID,elDest=Dom.get(sID+".1"),elInitial=Dom.get(sID+".initial"),opt=this._GetWidgetValue(oWidget)+"-"+elInitial.value;for(var i=0,iMax=elDest.length;i<iMax;i++){if(elDest.options[i].value==opt){elDest.value=(opt);return }}};oEL=ZCEL.Create("AutoPopulate");oEL.prototype.Setup=function(){this.aCache={};this.oLookupFields={};if(this.oDestWidget.oParent!=this.oDestWidget.oForm){this.oParent=this.oDestWidget.oParent}this.oForm=this.oDestWidget.oForm;JSManager.GetEvent("ManagerInit").subscribe(function(){U.ForEach(this.GetAttrib("LookupFields"),function(sField){var oWidget=(this.oParent&&this.oParent.GetWidget(sField))||this.oForm.GetWidget(sField)||JSManager.GetWidget(sField);if(oWidget){this.oLookupFields[sField]=oWidget}},this)},this,true);var sLoadingElementID=this.GetAttribDefault("LoadingElement"),elLoading;if(sLoadingElementID&&(elLoading=Dom.get(sLoadingElementID))){this.elLoading=elLoading}return true};oEL.prototype.Destruct=function(){ZCEL.AutoPopulate.superclass.Destruct.apply(this,arguments);this.oForm=null;this.aCache={};this.oLookupFields={};this.oParent=null};oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var oCallback={customevents:{onStart:function(){Dom.addClass(this.elLoading,"ap-loading")},onComplete:function(){Dom.removeClass(this.elLoading,"ap-loading")},onFailure:function(){JSManager.Alert(_GT("The server was unable to retrieve the data"))},onSuccess:function(sEventType,aArgs){var oResponse;if(sEventType=="fromcache"){oResponse=aArgs}else{oResponse=YAHOO.lang.JSON.parse(aArgs[0].responseText);this.aCache[sURL]=oResponse}U.ForEach(oResponse,function(sValue,sKey){var sFromColour=this.GetAttribDefault("AnimateFromColour","#0cf"),oWidget,oAnim,sBG;oWidget=(this.oParent&&this.oParent.GetWidget(sKey))||this.oForm.GetWidget(sKey)||JSManager.GetWidget(sKey);if(sValue&&oWidget){oWidget.SetValue(sValue);if(this.GetAttribDefault("AnimateWhenLoaded",true)){oAnim=new YAHOO.util.ColorAnim(oWidget._elInput);sBG=oAnim.getAttribute("backgroundColor");oAnim.attributes={backgroundColor:{from:sFromColour,to:sBG}};oAnim.duration=0.5;oAnim.animate()}}},this)}},scope:this},sURL=JSManager.URL(this.oLookupFields,this.GetAttrib("AjaxURL"));if(!L.isUndefined(this.aCache[sURL])){oCallback.customevents.onSuccess.call(this,"fromcache",this.aCache[sURL])}else{YAHOO.util.Connect.asyncRequest("GET",sURL,oCallback)}};oEL=ZCEL.Create("SetValue_ToValue");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(!this._SearchLists(this._GetWidgetValue(oWidget),"SetWhenSrcEquals","SetWhenSrcNotEquals","SetWhenSrcContains","SetWhenSrcNotContains")){return }this.oDestWidget.SetValue(this.GetAttrib("Value"))};oEL=ZCEL.Create("AddToGroupMatrix");oEL.prototype.Setup=function(){var aSrc=this.GetAttribDefault("SourceFields",[]);if(!L.isArray(aSrc)){aSrc=[aSrc]}this.SetAttrib("SourceFields",aSrc);return true};oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var oParams={},bFoundValue=false,sURL,oCallback={customevents:{onFailure:function(){JSManager.Alert(_GT("The server was unable to retrieve the data"))},onSuccess:function(sEventType,aArgs){var oResponse=YAHOO.lang.JSON.parse(aArgs[0].responseText),sTarget=oResponse.Target,oTargetWidget=this.oDestWidget,oConfig=oResponse.JSConfig,sWidgetName;if(sTarget&&sTarget!=oTargetWidget.sName){oTargetWidget=(this.oParent&&this.oParent.GetWidget(sTarget))||(this.oDestWidget.oForm&&this.oDestWidget.oForm.GetWidget(sTarget))||JSManager.GetWidget(sTarget)}if(oTargetWidget){oTargetWidget.AddRow(oResponse.RowID,oResponse.Caption,oResponse.Widgets,oResponse.JSConfig)}}},scope:this};if(this.GetAttribDefault("NoRowValues")){oParams.AddValue=(U.Keys(this.oDestWidget.GetValue()).length)||0;bFoundValue=true}else{U.ForEach(this.GetAttrib("SourceFields"),function(sWidgetName,sKey){var oSrcWidget=(this.oParent&&this.oParent.GetWidget(sWidgetName))||(this.oDestWidget.oForm&&this.oDestWidget.oForm.GetWidget(sWidgetName))||JSManager.GetWidget(sWidgetName);if(oSrcWidget){if(!L.isString(sKey)){sKey=oSrcWidget.sName}if(oSrcWidget.GetValue()){bFoundValue=true;oParams[sKey]=oSrcWidget.GetValue();oSrcWidget.Clear()}}},this)}if(!bFoundValue){U.Alert("Please select something to add to the table.")}else{sURL=JSManager.URL(oParams,this.GetAttrib("AjaxURL"));YAHOO.util.Connect.asyncRequest("GET",sURL,oCallback)}};oEL=ZCEL.Create("RemoveFromGroupMatrix");oEL.prototype.Setup=function(){var sMatrixID=this.GetAttribDefault("MatrixID"),sRowID=this.GetAttribDefault("RowID"),oWidget=this.oDestWidget;if(!sMatrixID){while(oWidget&&!(oWidget instanceof ZC.Core.Widget.Group_Matrix)){oWidget=oWidget.oParent}}else{oWidget=oWidget.GetWidget(sMatrixID)||oWidget.oForm.GetWidget(sMatrixID)||JSManager.GetWidget(sMatrixID)}if(L.isUndefined(oWidget)){return false}if(!sRowID){sRowID=oWidget.FindRowIDWithElement(this.oDestWidget._elInput);if(sRowID){this.SetAttrib("RowID",sRowID)}}this.oMatrix=oWidget;return this.AttribIsset("RowID")};oEL.prototype.Destruct=function(){ZCEL.RemoveFromGroupMatrix.superclass.Destruct.apply(this,arguments);this.oMatrix=null};oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){U.Confirm("Are you sure you want to remove "+this.oMatrix.GetRowCaption(this.GetAttrib("RowID"))+"?",this,function(){this.oMatrix.RemoveRow(this.GetAttrib("RowID"))})};oEL=ZCEL.Create("SetAttribFromField");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){U.ForEach(this.GetAttrib("AttribsToSet"),function(mField,sAttrib){if(!L.isArray(mField)){mField=[mField]}for(var i=0,iMax=mField.length;i<iMax;i++){var oWidget=this.oDestWidget.oForm.GetWidget(mField[i])||JSManager.GetWidget(mField[i]);if(oWidget&&oWidget.HasValue()){this.oDestWidget.SetAttrib(sAttrib,oWidget.GetValue());return }}},this)};oEL=ZCEL.Create("SetAttribsFromArray");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var aAttribs=this.GetAttrib("AttribValues"),TestValue,WidgetValue=this._GetWidgetValue(oWidget),i,iMax;for(i=0,iMax=aAttribs.length;i<iMax;++i){TestValue=aAttribs[i].Value;if((!L.isArray(TestValue)&&TestValue==WidgetValue)||(L.isArray(TestValue)&&U.InArray(WidgetValue,TestValue))){this.oDestWidget.SetAttribs(aAttribs[i].Attribs);return }}if(this.AttribIsset("DefaultAttribs")){this.oDestWidget.SetAttribs(this.GetAttrib("DefaultAttribs"))}};oEL=ZCEL.Create("MakeAjaxRequest");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var sBlockUID=this.GetAttribDefault("Block"),oBlock,aIncludeWidgetValues=this.GetAttribDefault("IncludeWidgetValues",{}),oGetPostVars={},oExtraRequestParams=this.GetAttribDefault("ExtraRequestParams",{}),sTransaction=this.GetAttrib("Transaction"),oParams;if((oSrcEvent.getPreventDefault&&oSrcEvent.getPreventDefault())||oSrcEvent.returnValue===false){return }if(this.oDestination instanceof ZC.Core.Block){oBlock=this.oDestination}else{if(sBlockUID){oBlock=JSManager.GetBlockByUniqueID(sBlockUID);if(!oBlock){oBlock=JSManager.GetWidget(sBlockUID)}}else{oBlock=this.oDestination.FindContainingBlock()}}if(!oBlock){YAHOO.log("Unable to find block"+(sBlockUID?(" with UniqueID "+sBlockUID):""),"warn","MakeAjaxRequest");return }Evt.stopEvent(oSrcEvent);U.ForEach(aIncludeWidgetValues,function(sWidgetName,sKey){var oWidget=this.oDestWidget.oForm.GetWidget(sWidgetName)||JSManager.GetWidget(sWidgetName);if(oWidget){if(L.isString(sKey)){oGetPostVars[sKey]=oWidget}else{oGetPostVars[sWidgetName]=oWidget}}},this);if(!L.isUndefined(oExtraRequestParams.GetPostVars)){oGetPostVars=L.merge(oExtraRequestParams.GetPostVars,oGetPostVars)}oParams=L.merge(oExtraRequestParams,{Transaction:sTransaction,GetPostVars:oGetPostVars});oBlock.AjaxRequest(oParams);return false}})();(function(){var G=YAHOO.lang,D=YAHOO.util.Dom,J=YAHOO.util.Event,C=ZC.Util,B=C.GetText,K=C.ReplaceHashTags,F="yui-pe-content",H=ZC.Core.Widget,N,A;N=H.Create("Checkbox");N.prototype.CustomSetupEnd=function(){var O=this.GetAttribDefault("CheckedClass","checked"),L;if(!this._elInput||!this.elContainer||!O){return false}L=function(){if(!this._elInput){return }D[this._elInput.checked?"addClass":"removeClass"](this.elContainer,O)};J.on(this._elInput,"change",L,this,true);J.on(this._elInput,"click",L,this,true);L.call(this);return true};N.prototype.GetValue=function(){if(!this._elInput){return undefined}return this._elInput.checked};N.prototype.HasValue=function(){return true};N.prototype.SetValue=function(L){this._elInput.checked=!!L;this._FireEventHandlers("change")};H.Boolean=N;var M=function(){};M.prototype={_FindElements:function(){var L=this.ID();if(this.IsReadOnly()){this._elInput=D.get(L);return }this.elContainer=D.get(L);this._elInput=[];if(this.aDef.OptionKeys){this._elInput=C.Map(this.aDef.OptionKeys,function(O){return D.get(this.ID(O))},this);this._elInput=C.Filter(this._elInput,function(O){return G.isObject(O)});if(this._elInput.length==0){this._elInput=null}}if(!this.elContainer){this._FindContainers()}},GetLabelForElement:function(P){var O,L=true;if(G.isUndefined(P)){P=this._elInput}else{if(!G.isArray(P)){L=false;P=[P]}}O=C.Map(P,function(R){var Q=R.id,S=D.getElementsBy(function(T){return(D.getAttribute(T,"for")==Q)},"label");if(S.length==0){return undefined}return S[0]},this);return(L)?O:O[0]},GetLabelEl:function(){var L=this._WidgetNameToID();return D.getElementBy(function(O){return(D.getAttribute(O,"for")==L)},"label")},GetOptions:function(O){var L={};C.ForEach(this._elInput,function(Q){var P=this.GetLabelForElement(Q);L[Q.value]=O?P.innerHTML:(P.textContent||P.innerText)},this);return L}};N=H.Create("Radio");G.augment(N,M,true);N.prototype._GetSelectedInput=function(){if(!this._elInput){return undefined}for(var O=0,L=this._elInput.length;O<L;++O){if(this._elInput[O].checked){return this._elInput[O]}}return undefined};N.prototype.GetValue=function(){if(this.IsReadOnly()){return this._elInput.value}var L=this._GetSelectedInput();return L?L.value:undefined};N.prototype.GetHTMLValue=function(){if(this.IsReadOnly()){return this._elInput.value}var O=this._GetSelectedInput(),L;if(!O){return undefined}L=this.GetLabelForElement(O);if(!L){return undefined}return L.innerHTML};N.prototype.GetTextValue=function(){if(this.IsReadOnly()){return this._elInput.value}var O=this._GetSelectedInput(),L;if(!O){return undefined}L=this.GetLabelForElement(O);if(!L){return undefined}return(L.textContent||L.innerText)};N.prototype.SetValue=function(O){if(G.isUndefined(O)){return this.Clear()}for(var P=0,L=this._elInput.length;P<L;++P){if(this._elInput[P].value==O){this._elInput[P].checked=true;this._FireEventHandlers("change");return }}};N.prototype.Clear=function(){if(!G.isUndefined(this.GetValue())){D.batch(this._elInput,function(L){L.checked=false});this._FireEventHandlers("change")}};N=H.Create("CheckboxGroup");G.augment(N,M,true);N.prototype.CustomSetupEnd=function(){J.on(this._elInput,"change",function(L){this._ToggleSelectedClass(J.getTarget(L))},this,true);if(YAHOO.env.ua.ie){J.on(this._elInput,"click",function(L){this._ToggleSelectedClass(J.getTarget(L))},this,true)}C.ForEach(this._elInput,this._ToggleSelectedClass,this);return true};N.prototype._ToggleSelectedClass=function(L){if(L){var O=this.GetAttribDefault("SelectedClass","checked");elAncestor=D.getAncestorByTagName(L,"tr");D[L.checked?"addClass":"removeClass"](elAncestor,O)}};N.prototype._GetSelectedInputs=function(){return C.Filter(this._elInput,function(L){return L.checked})};N.prototype.GetValue=function(){var L=this._GetSelectedInputs();return C.Map(L,function(O){return O.value})};N.prototype.GetTextValue=function(){var O=this._GetSelectedInputs(),L;if(!O.length){return this.aDef.FormattedValueWhenEmpty||""}L=C.Map(this.GetLabelForElement(O),function(P){return(P.textContent||P.innerText)});return L.join("\n")};N.prototype.GetHTMLValue=function(){var O=this._GetSelectedInputs(),L;if(!O.length){return this.aDef.FormattedValueWhenEmpty||""}L=C.Map(this.GetLabelForElement(O),function(P){return P.innerHTML});return L.join(this.aDef.HTMLValueSeparator||"<br />")};N.prototype.SetValue=function(O){var L=false;C.ForEach(this._elInput,function(P){if(C.InArray(P.value,O)){if(!P.checked){P.checked=true;L=true;this._ToggleSelectedClass(P)}}else{if(P.checked){P.checked=false;L=true;this._ToggleSelectedClass(P)}}},this);if(L){this._FireEventHandlers("change")}};N.prototype.EnableOption=function(L,O){if(!G.isArray(L)){L=[L]}var P=O?"removeClass":"addClass";C.ForEach(this._elInput,function(Q){if(C.InArray(Q.value,L)){Q.disabled=!O;var R=D.getAncestorByTagName(Q,"tr");D[P](R,"disabled")}})};N=H.Create("Select");var I=function(){var L,O,P;P=function(S,R){if(S){R=J.getTarget(S)}if(this.sOldOptionClass){D.removeClass(R,this.sOldOptionClass)}var Q=R.options[R.selectedIndex],T=D.getAttribute(Q,"class");if(T){D.addClass(R,T);this.sOldOptionClass=T}};if(this.GetAttribDefault("CopyOptionClass")){J.on(this._elInput,"change",P,this,true);J.on(this._elInput,"keydown",function(){this.oKeyInterval=G.later(10,this,function(){var Q;if(G.isArray(this._elInput)){Q=this._elInput[0]}else{Q=this._elInput}P.call(this,false,Q)})},this,true);J.on(this._elInput,"keyup",function(){if(this.oKeyInterval){this.oKeyInterval.cancel()}},this,true);D.batch(this._elInput,function(Q){P.call(this,false,Q)},this,true)}return true};N.prototype.CustomSetupEnd=I;N.prototype.GetValue=function(L){if(!this._elInput||(this._elInput.type=="hidden"&&this._elInput.tagName.toLowerCase()=="input")){this.bHiddenField=true;this.GetValue=H.Select.superclass.GetValue}else{if(this._elInput.type=="select-one"){this.GetValue=function(O){if(!this._elInput){return undefined}var P=this._elInput.selectedIndex;if(P<0){return undefined}var Q=this._elInput.options[P];return O?Q.text:Q.value}}else{this.GetValue=function(P){if(!this._elInput){return undefined}var O=[];C.ForEach(this._elInput.options,function(Q){if(Q.selected){O.push(P?Q.text:Q.value)}});return O}}}return this.GetValue(L)};N.prototype.GetTextValue=function(){return this._GetFormattedValue("\n")};N.prototype.GetHTMLValue=function(){return this._GetFormattedValue(this.aDef.HTMLValueSeparator||"<br />")};N.prototype._GetFormattedValue=function(O){if(this.bHiddenField){return(this.elContainer.textContent||this.elContainer.innerText)}var L=this.GetValue(true);if(L.length==0){return(this.aDef.FormattedValueWhenEmpty||"")}if(!G.isArray(L)){return L}return L.join(O)};N.prototype.SetValue=function(Q){var T=!G.isArray(Q),P=false;if(this._elInput.type=="hidden"&&this._elInput.tagName.toLowerCase()=="input"){return H.Select.superclass.SetValue(Q)}for(var R=0,L=this._elInput.length;R<L;++R){var S=this._elInput.options[R];if(T){if(S.value==Q){if(!S.selected){S.selected=true;this._FireEventHandlers("change")}return }}else{var O=C.InArray(S.value,Q);P=P||(S.selected!=O);S.selected=O}}if(P){this._FireEventHandlers("change")}};N.prototype.AttribMethod_Options=function(Q){var L=(this._elInput.type=="select-one")?[this.GetValue()]:this.GetValue();this._elInput.options.length=0;for(var O in Q){if(G.hasOwnProperty(Q,O)){var P=document.createElement("option");P.value=String(O);P.innerHTML=String(Q[O]);P.selected=C.InArray(O,L);this._elInput.appendChild(P)}}};N.prototype.Clear=function(){if(this._elInput&&this._elInput.options){var L=this._elInput.options[0].value;if(L.match(/^(_?_?Any_?_?|)$/i)){this._elInput.selectedIndex=0}}};H.Create("Reference","Core",N);N=H.Create("Text");N.prototype.InsertText=function(L){C.InsertAtCursor(this._elInput,L)};N=H.Create("TextArea");N.prototype.CustomSetupEnd=function(){if(this.aDef.Size){this.AddEvent(this.UpdateNRemaining,["keyup","focus"],this);this.AddEvent(this.HideNRemaining,"blur",this)}return true};N.prototype.UpdateNRemaining=function(R){if(G.isUndefined(this._elRemaining)){this._elRemaining=document.createElement("span");this._elRemaining.className="textarea-remainingchars";D.insertAfter(this._elRemaining,this._elInput)}var Q=this.GetValue().length,L=this.aDef.Size,U="";var P=L-Q;if(P>=0){U=C.sprintf(B("Used %1$d of %2$d characters, %3$d remaining."),Q,L,P)}else{U=C.sprintf(B("Used %1$d of %2$d characters."),Q,L)}this._elRemaining.innerHTML=U;var T=Q>L;var S=T?"invalid":"valid";var O=T?"valid":"invalid";D.replaceClass(this._elRemaining,O,S);D.removeClass(this._elRemaining,"invisible")};N.prototype.HideNRemaining=function(L){if(this._elRemaining){D.addClass(this._elRemaining,"invisible")}};N.prototype.Validate=function(){var O=this.GetValue().length,L=this.aDef.Size;var P=C.sprintf(B("Please reduce this to %d characters, it is currently at %d."),L,O);if(O>L){this.SetValid(false,P);return false}return H.TextArea.superclass.Validate.call(this)};N.prototype.InsertText=function(L){C.InsertAtCursor(this._elInput,L)};N=H.Create("Group");N.prototype.CustomSetupEnd=function(){if(this.aDef.HideFields){var Q,R,P,O,S,T,L,U;S=this.GetAttribDefault("LabelShow",B("Show"));T=this.GetAttribDefault("LabelHide",B("Hide"));sShowLinkTooltip=this.GetAttribDefault("ShowLinkTooltip",B("Show this section"));sHideLinkTooltip=this.GetAttribDefault("HideLinkTooltip",B("Hide this section"));Q=this.aDef.ID;R=D.get(Q+"-toggle");this.elContainer=D.get(Q+"-hidediv");if(!R){return true}O=this.elOpenCloseLink=document.createElement("a");O.href="#";O.innerHTML=S;this.oOpenCloseTooltip=new YAHOO.widget.Tooltip("grp-oc-tt-"+this.sName,{context:O,autofillheight:false,autodismissdelay:120000,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},text:sShowLinkTooltip});R.appendChild(O);var P=function(V){if(V){J.stopEvent(V)}if(this.IsVisible()){this.Hide();this.elOpenCloseLink.innerHTML=S;this.oOpenCloseTooltip.cfg.setProperty("text",sShowLinkTooltip)}else{this.Show();this.elOpenCloseLink.innerHTML=T;this.oOpenCloseTooltip.cfg.setProperty("text",sHideLinkTooltip)}};J.on(O,"click",P,this,true);if(this.IsVisible()){P.call(this)}}return true};N.prototype.GetTextValue=function(){var L=C.Map(this.aChildWidgets,function(O){return O.GetTextValue()});return L.join(this.aDef.TextValueSeparator||", ")};N.prototype.GetHTMLValue=function(){var L=C.Map(this.aChildWidgets,function(O){return O.GetHTMLValue()});return L.join(this.aDef.HTMLValueSeparator||"<br />")};N.prototype.GetValue=function(){var L={};C.ForEach(this.aChildWidgets,function(P,O){L[O]=P.GetValue()});return L};N.prototype.Enable=function(L,P,O){C.ForEach(this.aChildWidgets,function(Q){Q.Enable(L,P,O)})};H.Create("Document","Core",N);H.Create("Group_List","Core",N);N=H.Create("Group_Matrix","Core",H.Group);N.prototype.CustomSetupEnd=function(){H.Group_Matrix.superclass.CustomSetupEnd.call(this);this.elHeading=D.getFirstChildBy(this._elInput,function(O){return O.tagName.toLowerCase()=="thead"});this.elBody=D.getFirstChildBy(this._elInput,function(O){return O.tagName.toLowerCase()=="tbody"});var L=function(){var P=D.getChildrenBy(this.elBody,function(Q){return Q.tagName.toLowerCase()=="tr"}),O=C.Map(P,function(Q){return D.getFirstChild(Q).id.replace(this._elInput.id+"__","")},this);this.oForm.AddHiddenField(this.sName+"_rowvalues",O)};this.oForm.AddEvent(L,"submit",this);return true};N.prototype._FindContainers=function(){var L=D.get("tr_"+this.GetAttrib("WidgetID"));if(L){this.elContainer=L}return H.Group_Matrix.superclass._FindContainers.apply(this,arguments)};N.prototype.GetValue=function(){var L={};C.ForEach(H.Group_Matrix.superclass.GetValue.call(this),function(P,O){if(O=="AddValue"||O=="AddButton"){return }L[O.substr(6)]=P});return L};N.prototype.SetValue=function(){throw new Error("SetValue not implemented for Group_Matrix widgets")};N.prototype.AddRow=function(T,L,P,R){var O=document.createElement("tr"),S=document.createElement("th"),Q=this._elInput.id+"__"+T;if(D.get(Q)){return }if(!this.GetAttribDefault("NoRowValues")){S.scope="row";S.id=Q;S.innerHTML=L;O.appendChild(S)}C.ForEach(P,function(U){var V=document.createElement("td");V.innerHTML=U;O.appendChild(V)});this.elBody.appendChild(O);D.removeClass(this.elHeading,"hide");if(R){this.AddChildWidget("gmrow_"+T,R)}};N.prototype.RemoveRow=function(S){var Q,O,L=this._elInput.id+"__",R,P;if(S.indexOf(L)==-1){S=L+S}Q=D.get(S);if(Q){O=Q.parentNode;P=function(){O.parentNode.removeChild(O);if(!D.getFirstChildBy(this.elBody,function(T){return T.tagName.toLowerCase()=="tr"})){D.addClass(this.elHeading,"hide")}};if(YAHOO.util.Anim){R=new YAHOO.util.Anim(O,{opacity:{from:100,to:0}},0.5);R.onComplete.subscribe(P,this,true);R.animate()}else{P.call(this)}}this.RemoveChildWidget("gmrow_"+S.replace(L,""))};N.prototype.FindRowIDWithElement=function(P){var O,Q,L=this._elInput.id+"__";while(D.isAncestor(this._elInput,P)){O=D.getAncestorByTagName(P,"tr");Q=D.getFirstChild(O).id;if(Q.indexOf(L)<0){P=O.parentNode}else{return Q.replace(L,"")}}return undefined};N.prototype.GetRowCaption=function(O){var L=D.get(this._elInput.id+"__"+O);if(L){return(L.textContent||L.innerText)}else{return O}};N=H.Create("TextInsertion","Core",N);N.prototype.CustomSetupEnd=function(){ZC.JSManager.GetEvent("ManagerInit").subscribe(function(){var O,L;O=this.GetAttrib("Destination");this.oDestWidget=this.oParent.GetWidget(O)||((this.oParent!=this.oForm)&&this.oForm.GetWidget(O))||ZC.JSManager.GetWidget(O);if(!this.oDestWidget){return }var L=function(){this.oDestWidget.InsertText(decodeURIComponent(this.GetWidget("SelectTag").GetValue()))};this.GetWidget("Insert").AddEvent(L,"click",this);this.GetWidget("SelectTag").AddEvent(L,"dblclick",this)},this,true);return true};ZC.Util.YUIButtonWrapper=function(P,S,O){var T,R,L={},Q=false;if(S.Type){L.type=S.Type}D.removeClass(P,F);if(P.onclick){Q=P.onclick}if(YAHOO.env.ua.gecko&&P.getAttribute("type")=="submit"){P.type="button";L.type="submit"}this.oWidget=O;this.oYUIButton=T=new YAHOO.widget.Button(P,L);T.zcWidget=O;if(P.className){T.addClass(P.className)}if(O){T.on("click",function(U){this._EventDispatcher("click",U)},O,true);if(Q){O.AddEvent(Q,"click",O)}}if(G.isObject(S)){if(S.IconImage&&S.IconWidth){R=(T.getElementsByClassName("first-child"))[0].firstChild;D.setStyle(R,"background-image","url("+S.IconImage+")");D.setStyle(R,"background-repeat","no-repeat");iPadding=Number(S.IconWidth);if(S.IconNoCaption){T.set("label","");D.setStyle(R,"padding-left",iPadding+"px");D.setStyle(R,"padding-right","0px");D.setStyle(R,"background-position","50% 50%")}else{iPadding+=10;if(S.IconPosition=="right"){J.onContentReady(D.generateId(R),function(){var U=D.getRegion(R);D.setStyle(R,"padding-right",iPadding+"px");D.setStyle(R,"background-position",(U.width-7)+"px 50%")})}else{D.setStyle(R,"padding-left",iPadding+"px");D.setStyle(R,"background-position","7px 50%")}}}}};ZC.Util.YUIButtonWrapper.prototype={Destruct:function(){this.oYUIButton=null},Enable:function(L){if(G.isUndefined(L)){L=true}this.oYUIButton.set("disabled",!L)}};N=H.Create("Submit");N.prototype.CustomSetupEnd=function(){var O,P,Q,R;if(!this._elInput){return false}if(Q=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,Q,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}if(P=this.GetAttribDefault("LoadingMessage")){O=new YAHOO.widget.Panel(D.generateId(this._elInput)+"wait",{fixedcenter:true,close:false,draggable:false,zindex:40000,modal:true,visible:false});O.setHeader(P);O.setBody('<img style="margin: 0 auto; display: block;" width="220" height="19" src="/zc/images/ajax-loader-bar.gif">');O.render(document.body);J.on(this._elInput,"click",function(){O.show()})}if(R=this.GetAttribDefault("Confirm")){var L=function(S){if(!confirm(R)){J.stopEvent(S)}};if(this.oButtonWrapper){J.on(this.oButtonWrapper.oYUIButton.getForm(),"submit",L)}else{J.on(this._elInput.form,"submit",L)}}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};N.prototype.Destruct=function(){H.Submit.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};N.prototype.AttribMethod_value=function(L){this._elInput.value=L;if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.set("label",L)}};N.prototype.Enable=function(L,P,O){H.Submit.superclass.Enable.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};N.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};N=H.Create("Button");N.prototype.CustomSetupEnd=function(){var L;if(!this._elInput){return false}if(L=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,L,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};N.prototype.Destruct=function(){H.Button.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};N.prototype.Enable=function(L){H.Button.superclass.Enable.call(this,L);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};N.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};N.prototype._WireUpEvent=function(L){if(L=="click"){return true}return H.Button.superclass._WireUpEvent.apply(this,arguments)};H.Create("AutoPopulate","Core",H.Button);N=H.Create("Reset");N.prototype.CustomSetupEnd=function(){var L;if(!this._elInput){return false}if(L=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,L,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}this.AddEvent(function(O){var P=this.GetAttribDefault("Confirm");if(P){if(!confirm(P)){J.stopEvent(O);return }}if(this.oForm){this.oForm.Reset();J.stopEvent(O)}},"click",this,10);return true};N.prototype.Destruct=function(){H.Reset.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};N.prototype.Enable=function(L){H.Reset.superclass.Enable.call(this,L);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};N.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};N=H.Create("Button_Clear");N.prototype.CustomSetupStart=function(){var R,S,Q,P,O,L;if(!this._elInput){return false}R=document.createElement("input");S=this._elInput.attributes;for(O=0,L=S.length;O<L;O++){D.setAttribute(R,S[O].nodeName,S[O].nodeValue)}R.type="button";R.value=this.aDef.Caption||"Clear";P=function(T){if(this.oForm){this.oForm.Clear()}J.stopEvent(T)};J.on(R,"click",P,this,true);this._elInput.parentNode.replaceChild(R,this._elInput);this._elInput=R;if(Q=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,Q,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};N.prototype.Destruct=function(){H.Button_Clear.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};N.prototype.Enable=function(L){H.Button_Clear.superclass.Enable.call(this,L);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};N.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};N=H.Create("Link");N.prototype.CustomSetupEnd=function(){var L,P,O;if(!this._elInput){YAHOO.log("CustomSetupEnd: no _elInput","warn","Link "+this.sName);return false}if(L=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,L,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}if(P=this.GetAttribDefault("Confirm")){O=function(Q){if(!confirm(P)){J.stopEvent(Q)}};this.AddEvent(O,"click",this,10)}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};N.prototype.Destruct=function(){H.Link.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};N.prototype.Enable=function(L){H.Link.superclass.Enable.call(this,L);if(this.oButtonWrapper){var O=this.oButtonWrapper.oYUIButton;if(this.IsEnabled()){O.removeStateCSSClasses("disabled");O.set("onclick",this._oldOnClick)}else{if(O.hasFocus()){O.blur()}O.addStateCSSClasses("disabled");O.removeStateCSSClasses("hover");O.removeStateCSSClasses("active");O.removeStateCSSClasses("focus");this._oldOnClick=O.get("onclick");O.set("onclick",{scope:O,fn:function(P){J.stopEvent(P);this.blur()}})}}};N.prototype.AttribMethod_href=function(L){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.set("href",L)}else{this._elInput.href=L}};N.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};N.prototype.PreventCaching=function(){var L=this.GetAttribDefault("href",this._elInput.href);L=ZC.JSManager.URL({nocache:(new Date()).getTime()},L);this.SetAttrib("href",L)};N=H.Create("Links_Button");N.prototype.CustomSetupEnd=function(){var P,T,O,L,S,Q,R;if(!this._elInput){return false}P=this.GetAttribDefault("YUIButtonDef");T=D.getFirstChild(this._elInput);if(T.tagName.toLowerCase()=="a"){S=T.href}L=document.createElement("input");L.type="button";L.value=(T.textContent||T.innerText);L.className=T.className;L.id=T.id;T.parentNode.replaceChild(L,T);D.removeClass(this._elInput.id+"_menu",F);this.oYUIButton=new YAHOO.widget.Button(L,{type:(S?"split":"menu"),menu:this._elInput.id+"_menu"});this.oYUIButton.getMenu().subscribe("render",function(){document.body.appendChild(this.element)});if(R=this.GetAttribDefault("Confirm")){fnClickHandler=function(U){if(!confirm(R)){J.stopEvent(U);this.bCancelled=true}else{this.bCancelled=false}};this.AddEvent(fnClickHandler,"click",this,10)}if(S&&!this.GetAttribDefault("LinksDisabled")){this.AddEvent(function(V){if(this.bCancelled){return }var U=D.getAttribute(this._elInput,"target"),W;if(U&&U!="_self"){var W=window.open(S,U);if(W){return }YAHOO.log("window.open returned null, fallback to current window","debug","Links_Button")}window.location=S},"DefaultLink",this,500)}else{if(this.GetAttribDefault("LinksDisabled")){this.oYUIButton.addClass("yui-button-disabled");this.oYUIButton.getMenu().cfg.setProperty("disabled",true)}}return true};N.prototype._WireUpEvent=function(L){switch(L){case"click":this.oYUIButton.getMenu().subscribe(L,function(P,O){this._EventDispatcher(L,O[0])},this,true);case"DefaultLink":if(this.oYUIButton.get("type")=="menu"){return }this.oYUIButton.on("click",function(O){this._EventDispatcher(L,O)},this,true);break;default:this.oYUIButton.on(L,function(O){this._EventDispatcher(L,O)},this,true);break}};N.prototype.Destruct=function(){H.Links_Button.superclass.Destruct.apply(this,arguments);this.oYUIButton=null};N=H.Create("MenuButton");N.prototype.CustomSetupStart=function(){if(this.GetAttribDefault("Widgets",[]).length<2){return false}var Q=D.get(this.aDef.Widgets.MenuOptions.ID),P=D.get(this.aDef.Widgets.MenuSubmit.ID),Z,X,W,S,U,V,O,Y=[];if(!Q||!P){return false}this._elInput=Q;var L;if(!this.AttribIsset("Default")){L="menu";for(var T=0,R=Q.options.length;T<R;T++){if(Q.options[T].value==""){Q.removeChild(Q.options[T]);break}}}else{L="split"}if(!this.AttribIsset("Options")){O=Q}else{Z=document.createElement("input");Z.type="button";Z.id=P.id;Z.name=P.name;Z.value=P.value;P.parentNode.replaceChild(Z,P);P=Z;W=function(g,f,c){var b=true,d=c.Widget.oYUIMenuButton,a;Q.value=this.value;c.Widget.oForm.AddHiddenField(d.get("name"),d.get("value"));c.Widget._FireEventHandlers("click",this);if(c.Events){C.ForEach(c.Events,function(h){b=b&&ZC.JSManager.GetEvent(c.Widget._InternalEventName(h)).fire(this,c.Widget)},this)}if(c.Widget.GetAttribDefault("Submit",true)&&b&&c.Submit){c.Widget.bSubmitted=true;d.submitForm()}return b};S=function(b){var a=[];C.ForEach(b,function(d,c){var f,g={value:c,onclick:{fn:W,obj:{Widget:this,Submit:true}}};if(G.isObject(d)){g.onclick.obj.Submit=G.isUndefined(d.Submit)||d.Submit;g.onclick.obj.Events=!G.isUndefined(d.Events)?d.Events:false;if(!G.isUndefined(d.Group)){g=S.call(this,d.Options);if(G.isString(g.Group)){Y.push(g.Group)}else{Y.push(false)}}else{g.text=d.Text;if(!G.isUndefined(d.Options)){if(!G.isUndefined(d.Selectable)&&!d.Selectable){delete g.onclick}f=S.call(this,d.Options);if(f.length){g.submenu={id:D.generateId(),itemdata:f}}}}}else{g.text=d}a.push(g)},this);return a};D.addClass(Q,"hide");O=S.call(this,this.GetAttrib("Options"))}if(YAHOO.env.ua.gecko){P.type="button"}this.oYUIMenuButton=new YAHOO.widget.Button(P,{type:L,menu:O});C.ForEach(Y,function(a,b){if(a){this.oYUIMenuButton.setItemGroupTitle(a,b)}},this);if(this.AttribIsset("Default")){this.oYUIMenuButton.subscribe("click",function(a){this.SetValue(this.GetAttrib("Default"));this._FireEventHandlers("click",a)},this,true);if(!C.Any(Q.options,function(a){return(a.value==this.GetAttrib("Default"))},this)){X=document.createElement("option");X.value=this.GetAttrib("Default");Q.appendChild(X)}}if(U=this.GetAttribDefault("LoadingMessage")){V=new YAHOO.widget.Panel(D.generateId(this._elInput)+"wait",{fixedcenter:true,close:false,draggable:false,zindex:40000,modal:true,visible:false});V.setHeader(U);V.setBody('<img style="margin: 0 auto; display: block;" width="220" height="19" src="/zc/images/ajax-loader-bar.gif">');V.render(document.body);this.oYUIMenuButton.getMenu().subscribe("click",function(){if(this.bSubmitted){V.show()}},this,true)}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}if(YAHOO.env.ua.gecko){G.later(0,this.oYUIMenuButton,function(){this.get("srcelement").type="submit";this.submitForm();this.get("srcelement").type="button"})}},"click",this);this.aDef.Widgets=[];return true};N.prototype.Destruct=function(){H.MenuButton.superclass.Destruct.apply(this,arguments);this.oYUIMenuButton=null};N.prototype._WireUpEvent=function(L){switch(L){case"click":this.oYUIMenuButton.getMenu().subscribe(L,function(P,O){this._EventDispatcher(L,O[0])},this,true);case"DefaultLink":if(this.oYUIMenuButton.get("type")=="menu"){return }this.oYUIMenuButton.on("click",function(O){this._EventDispatcher(L,O)},this,true);break;default:this.oYUIMenuButton.on(L,function(O){this._EventDispatcher(L,O)},this,true);break}};N=H.Create("Password");N.prototype.GetTextValue=function(){return C.StrRepeat("*",this.GetValue().length)};N=H.Create("Password_Change","Core",N);N.prototype.GetValue=function(){return this._elInput[0].value};N.prototype._FindElements=function(){var L;L=this._WidgetNameToID();this._elInput=[D.get(L),D.get(L+"_confirm")];this._FindContainers()};N.prototype.Validate=function(){var O,L;O=this._elInput[0].value;L=this._elInput[1].value;if(O&&L&&O!=L){this.SetValid(false,B("The two passwords do not match"));return false}return N.superclass.Validate.call(this)};N=H.Create("LinkedSelect");N.prototype.bChangeRODisplay=false;N.prototype.CustomSetupEnd=I;N.prototype.CustomSetupStart=function(){this.sSeparator=this.GetAttrib("Separator");if(this._elInput.length){initLinkedSelect(this._elInput);return true}return false};N.prototype._FindElements=function(){var P,O,L;P=this._WidgetNameToID();O=this.GetAttribDefault("FirstVisibleLevel",0);this._elInput=[];do{L=D.get(P+"."+O);if(L){this._elInput.push(L)}O++}while(L);this._FindContainers()};N.prototype.Clear=function(){C.ForEach(this._elInput,function(L){if(C.InArray(L.options[0].value,["Any","__Any__",""])){L.selectedIndex=0}if(G.isFunction(L.onchange)){L.onchange()}})};N.prototype.GetValue=function(){var L=this.GetCompoundValue();if(G.isUndefined(L)){return undefined}return L.pop()};N.prototype.GetCompoundValue=function(){var L;if(G.isUndefined(this._elInput)||G.isUndefined(this._elInput[this._elInput.length-1])){return undefined}L=this._elInput[this._elInput.length-1].value;aValues=L.split(this.sSeparator);return aValues};N.prototype.GetTextValue=function(){if(G.isUndefined(this._elInput)){return undefined}var O=0,L="";while(O<this._elInput.length){if(G.isUndefined(this._elInput[O])){return undefined}L+=this._elInput[O].options[this._elInput[O].selectedIndex].text+" ";O++}return L};A=H.Create("LinkedSelect_AllWidgetValues","Core",N);A.prototype.GetValue=function(){var L=this.GetCompoundValue();return L};H.Create("LinkedSelect_AllowBlank","Core",N);H.Create("LinkedSelect_LinkedSearch","Core",N);A=H.Create("LinkedSelect_Multiple","Core",N);A.prototype.CustomSetupStart=function(){if(!A.superclass.CustomSetupStart.apply(this,arguments)){return false}var O,S,L,Q,R,P;O=this.oForm.sName+"."+this.sName;S=O+".collection";this.elCollection=D.get(S);LinkedMultipleSelect_SynchroniseHiddenField(S,O);LinkedSelect_RegisterMultiple(O+"."+this.GetAttrib("MaxLevel"),S);R=function(){LinkedMultipleSelect_AddSelected(this._elInput,S,O);this._EventDispatcher("change")};P=function(){LinkedMultipleSelect_RemoveSelected(this._elInput,S,O);this._EventDispatcher("change")};J.on(this._WidgetNameToID()+"_Select","click",R,this,true);J.on(this._WidgetNameToID()+"_Deselect","click",P,this,true);return true};A.prototype._WireUpEvent=function(L){if(L=="change"){return }return A.superclass._WireUpEvent.apply(this,arguments)};var E=function(O){if(!this.elCollection){return undefined}var L=[];C.ForEach(this.elCollection.options,function(P){L.push(O?P.text:P.value)});return L};A.prototype.GetValue=function(){return C.Map(E.call(this,false),function(L){return L.replace(/^.*-/,"")})};A.prototype.GetTextValue=function(){return E.call(this,true)};A=H.Create("SelectRelated","Core",N);A.prototype.CustomSetupStart=function(){if(this._elInput.length){initSelectRelated(this._elInput);return true}return false};N=H.Create("DateTime_FromRange");N.prototype.CustomSetupStart=function(){C.ForEach(["FromDate","ToDate","FromTime","ToTime"],function(L){if(!this.AttribIsset(L)){N.superclass.SetAttrib.call(this,L,new Date())}else{var O=this.GetAttrib(L);if(G.isNumber(O)||O.match(/^\d+$/)){N.superclass.SetAttrib.call(this,L,new Date(O*1000))}else{N.superclass.SetAttrib.call(this,L,new Date(O))}}},this);return true};N.prototype.GetValue=function(){var P=this.aChildWidgets.Date,O=this.aChildWidgets.Time,R=["1970-01-01"],Q=[""],L=[],S;if(!G.isUndefined(P)&&!G.isUndefined(P.GetValue())){R=P.GetValue()}if(!G.isUndefined(O)&&!G.isUndefined(O.GetValue())){Q=O.GetValue()}C.ForEach(R,function(T){C.ForEach(Q,function(U){L.push(new Date(T+" "+U))})});if(this.GetAttribDefault("Multiple")){return L}else{return L[0]}};N.prototype.GetTextValue=function(){var O=this.GetValue(),L=YAHOO.util.Date.format,P=this.GetAttrib("DisplayFormat");if(G.isUndefined(O)){return this.GetAttribDefault("DisplayValueWhenNull","")}else{if(G.isArray(O)){return C.Map(O,function(Q){return L(Q,{format:P})}).join(this.GetAttribDefault("ValueSeparator",", "))}else{return L(this.GetValue,{format:P})}}};N.prototype.SetValue=function(S){var P=this.aChildWidgets.Date,L=this.aChildWidgets.Time,O=YAHOO.util.Date.format,R=[],Q=[];if(this.GetAttribDefault("Multiple")&&G.isArray(S)){if(P){R=C.Map(S,function(T){O(T,"%Y-%m-%d")});P.SetValue(R)}if(L){Q=C.Map(S,function(T){O(T,"%H:%M")});L.SetValue(Q)}}else{if(!(S instanceof Date)){if(G.isNumber(S)){S=new Date(S*1000)}else{S=new Date(S)}if(!S){return }}if(P){P.SetValue(O(S,"%Y-%m-%d"))}if(L){L.SetValue(O(S,"%H:%M"))}}};N.prototype.SetAttrib=function(U,L){var Q=this.aChildWidgets.Date,S=this.aChildWidgets.Time,P=YAHOO.util.Date.format,V={},O={},R;N.superclass.SetAttrib.apply(this,arguments);R=this.GetValue();switch(U){case"DateOptions":if(Q){Q.SetAttrib("Options",L)}break;case"TimeOptions":if(S){S.SetAttrib("Options",L)}break;case"FromDate":case"ToDate":if(!Q){return }oFromDate=this.GetAttrib("FromDate");oToDate=this.GetAttrib("ToDate");for(var T=new Date(oFromDate.getTime());T<=oToDate;T.setTime(T.getTime()+86400000)){V[P(T,{format:"%Y-%m-%d"})]=P(T,{format:this.GetAttrib("DateFormat")})}Q.SetAttrib("Options",V);return ;case"FromTime":case"ToTime":if(!S){return }oFromTime=this.GetAttrib("FromTime");oToTime=this.GetAttrib("ToTime");for(var T=new Date(oFromTime.getTime());T<=oToTime;T.setTime(T.getTime()+86400000)){O[P(T,{format:"%H:%M"})]=P(T,{format:this.GetAttrib("TimeFormat")})}S.SetAttrib("Options",O);break;default:return }this.SetValue(R)};H.Create("Date_FromRange","Core",N);H.Create("Time_FromRange","Core",N);N=H.Create("Integer");N.prototype.Validate=function(){if(!H.Integer.superclass.Validate.call(this)){return false}var O=C.Trim(this.GetValue()),P=this.GetAttribDefault("Min"),L=this.GetAttribDefault("Max");if(O==""){return true}if(!O.match(/^\d+$/)){this.SetValid(false,B(this.GetAttrib("WholeNumberValMsg")));return false}O=parseInt(O);if(P!==false&&O<P){this.SetValid(false,K(B(this.GetAttrib("MinValMsg")),{MIN:P}));return false}if(L!==false&&O>L){this.SetValid(false,K(B(this.GetAttrib("MaxValMsg")),{MAX:L}));return false}this.SetValid(true);return true}})();(function(){var A=YAHOO.lang,C=YAHOO.util.Dom,F=YAHOO.util.Event,B=ZC.Util,E=ZC.Util.GetText,G=ZC.Util.sprintf;var D;D=ZC.Core.Validator.Create("HaveContextID","Travel");D.prototype.Validate=function(I,H){var K=H.GetAttribDefault("ContextIDFields",[]);var J=B.Filter(K,function(L){return this.GetWidget(L).GetValue()},H);return J.length==1}})();(function(){var A=YAHOO.lang,C=YAHOO.util.Dom,D=YAHOO.util.Event,B=ZC.Util;ZC.Core.Widget.Create("TextArea_NoNaughtyHTML","Travel",ZC.Core.Widget.TextArea)})();
