/*
 * 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 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 fnArrayWrap=function(aArray,fnCallback,oThis,fnImpl){if(L.isUndefined(aArray)){return[]}if(!L.isFunction(fnCallback)){throw new TypeError()}if(!L.isUndefined(aArray.length)){return fnImpl.call(aArray,fnCallback,oThis)}else{return fnImpl.call(this.Keys(aArray),this.ObjectArrayWrapper(aArray,fnCallback),oThis)}};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){this.GetPageScrollTop();oAnim=new YAHOO.util.Scroll(this.bUseDocumentElement?document.documentElement:document.body,{scroll:{to:aToXY}},fDuration,fnEasing);oAnim.animate()}},GetPageScrollTop:function(){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}return(this.bUseDocumentElement?document.documentElement.scrollTop:document.body.scrollTop)},SetPageScrollTop:function(iScrollTop){if(L.isUndefined(this.bUseDocumentElement)){this.GetPageScrollTop()}if(this.bUseDocumentElement){document.documentElement.scrollTop=iScrollTop}else{document.body.scrollTop=iScrollTop}},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)}},ObjectArrayWrapper:function(oObj,fnWrapped){return function(sObjKey){return fnWrapped.call(this,oObj[sObjKey],sObjKey)}},InArray:function(Value,aSearch){return(this.IndexOf(aSearch,Value)>=0)},IndexOf:function(aSearch,SearchElement,iFrom){var fnImpl;if(Array.prototype.indexOf){fnImpl=Array.prototype.indexOf}else{fnImpl=function(SearchElement,iFrom){iFrom=Number(iFrom)||0;var iLen=this.length;if(iFrom<0){iFrom+=iLen}for(;iFrom<iLen;iFrom++){if(iFrom in this&&this[iFrom]===SearchElement){return iFrom}}return -1}}return fnImpl.call(aSearch,SearchElement,iFrom)},LastIndexOf:function(aSearch,SearchElement,iFrom){var fnImpl;if(Array.prototype.lastIndexOf){fnImpl=Array.prototype.lastIndexOf}else{fnImpl=function(SearchElement,iFrom){var iLen=this.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 this&&this[iFrom]===SearchElement){return iFrom}}return -1}}return fnImpl.call(aSearch,SearchElement,iFrom)},ForEach:function(aArray,fnCallback,oThis){var fnImpl;if(Array.prototype.forEach){fnImpl=Array.prototype.forEach}else{fnImpl=function(fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}for(var i=0,iMax=this.length;i<iMax;i++){if(i in this){fnCallback.call(oThis,this[i],i,this)}}}}fnArrayWrap.call(this,aArray,fnCallback,oThis,fnImpl)},Map:function(aArray,fnCallback,oThis){var fnImpl;if(Array.prototype.map){fnImpl=Array.prototype.map}else{fnImpl=function(fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=this.length;var aResult=new Array(iLen);for(var i=0;i<iLen;i++){if(i in this){aResult[i]=fnCallback.call(oThis,this[i],i,this)}}return aResult}}return fnArrayWrap.call(this,aArray,fnCallback,oThis,fnImpl)},Filter:function(aArray,fnCallback,oThis){var fnImpl;if(Array.prototype.filter){fnImpl=Array.prototype.filter}else{fnImpl=function(fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=this.length;var aResult=new Array();for(var i=0;i<iLen;i++){if(i in this){var Val=this[i];if(fnCallback.call(oThis,Val,i,this)){aResult.push(Val)}}}return aResult}}return fnArrayWrap.call(this,aArray,fnCallback,oThis,fnImpl)},Some:function(aArray,fnCallback,oThis){var fnImpl;if(Array.prototype.some){fnImpl=Array.prototype.some}else{fnImpl=function(fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=this.length;for(var i=0;i<iLen;i++){if(i in this&&fnCallback.call(oThis,this[i],i,this)){return true}}return false}}return fnArrayWrap.call(this,aArray,fnCallback,oThis,fnImpl)},Every:function(aArray,fnCallback,oThis){var fnImpl;if(Array.prototype.every){fnImpl=Array.prototype.every}else{fnImpl=function(fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=this.length;for(var i=0;i<iLen;i++){if(i in this&&!fnCallback.call(oThis,this[i],i,this)){return false}}return true}}return fnArrayWrap.call(this,aArray,fnCallback,oThis,fnImpl)},Keys:function(o){var fnImpl;if(Object.prototype.keys){fnImpl=Object.prototype.keys}else{fnImpl=function(){var aKeys=[],Key;for(Key in this){if(L.hasOwnProperty(this,Key)){aKeys.push(Key)}}return aKeys}}return fnImpl.call(o)},Values:function(o){return this.Map(o,function(v){return v})},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)},UnsetAttrib:function(sName){var OldValue=this.aDef[sName];delete this.aDef[sName];if(L.isFunction(this["AttribMethod_"+sName])){this["AttribMethod_"+sName](undefined,OldValue)}},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&&aEventArgs[0]&&!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,showdelay:200};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()){if(ZC.JSManager.oConfig.DEBUG&&console.log){console.log("Warning: CustomSetupStart for "+this.sName+" returned false - block will not be set up.")}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)}if(ZC.JSManager.oConfig.DEBUG&&console.log){console.log("Warning: CustomSetupEnd for "+this.sName+" returned false - block will not be set up.")}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:30000,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},CloseAjaxDialog:function(){if(this._ajaxDialog){ZC.JSManager.DestroyDialog(this._ajaxDialog);this._ajaxDialog=null}},_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},GetFieldsetEl:function(){var elFieldset,elInput,sName;if(this._elInput){if(L.isArray(this._elInput)){elInput=this._elInput[0]}else{elInput=this._elInput}elFieldset=Dom.getAncestorByTagName(elInput,"FIELDSET")}else{if(this.aChildWidgets){for(sName in this.aChildWidgets){if(L.hasOwnProperty(this.aChildWidgets,sName)){elFieldset=this.aChildWidgets[sName].GetFieldsetEl();if(elFieldset){break}}}}}return elFieldset},GetFieldsetName:function(){var elFieldset=this.GetFieldsetEl();if(elFieldset){if(this.oForm){return elFieldset.id.replace(new RegExp("^"+this.oForm.sName+"_"),"")}else{return elFieldset.id}}return undefined},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}if(this.bEnabled==bEnable){return }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){if(this._bAttribProviderSetup){return }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,oParentClass){sModule=sModule||"Core";oParentClass=oParentClass||ZC.Core.EventListener;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],oParentClass);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,bFoundList=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)){bFoundList=true;bResult=fnCompare(Value,this.GetAttrib(sEqualsAttrib),true)}if(this.AttribIsset(sNotEqualsAttrib)){bFoundList=true;bResult=bResult||fnCompare(Value,this.GetAttrib(sNotEqualsAttrib),false)}if((this.AttribIsset(sContainsAttrib)||this.AttribIsset(sNotContainsAttrib))&&(L.isArray(Value)||L.isObject(Value))){bFoundList=true;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(!bFoundList||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 I=YAHOO.lang,B=ZC.Util,D=YAHOO.util.Dom,J=YAHOO.util.Event,H="yui-pe-content",C="hide",E=ZC.Core.Block;var A=E.Create("Menu_Menu");A.prototype.CustomSetupEnd=function(){var L,M,K;L=this.GetElement();if(!L){return false}D.removeClass(L,H);K=new YAHOO.widget.MenuBar(L,{zindex:5});K.render();K.show();B.ForEach(K.getSubmenus(),function(N){N.cfg.setProperty("zindex",5)});this.oYUIMenuBar=K;M=D.getElementsByClassName("menulink","a");if(M.length){J.on(M,"click",function(P){var S=J.getTarget(P),O=K.getSubmenus(),R=S.href.replace(/.*#/,""),Q,N;for(Q=0,N=O.length;Q<N;Q++){if(O[Q].id==R){O[Q].show();O[Q].parent.cfg.setProperty("selected",true);O[Q].focus();J.stopEvent(P);return }}},this,true)}return true};A.prototype.Destruct=function(){E.Menu_Menu.superclass.Destruct.apply(this,arguments);if(this.oYUIMenuBar){this.oYUIMenuBar.body.innerHTML="";this.oYUIMenuBar=null}};A.prototype._IDPrefix="menu-";A=E.Create("Accordion","Core",undefined,"Layout");A.prototype.CustomSetupEnd=function(){var K=this.GetElement();if(!K){return false}D.removeClass(K,H);this.oYUIAccordionView=new YAHOO.widget.AccordionView(K,{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(L){var M=L.index;return this.LoadPanel(M,false,L.panel)},this,true);ZC.JSManager.GetEvent("AfterManagerInit").subscribe(function(){B.ForEach(this._aAccordionBlocks,function(N,M){var L;if(N.StartOpen){this.LoadPanel(M,false)}},this)},this,true)}return true};A.prototype.Destruct=function(){ZC.Core.Layout.Accordion.superclass.Destruct.apply(this,arguments);if(this.oYUIAccordionView){this.oYUIAccordionView.destruct();this.oYUIAccordionView=null}};A.prototype._IDPrefix="accordion-";A.prototype.LoadPanel=function(N,M,P){var K,S,Q="zc-accordion-loading",R={Show:function(){D.addClass(P,Q)},Hide:function(){D.removeClass(P,Q)}};if(I.isUndefined(P)){K=D.get("accordion-"+this.UniqueID()+"--"+N);if(K){P=K.parentNode}else{return false}}else{K=P.lastChild}if(K&&!I.isUndefined(this._aAccordionBlocks[N])&&(M||!this._aAccordionBlocks[N].Loaded)){S=function(){this._aAccordionBlocks[N].Loaded=true;this._aAccordionBlocks[N].ForceReload=false;if(this.oYUIAccordionView){this.oYUIAccordionView.openPanel(N)}};fnFailure=function(){B.Alert(B.GetText("The server was unable to retreive the data, please try again."))};if(this._aAccordionBlocks[N].ContentURL){var O={customevents:{onStart:R.Show,onComplete:R.Hide},success:function(T){K.innerHTML=T.responseText;S.call(this)},failure:fnFailure,scope:this};YAHOO.util.Connect.asyncRequest("GET",this._aAccordionBlocks[N].ContentURL,O,null)}else{var L={panelid:N};if(M||this._aAccordionBlocks[N].ForceReload){L.reloadPanel=1}this.AjaxRequest({Transaction:"FetchBlockSection",GetPostVars:L,OnSuccess:S,OnFailure:fnFailure,LoadingIndicator:R})}return false}return true};A.prototype.ReloadPanels=function(K){if(I.isNumber(K)){K=[K]}else{if(!I.isArray(K)){K=B.Keys(this._aAccordionBlocks)}}B.ForEach(K,function(L){if(this.oYUIAccordionView.isPanelOpen(L)){this.LoadPanel(L,true)}else{this._aAccordionBlocks[L].Loaded=false;this._aAccordionBlocks[L].ForceReload=true}},this)};A.prototype.ProcessAjaxResponse=function(K,M,L){ZC.Core.Layout.Accordion.superclass.ProcessAjaxResponse.apply(this,arguments);B.ForEach(K,function(O,N){switch(N){case"ReloadPanels":this.ReloadPanels(O);break;case"SetInPage":this.SetInPage(O);break}},this)};A.prototype.SetInPage=function(K){B.ForEach(K,function(L){if(!I.isUndefined(this._aAccordionBlocks[L])){this._aAccordionBlocks[L].Loaded=true}},this)};A.prototype.AttribMethod_AccordionBlocks=function(M){if(!this.oYUIAccordionView||M.length==0||I.isUndefined(M[0].Header)||this._bAttribProviderSetup){return }var L,K,N;for(L=0,K=M.length;L<K;++L){elPanel=this.oYUIAccordionView.getPanel(L);this.oYUIAccordionView.setPanelHeader(L,M[L].Header,M[L].HeaderClass)}};A=E.Create("TabView");A.prototype.CustomSetupEnd=function(){var X,W,O,R=this.GetAttribDefault("Orientation","top"),U=false,L,M,V,P,Z,N,Y,Q,a,T,S,K;X=this.GetElement();if(!X){YAHOO.log("unable to find element with ID "+(this._IDPrefix+this.UniqueID()),"debug","TabView");return false}if(R=="top+bottom"){U=true;R="top"}this.oYUITabView=new YAHOO.widget.TabView(X,{orientation:R});this.oTabs={};this.aTabIndices=[];S=K=0;B.ForEach(this.GetAttribDefault("Tabs",[]),function(d,c){var b,f;if(d.Selected){K=S}if(d.AjaxURL){var b={label:d.Caption,dataSrc:d.AjaxURL,cacheData:(I.isUndefined(d.CacheData)?true:d.CacheData),active:(K==S)};f=new YAHOO.widget.Tab(b);this.oYUITabView.addTab(f,S)}else{f=this.oYUITabView.getTab(S)}this.oTabs[c]=f;this.aTabIndices[S]=c;S++},this);if(U){M=this.oYUITabView.getElementsByClassName("yui-nav","ul")[0];V=this.oYUITabView.getElementsByClassName("yui-content")[0];if(M&&V){L=document.createElement("div");L.className="yui-navset-bottom";L.appendChild(M.cloneNode(true));D.insertAfter(L,V);P=function(b,c){J.stopEvent(b);this.oYUITabView.set("activeIndex",c)};B.ForEach(D.getChildren(L.firstChild),function(f,d){var g,c,b;g=this.oYUITabView.getTab(d);J.on(f,"click",P,d,this);c=g.addClass;g.addClass=function(h){D.addClass(f,h);c.apply(this,arguments)};b=g.removeClass;g.removeClass=function(h){D.removeClass(f,h);b.apply(this,arguments)}},this)}}O=D.getElementsByClassName("tabviewlink","a");if(O.length){J.on(O,"click",function(b){var d=J.getTarget(b),c=d.href.replace(/.*#/,"");if(!I.isUndefined(this.oTabs[c])){this.oYUITabView.set("activeTab",this.oTabs[c]);J.stopEvent(b)}},this,true)}Y=this.GetAttribDefault("StoreSelectedTab");if(Y){N=YAHOO.util.Cookie;Q=N.getSub("TabViewSelectedTab",Y,Number);if(Q){this.oYUITabView.set("activeIndex",Q)}this.oYUITabView.on("activeIndexChange",function(b){var c=new Date();c.setUTCFullYear(c.getUTCFullYear()+1);N.setSub("TabViewSelectedTab",Y,this.oYUITabView.get("activeIndex"),{expires:c})},this,true)}a=this.GetAttribDefault("ChangeTabEvent");if(a){T=ZC.JSManager.GetEvent(a)}Z=function(b,c){B.ForEach(W,function(g,d){var f=g.get("element").className.split(/\s/);B.ForEach(f,function(h){if(h=="selected"){return }if(h.substr(h.length-9)=="-selected"&&d!=b){g.removeClass(h)}else{if(d==b){g.addClass(h+"-selected")}}})});if(T){T.fire(this.aTabIndices[b],this.aTabIndices[c])}};this.oYUITabView.on("activeIndexChange",function(b){Z.call(this,b.newValue,b.prevValue)},this,true);ZC.JSManager.GetEvent("ManagerInit").subscribe(function(){Z.call(this,this.oYUITabView.get("activeIndex"))},this,true);return true};A.prototype.Destruct=function(){E.TabView.superclass.Destruct.apply(this,arguments);this.oYUITabView=null;this.oTabs=null};A.prototype._IDPrefix="tabview-";A.prototype.EnableTab=function(L,K){if(I.isUndefined(K)){K=true}if(!I.isUndefined(this.oTabs[L])){this.oTabs[L].set("disabled",!K)}};A.prototype.DisableTab=function(K){this.EnableTab(K,false)};A.prototype.AddTabClass=function(K,L){if(!I.isUndefined(this.oTabs[K])){this.oTabs[K].addClass(L)}};A.prototype.RemoveTabClass=function(K,L){if(!I.isUndefined(this.oTabs[K])){this.oTabs[K].removeClass(L)}};A.prototype.ChangeTab=function(K){if(I.isString(K)&&!K.match(/^\d+$/)){K=B.IndexOf(this.aTabIndices,K)}this.oYUITabView.set("activeIndex",Number(K))};A=E.Create("Recordset_Load_Search");A.prototype.CustomSetupEnd=function(){var L=D.get("list-inner-"+this.UniqueID()),K="dbad-list-loading",M=D.get("frmSorter.rstsortby"),N;if(!L){return true}N=function(P,Q,O){J.stopEvent(P);this.AjaxRequest({Transaction:"SortOrPageChange",URL:Q.href})};J.delegate(L,"click",N,".caption a, .pager a",this,true);if(M){M.onchange="";J.on(M,"change",function(){this.AjaxRequest({Transaction:"SortOrPageChange",GetPostVars:M.value})},this,true)}return true};A=E.Create("YUIProgressBar");A.prototype.CustomSetupEnd=function(){var M=this.GetElement(),L,K,N;if(!M){return false}D.removeClass(M,H);K={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(K);this.oYUIProgressBar.render(M,D.getFirstChild(M));return true};A.prototype.AttribMethod_Animation=function(K,L){this.oYUIProgressBar.set("anim",(K!==false));if(I.isObject(K)){var M=this.oYUIProgressBar.get("anim");if(!I.isUndefined(K.Duration)){M.duration=Number(K.Duration)}if(!I.isUndefined(K.Easing)&&!I.isUndefined(YAHOO.util.Easing[K.Easing])){M.method=YAHOO.util.Easing[K.Easing]}}};A.prototype.AttribMethod_Value=function(K,L){if(K<this.GetAttribDefault("MinValue",0)||K>this.GetAttribDefault("MaxValue",100)){this.SetAttrib("Value",L);return }this.oYUIProgressBar.set("value",K);this._UpdateMessage()};A.prototype.AttribMethod_MinValue=function(K){this.oYUIProgressBar.set("minValue",K);this._UpdateMessage()};A.prototype.AttribMethod_MaxValue=function(K){this.oYUIProgressBar.set("maxValue",K);this._UpdateMessage()};A.prototype.AttribMethod_Width=function(K){this.oYUIProgressBar.set("width",K)};A.prototype.AttribMethod_Message=A.prototype._UpdateMessage=function(){var M=this.GetAttribDefault("Message"),O={},N=this.GetAttribDefault("Value"),L=this.GetAttribDefault("MinValue",0),K=this.GetAttribDefault("MaxValue",100);if(!M){return }if(I.isUndefined(this.elMessage)){this.elMessage=D.getFirstChildBy(this.GetElement(),function(P){return D.hasClass(P,"yui-pb-message")});if(!this.elMessage){this.elMessage=false}}if(this.elMessage===false){return }O={Value:N,MinValue:L,MaxValue:K,Remaining:K-N,Percent:Math.round((N/(K-L))*100)};this.elMessage.innerHTML=B.ReplaceTags(M,O)};var G={};A=E.Create("PopDownMessage");A.prototype.CustomSetupEnd=function(){var M=this.GetElement(),L,K,N;if(!M){return false}G[this.UniqueID()]=this;document.body.insertBefore(M,document.body.firstChild);D.removeClass(M,H);D.addClass(M,C);this.CalculateMessageHeight();return true};A.prototype.CalculateMessageHeight=function(){var L=this.GetElement(),K=D.hasClass(L,C);if(K){D.removeClass(L,C)}this.iMessageHeight=D.getRegion(L).height;if(K){D.addClass(L,C)}else{this.UpdateMargin()}return this.iMessageHeight};A.prototype.AttribMethod_Visible=function(O,K){var N=0,S=(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<7),M=this.GetElement(),L,Q,R,P;Q=function(){var U=Number(D.getStyle(M,"width").replace(/px/,"")),V=D.hasClass(M,C),T;if(!I.isNumber(U)){D.setStyle(M,"width","600px");U=600}if(V){D.setStyle(M,"top","-20000px");D.removeClass(M,C)}T=D.getRegion(M);if(V){D.addClass(M,C)}D.setStyle(M,"width",(D.getViewportWidth()-(T.width-U))+"px")};R=function(){var T=B.GetPageScrollTop();D.setStyle(M,"top",T+"px")};if(this.bShowing==O||(!O&&I.isUndefined(K))){return }this.bShowing=O;if(O){B.ForEach(G,function(T){if(T!=this&&T.GetAttribDefault("Visible")){T.SetAttrib("Visible",false)}},this);Q();J.on(window,"resize",Q,this,true)}else{J.removeListener(window,"resize",Q,this,true)}if(S){D.setStyle(M,"position","absolute")}if(this.oMessageAnim){this.oMessageAnim.stop();this.oMessageAnim=null}if(O){if(S){this.oMessageAnim=new YAHOO.util.Anim(M,{opacity:{from:0,to:1}},this.GetAttribDefault("AnimDuration",0.5));this.oMessageAnim.onStart.subscribe(function(){D.removeClass(M,C);L=D.getRegion(M);document.body.style.marginTop=L.height+"px";R()});this.oMessageAnim.onComplete.subscribe(function(){J.on(window,"scroll",R)})}else{this.oMessageAnim=new YAHOO.util.Anim(M,{top:{from:(N-this.iMessageHeight),to:N}},this.GetAttribDefault("AnimDuration",0.5));this.oMessageAnim.onStart.subscribe(function(){D.removeClass(M,C)},this,true)}}else{if(S){this.oMessageAnim=new YAHOO.util.Anim(M,{opacity:{from:1,to:0}},this.GetAttribDefault("AnimDuration",0.5));this.oMessageAnim.onStart.subscribe(function(){J.removeListener(window,"scroll",R)});this.oMessageAnim.onComplete.subscribe(function(){L=D.getRegion(M);D.addClass(M,C);document.body.style.marginTop="0px";document.body.style.display="none";document.body.style.display=""})}else{this.oMessageAnim=new YAHOO.util.Anim(M,{top:{from:N,to:(N-this.iMessageHeight)}},this.GetAttribDefault("AnimDuration",0.5));this.oMessageAnim.onComplete.subscribe(function(){D.addClass(M,C)})}}if(!S){this.oMessageAnim.onComplete.subscribe(function(){I.later(0,this,this.UpdateMargin)},this,true)}this.oMessageAnim.animate()};var F;A.prototype.UpdateMargin=function(){var M,L,K,N,P=this.GetElement();if(!this.GetAttrib("Visible")){for(var O in G){if(I.hasOwnProperty(G,O)&&G[O].GetAttrib("Visible")){return }}}M=D.getRegion(P);if(!M){if(D.hasClass(P,C)){D.removeClass(P,C);M=D.getRegion(P);D.addClass(P,C)}if(!M){return }}L=M.height+Number(D.getStyle(P,"top").replace(/px$/,""));K=Number(D.getStyle(document.body,"margin-top").replace(/px$/,""));N=B.GetPageScrollTop()+(L-K);if(L>=0){D.setStyle(document.body,"margin-top",L+"px")}B.SetPageScrollTop(Math.max(0,N));if(YAHOO.env.ua.ie){document.body.style.display="none";document.body.style.display=""}};A.prototype.AttribMethod_ContainerClass=function(L,K){var M=this.GetElement();if(K){D.removeClass(M,K)}D.addClass(M,L);this.CalculateMessageHeight()};A.prototype.AttribMethod_MessageBody=function(K){var L=this.GetElement();L.innerHTML=K;this.CalculateMessageHeight()}})();(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&&((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 }if(oSrcEvent){Evt.stopEvent(oSrcEvent)}U.ForEach(aIncludeWidgetValues,function(sWidgetName,sKey){var oWidget;if(this.oDestination.oForm){oWidget=this.oDestination.oForm.GetWidget(sWidgetName)}else{oWidget=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 H=YAHOO.lang,E=YAHOO.util.Dom,K=YAHOO.util.Event,C=ZC.Util,B=C.GetText,M=C.ReplaceHashTags,G="yui-pe-content",D="hide",I=ZC.Core.Widget,O,A;ZC.Util.YUIButtonWrapper=function(R,U,Q){var V,T,P={},S=false,L=false;if(U.Type){P.type=U.Type}if(U.Caption){P.label=U.Caption}E.removeClass(R,G);if(R.onclick){S=R.onclick}if(R.onchange){L=R.onchange}if(YAHOO.env.ua.gecko&&R.getAttribute("type")=="submit"){R.type="button";P.type="submit"}this.oWidget=Q;this.oYUIButton=V=new YAHOO.widget.Button(R,P);V.zcWidget=Q;if(R.className){V.addClass(R.className)}if(Q){V.on("click",function(W){this._EventDispatcher("click",W)},Q,true);if(S){Q.AddEvent(S,"click",Q)}if(V.get("type")=="checkbox"){V.on("checkedChange",function(W){this._EventDispatcher("change",W)},Q,true);if(L){Q.AddEvent(L,"change",Q)}}}if(H.isObject(U)){if(U.IconImage&&U.IconWidth){T=(V.getElementsByClassName("first-child"))[0].firstChild;E.setStyle(T,"background-image","url("+U.IconImage+")");E.setStyle(T,"background-repeat","no-repeat");iPadding=Number(U.IconWidth);if(U.IconNoCaption){V.set("label","");E.setStyle(T,"padding-left",iPadding+"px");E.setStyle(T,"padding-right","0px");E.setStyle(T,"background-position","50% 50%")}else{iPadding+=10;if(U.IconPosition=="right"){K.onContentReady(E.generateId(T),function(){var W=E.getRegion(T);E.setStyle(T,"padding-right",iPadding+"px");E.setStyle(T,"background-position",(W.width-7)+"px 50%")})}else{E.setStyle(T,"padding-left",iPadding+"px");E.setStyle(T,"background-position","7px 50%")}}}}};ZC.Util.YUIButtonWrapper.prototype={Destruct:function(){this.oYUIButton=null},Enable:function(L){if(H.isUndefined(L)){L=true}this.oYUIButton.set("disabled",!L)}};O=I.Create("Checkbox");O.prototype.CustomSetupEnd=function(){var R=this.GetAttribDefault("CheckedClass","checked"),Q,L,P;if(!this._elInput||!this.elContainer||!R){return false}if(P=this.GetAttribDefault("YUIButtonDef")){if(H.isBoolean(P)){P={}}if(H.isUndefined(P.Caption)){L=this.GetLabelEl();E.addClass(L,D);P.Caption=L.innerHTML}this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,P,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}Q=function(){if(!this._elInput){return }E[this._elInput.checked?"addClass":"removeClass"](this.elContainer,R)};K.on(this._elInput,"change",Q,this,true);K.on(this._elInput,"click",Q,this,true);Q.call(this);return true};O.prototype.Destruct=function(){I.Checkbox.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct()}};O.prototype.Enable=function(L,Q,P){I.Checkbox.superclass.Enable.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};O.prototype.GetValue=function(){if(this.oButtonWrapper){return this.oButtonWrapper.oYUIButton.get("checked")}if(!this._elInput){return undefined}if(this._elInput.type=="hidden"){return(this._elInput.value==1)}return this._elInput.checked};O.prototype.HasValue=function(){return true};O.prototype.SetValue=function(L){this._elInput.checked=!!L;this._FireEventHandlers("change")};O.prototype.AttribMethod_Caption=function(L){I.Checkbox.superclass.AttribMethod_Caption.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.set("label",L)}};I.Boolean=O;var N=function(){};N.prototype={_FindElements:function(){var L=this.ID();if(this.IsReadOnly()){this._elInput=E.get(L);return }this.elContainer=E.get(L);this._elInput=[];if(this.aDef.OptionKeys){this._elInput=C.Map(this.aDef.OptionKeys,function(P){return E.get(this.ID(P))},this);this._elInput=C.Filter(this._elInput,function(P){return H.isObject(P)});if(this._elInput.length==0){this._elInput=null}}if(!this.elContainer){this._FindContainers()}},GetLabelForElement:function(Q){var P,L=true;if(H.isUndefined(Q)){Q=this._elInput}else{if(!H.isArray(Q)){L=false;Q=[Q]}}P=C.Map(Q,function(S){var R=S.id,T=E.getElementsBy(function(U){return(E.getAttribute(U,"for")==R)},"label");if(T.length==0){return undefined}return T[0]},this);return(L)?P:P[0]},GetLabelEl:function(){var L=this._WidgetNameToID();return E.getElementBy(function(P){return(E.getAttribute(P,"for")==L)},"label")},GetOptions:function(P){var L={};C.ForEach(this._elInput,function(R){var Q=this.GetLabelForElement(R);L[R.value]=P?Q.innerHTML:(Q.textContent||Q.innerText)},this);return L}};O=I.Create("Radio");H.augment(O,N,true);O.prototype._GetSelectedInput=function(){if(!this._elInput){return undefined}for(var P=0,L=this._elInput.length;P<L;++P){if(this._elInput[P].checked){return this._elInput[P]}}return undefined};O.prototype.GetValue=function(){if(this.IsReadOnly()){return this._elInput.value}var L=this._GetSelectedInput();return L?L.value:undefined};O.prototype.GetHTMLValue=function(){if(this.IsReadOnly()){return this._elInput.value}var P=this._GetSelectedInput(),L;if(!P){return undefined}L=this.GetLabelForElement(P);if(!L){return undefined}return L.innerHTML};O.prototype.GetTextValue=function(){if(this.IsReadOnly()){return this._elInput.value}var P=this._GetSelectedInput(),L;if(!P){return undefined}L=this.GetLabelForElement(P);if(!L){return undefined}return(L.textContent||L.innerText)};O.prototype.SetValue=function(P){if(H.isUndefined(P)){return this.Clear()}for(var Q=0,L=this._elInput.length;Q<L;++Q){if(this._elInput[Q].value==P){this._elInput[Q].checked=true;this._FireEventHandlers("change");return }}};O.prototype.Clear=function(){if(!H.isUndefined(this.GetValue())){E.batch(this._elInput,function(L){L.checked=false});this._FireEventHandlers("change")}};O=I.Create("CheckboxGroup");H.augment(O,N,true);O.prototype.CustomSetupEnd=function(){K.on(this._elInput,"change",function(Q){this._ToggleSelectedClass(K.getTarget(Q))},this,true);if(YAHOO.env.ua.ie){K.on(this._elInput,"click",function(Q){this._ToggleSelectedClass(K.getTarget(Q))},this,true)}C.ForEach(this._elInput,this._ToggleSelectedClass,this);if(this.GetAttribDefault("ShowSelectAllOrNone")){var P=E.get(this._WidgetNameToID("__ALL__")),L=E.get(this._WidgetNameToID("__NONE__"));E.removeClass(P.parentNode,D);K.on(P,"click",function(Q){K.stopEvent(Q);this.SetValue(C.Map(this._elInput,function(R){return R.value}))},this,true);K.on(L,"click",function(Q){K.stopEvent(Q);this.SetValue([])},this,true)}return true};O.prototype._ToggleSelectedClass=function(L){if(L){var P=this.GetAttribDefault("SelectedClass","checked");elAncestor=E.getAncestorByTagName(L,"tr");E[L.checked?"addClass":"removeClass"](elAncestor,P)}};O.prototype._GetSelectedInputs=function(){return C.Filter(this._elInput,function(L){return L.checked})};O.prototype.GetValue=function(){var L=this._GetSelectedInputs();return C.Map(L,function(P){return P.value})};O.prototype.GetTextValue=function(){var P=this._GetSelectedInputs(),L;if(!P.length){return this.aDef.FormattedValueWhenEmpty||""}L=C.Map(this.GetLabelForElement(P),function(Q){return(Q.textContent||Q.innerText)});return L.join("\n")};O.prototype.GetHTMLValue=function(){var P=this._GetSelectedInputs(),L;if(!P.length){return this.aDef.FormattedValueWhenEmpty||""}L=C.Map(this.GetLabelForElement(P),function(Q){return Q.innerHTML});return L.join(this.aDef.HTMLValueSeparator||"<br />")};O.prototype.SetValue=function(P){var L=false;C.ForEach(this._elInput,function(Q){if(C.InArray(Q.value,P)){if(!Q.checked){Q.checked=true;L=true;this._ToggleSelectedClass(Q)}}else{if(Q.checked){Q.checked=false;L=true;this._ToggleSelectedClass(Q)}}},this);if(L){this._FireEventHandlers("change")}};O.prototype.EnableOption=function(L,P){if(!H.isArray(L)){L=[L]}var Q=P?"removeClass":"addClass";C.ForEach(this._elInput,function(R){if(C.InArray(R.value,L)){R.disabled=!P;var S=E.getAncestorByTagName(R,"tr");E[Q](S,"disabled")}})};O=I.Create("Select");var J=function(){var L,P,Q;Q=function(T,S){if(T){S=K.getTarget(T)}if(this.sOldOptionClass){E.removeClass(S,this.sOldOptionClass)}var R=S.options[S.selectedIndex],U=E.getAttribute(R,"class");if(U){E.addClass(S,U);this.sOldOptionClass=U}};if(this.GetAttribDefault("CopyOptionClass")){K.on(this._elInput,"change",function(S){var R=K.getTarget(S);if(!R){if(H.isArray(this._elInput)){R=this._elInput[0]}else{R=this._elInput}}Q.call(this,null,R)},this,true);K.on(this._elInput,"keydown",function(){this.oKeyInterval=H.later(10,this,function(){var R;if(H.isArray(this._elInput)){R=this._elInput[0]}else{R=this._elInput}Q.call(this,false,R)})},this,true);K.on(this._elInput,"keyup",function(){if(this.oKeyInterval){this.oKeyInterval.cancel()}},this,true);E.batch(this._elInput,function(R){Q.call(this,false,R)},this,true)}return true};O.prototype.CustomSetupEnd=J;O.prototype.GetValue=function(L){if(!this._elInput||(this._elInput.type=="hidden"&&this._elInput.tagName.toLowerCase()=="input")){this.bHiddenField=true;this.GetValue=I.Select.superclass.GetValue}else{if(this._elInput.type=="select-one"){this.GetValue=function(P){if(!this._elInput){return undefined}var Q=this._elInput.selectedIndex;if(Q<0){return undefined}var R=this._elInput.options[Q];return P?R.text:R.value}}else{this.GetValue=function(Q){if(!this._elInput){return undefined}var P=[];C.ForEach(this._elInput.options,function(R){if(R.selected){P.push(Q?R.text:R.value)}});return P}}}return this.GetValue(L)};O.prototype.GetTextValue=function(){return this._GetFormattedValue("\n")};O.prototype.GetHTMLValue=function(){return this._GetFormattedValue(this.aDef.HTMLValueSeparator||"<br />")};O.prototype._GetFormattedValue=function(P){if(this.bHiddenField){return(this.elContainer.textContent||this.elContainer.innerText)}var L=this.GetValue(true);if(L.length==0){return(this.aDef.FormattedValueWhenEmpty||"")}if(!H.isArray(L)){return L}return L.join(P)};O.prototype.SetValue=function(R){var U=!H.isArray(R),Q=false;if(this._elInput.type=="hidden"&&this._elInput.tagName.toLowerCase()=="input"){return I.Select.superclass.SetValue(R)}for(var S=0,L=this._elInput.length;S<L;++S){var T=this._elInput.options[S];if(U){if(T.value==R){if(!T.selected){T.selected=true;this._FireEventHandlers("change",null,this._elInput)}return }}else{var P=C.InArray(T.value,R);Q=Q||(T.selected!=P);T.selected=P}}if(Q){this._FireEventHandlers("change",null,this._elInput)}};O.prototype.AttribMethod_Options=function(R){var L=(this._elInput.type=="select-one")?[this.GetValue()]:this.GetValue();this._elInput.options.length=0;for(var P in R){if(H.hasOwnProperty(R,P)){var Q=document.createElement("option");Q.value=String(P);Q.innerHTML=String(R[P]);Q.selected=C.InArray(P,L);this._elInput.appendChild(Q)}}};O.prototype.AttribMethod_OptionAttribs=function(L,P){C.ForEach(E.getChildren(this._elInput),function(S){var R=S.value,T={},Q={};if(!H.isUndefined(P)&&R in P){T=P[R]}if(!H.isUndefined(L)&&R in L){Q=L[R]}C.ForEach(Q,function(V,U){if(U in T){delete (T[U])}S[U]=V;if(this.GetAttribDefault("CopyOptionClass")&&R==this.GetValue()&&U=="className"){if(this.sOldOptionClass){E.removeClass(this._elInput,this.sOldOptionClass);this.sOldOptionClass=null}E.addClass(this._elInput,R)}},this);C.ForEach(T,function(V,U){S[U]=""})},this)};O.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}}};I.Create("Reference","Core",O);O=I.Create("Text");O.prototype.InsertText=function(L){C.InsertAtCursor(this._elInput,L)};O=I.Create("TextArea");O.prototype.CustomSetupEnd=function(){if(this.aDef.Size){this.AddEvent(this.UpdateNRemaining,["keyup","focus"],this);this.AddEvent(this.HideNRemaining,"blur",this)}return true};O.prototype.UpdateNRemaining=function(S){if(H.isUndefined(this._elRemaining)){this._elRemaining=document.createElement("span");this._elRemaining.className="textarea-remainingchars";E.insertAfter(this._elRemaining,this._elInput)}var R=this.GetCharCount(),L=this.aDef.Size,V="";var Q=L-R;if(Q>=0){V=C.sprintf(B("Used %1$d of %2$d characters, %3$d remaining."),R,L,Q)}else{V=C.sprintf(B("Used %1$d of %2$d characters."),R,L)}this._elRemaining.innerHTML=V;var U=R>L;var T=U?"invalid":"valid";var P=U?"valid":"invalid";E.replaceClass(this._elRemaining,P,T);E.removeClass(this._elRemaining,"invisible")};O.prototype.HideNRemaining=function(L){if(this._elRemaining){E.addClass(this._elRemaining,"invisible")}};O.prototype.GetCharCount=function(){return this.GetValue().replace(/\r\n/g,"\n").length};O.prototype.Validate=function(){var P=this.GetCharCount(),L=this.aDef.Size;var Q=C.sprintf(B("Please reduce this to %d characters, it is currently at %d."),L,P);if(P>L){this.SetValid(false,Q);return false}return I.TextArea.superclass.Validate.call(this)};O.prototype.InsertText=function(L){C.InsertAtCursor(this._elInput,L)};O=I.Create("Group");O.prototype.CustomSetupEnd=function(){if(this.aDef.HideFields){var R,S,Q,P,T,U,L,V;T=this.GetAttribDefault("LabelShow",B("Show"));U=this.GetAttribDefault("LabelHide",B("Hide"));sShowLinkTooltip=this.GetAttribDefault("ShowLinkTooltip",B("Show this section"));sHideLinkTooltip=this.GetAttribDefault("HideLinkTooltip",B("Hide this section"));R=this.aDef.ID;S=E.get(R+"-toggle");this.elContainer=E.get(R+"-hidediv");if(!S){return true}P=this.elOpenCloseLink=document.createElement("a");P.href="#";P.innerHTML=T;this.oOpenCloseTooltip=new YAHOO.widget.Tooltip("grp-oc-tt-"+this.sName,{context:P,autofillheight:false,autodismissdelay:120000,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},text:sShowLinkTooltip});S.appendChild(P);var Q=function(W){if(W){K.stopEvent(W)}if(this.IsVisible()){this.Hide();this.elOpenCloseLink.innerHTML=T;this.oOpenCloseTooltip.cfg.setProperty("text",sShowLinkTooltip)}else{this.Show();this.elOpenCloseLink.innerHTML=U;this.oOpenCloseTooltip.cfg.setProperty("text",sHideLinkTooltip)}};K.on(P,"click",Q,this,true);if(this.IsVisible()){Q.call(this)}}return true};O.prototype.GetTextValue=function(){var L=C.Map(this.aChildWidgets,function(P){return P.GetTextValue()});return L.join(this.aDef.TextValueSeparator||", ")};O.prototype.GetHTMLValue=function(){var L=C.Map(this.aChildWidgets,function(P){return P.GetHTMLValue()});return L.join(this.aDef.HTMLValueSeparator||"<br />")};O.prototype.GetValue=function(){var L={};C.ForEach(this.aChildWidgets,function(Q,P){L[P]=Q.GetValue()});return L};O.prototype.Enable=function(L,Q,P){C.ForEach(this.aChildWidgets,function(R){R.Enable(L,Q,P)})};I.Create("Document","Core",O);I.Create("Group_List","Core",O);O=I.Create("Group_Matrix","Core",I.Group);O.prototype.CustomSetupEnd=function(){I.Group_Matrix.superclass.CustomSetupEnd.call(this);this.elHeading=E.getFirstChildBy(this._elInput,function(P){return P.tagName.toLowerCase()=="thead"});this.elBody=E.getFirstChildBy(this._elInput,function(P){return P.tagName.toLowerCase()=="tbody"});var L=function(){var Q=E.getChildrenBy(this.elBody,function(R){return R.tagName.toLowerCase()=="tr"}),P=C.Map(Q,function(R){return E.getFirstChild(R).id.replace(this._elInput.id+"__","")},this);if(this.GetAttribDefault("NoRowValues")){P=C.Keys(Q)}this.oForm.AddHiddenField(this.sName+"_rowvalues",P)};this.oForm.AddEvent(L,"submit",this);return true};O.prototype._FindContainers=function(){var L=E.get("tr_"+this.GetAttrib("WidgetID"));if(L){this.elContainer=L}return I.Group_Matrix.superclass._FindContainers.apply(this,arguments)};O.prototype.GetValue=function(){var L={};C.ForEach(I.Group_Matrix.superclass.GetValue.call(this),function(Q,P){if(P=="AddValue"||P=="AddButton"){return }L[P.substr(6)]=Q});return L};O.prototype.SetValue=function(){throw new Error("SetValue not implemented for Group_Matrix widgets")};O.prototype.AddRow=function(U,L,Q,S){var P=document.createElement("tr"),T=document.createElement("th"),R=this._elInput.id+"__"+U;if(E.get(R)){return }if(!this.GetAttribDefault("NoRowValues")){T.scope="row";T.id=R;T.innerHTML=L;P.appendChild(T)}C.ForEach(Q,function(V){var W=document.createElement("td");W.innerHTML=V;P.appendChild(W)});this.elBody.appendChild(P);E.removeClass(this.elHeading,D);if(S){this.AddChildWidget("gmrow_"+U,S)}};O.prototype.RemoveRow=function(T){var R,P,L=this._elInput.id+"__",S,Q;if(T.indexOf(L)==-1){T=L+T}R=E.get(T);if(R){P=R.parentNode;Q=function(){P.parentNode.removeChild(P);if(!E.getFirstChildBy(this.elBody,function(U){return U.tagName.toLowerCase()=="tr"})){E.addClass(this.elHeading,D)}};if(YAHOO.util.Anim){S=new YAHOO.util.Anim(P,{opacity:{from:100,to:0}},0.5);S.onComplete.subscribe(Q,this,true);S.animate()}else{Q.call(this)}}this.RemoveChildWidget("gmrow_"+T.replace(L,""))};O.prototype.FindRowIDWithElement=function(Q){var P,R,L=this._elInput.id+"__";while(E.isAncestor(this._elInput,Q)){P=E.getAncestorByTagName(Q,"tr");R=E.getFirstChild(P).id;if(R.indexOf(L)<0){Q=P.parentNode}else{return R.replace(L,"")}}return undefined};O.prototype.GetRowCaption=function(P){var L=E.get(this._elInput.id+"__"+P);if(L){return(L.textContent||L.innerText)}else{return P}};O=I.Create("TextInsertion","Core",O);O.prototype.CustomSetupEnd=function(){ZC.JSManager.GetEvent("ManagerInit").subscribe(function(){var P,L;P=this.GetAttrib("Destination");this.oDestWidget=this.oParent.GetWidget(P)||((this.oParent!=this.oForm)&&this.oForm.GetWidget(P))||ZC.JSManager.GetWidget(P);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};O=I.Create("Submit");O.prototype.CustomSetupEnd=function(){var P,Q,R,S;if(!this._elInput){return false}if(R=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,R,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}if(Q=this.GetAttribDefault("LoadingMessage")){P=new YAHOO.widget.Panel(E.generateId(this._elInput)+"wait",{fixedcenter:true,close:false,draggable:false,zindex:40000,modal:true,visible:false});P.setHeader(Q);P.setBody('<img style="margin: 0 auto; display: block;" width="220" height="19" src="/zc/images/ajax-loader-bar.gif">');P.render(document.body);K.on(this._elInput,"click",function(){P.show()})}if(S=this.GetAttribDefault("Confirm")){var L=function(T){if(!confirm(S)){K.stopEvent(T)}};if(this.oButtonWrapper){K.on(this.oButtonWrapper.oYUIButton.getForm(),"submit",L)}else{K.on(this._elInput.form,"submit",L)}}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};O.prototype.Destruct=function(){I.Submit.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};O.prototype.AttribMethod_value=function(L){this._elInput.value=L;if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.set("label",L)}};O.prototype.Enable=function(L,Q,P){I.Submit.superclass.Enable.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};O.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};O=I.Create("Button");O.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};O.prototype.Destruct=function(){I.Button.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};O.prototype.Enable=function(L){I.Button.superclass.Enable.call(this,L);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};O.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};O.prototype._WireUpEvent=function(L){if(this.oButtonWrapper&&L=="click"){return true}return I.Button.superclass._WireUpEvent.apply(this,arguments)};I.Create("AutoPopulate","Core",I.Button);O=I.Create("Reset");O.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(P){var Q=this.GetAttribDefault("Confirm");if(Q){if(!confirm(Q)){K.stopEvent(P);return }}if(this.oForm){this.oForm.Reset();K.stopEvent(P)}},"click",this,10);return true};O.prototype.Destruct=function(){I.Reset.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};O.prototype.Enable=function(L){I.Reset.superclass.Enable.call(this,L);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};O.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};O=I.Create("Button_Clear");O.prototype.CustomSetupStart=function(){var S,T,R,Q,P,L;if(!this._elInput){return false}S=document.createElement("input");T=this._elInput.attributes;for(P=0,L=T.length;P<L;P++){E.setAttribute(S,T[P].nodeName,T[P].nodeValue)}S.type="button";S.value=this.aDef.Caption||"Clear";Q=function(U){if(this.oForm){this.oForm.Clear()}K.stopEvent(U)};K.on(S,"click",Q,this,true);this._elInput.parentNode.replaceChild(S,this._elInput);this._elInput=S;if(R=this.GetAttribDefault("YUIButtonDef")){this.oButtonWrapper=new C.YUIButtonWrapper(this._elInput,R,this);this._elInput=this.oButtonWrapper.oYUIButton.get("element")}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};O.prototype.Destruct=function(){I.Button_Clear.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};O.prototype.Enable=function(L){I.Button_Clear.superclass.Enable.call(this,L);if(this.oButtonWrapper){this.oButtonWrapper.Enable(L)}};O.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};O=I.Create("Link");O.prototype.CustomSetupEnd=function(){var L,Q,P;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(Q=this.GetAttribDefault("Confirm")){P=function(R){if(!confirm(Q)){K.stopEvent(R)}};this.AddEvent(P,"click",this,10)}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}},"click",this,50);return true};O.prototype.Destruct=function(){I.Link.superclass.Destruct.apply(this,arguments);if(this.oButtonWrapper){this.oButtonWrapper.Destruct();this.oButtonWrapper=null}};O.prototype.Enable=function(L){I.Link.superclass.Enable.call(this,L);if(this.oButtonWrapper){var P=this.oButtonWrapper.oYUIButton;if(this.IsEnabled()){P.removeStateCSSClasses("disabled");if(H.isUndefined(this._oldOnClick)){P.set("onclick",{fn:function(){}})}else{P.set("onclick",this._oldOnClick)}}else{if(P.hasFocus()){P.blur()}P.addStateCSSClasses("disabled");P.removeStateCSSClasses("hover");P.removeStateCSSClasses("active");P.removeStateCSSClasses("focus");this._oldOnClick=P.get("onclick");P.set("onclick",{scope:P,fn:function(Q){K.stopEvent(Q);this.blur()}})}}};O.prototype._WireUpEvent=function(L){if(L=="click"&&this.oButtonWrapper){return }return I.Link.superclass._WireUpEvent.apply(this,arguments)};O.prototype.AttribMethod_href=function(L){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.set("href",L)}else{this._elInput.href=L}};O.prototype.Click=function(){if(this.oButtonWrapper){this.oButtonWrapper.oYUIButton.fireEvent("click",{})}else{this._elInput.click()}};O.prototype.PreventCaching=function(){var L=this.GetAttribDefault("href",this._elInput.href);L=ZC.JSManager.URL({nocache:(new Date()).getTime()},L);this.SetAttrib("href",L)};O=I.Create("Links_Button");O.prototype.CustomSetupEnd=function(){var Q,U,P,L,T,R,S;if(!this._elInput){return false}Q=this.GetAttribDefault("YUIButtonDef");U=E.getFirstChild(this._elInput);E.removeClass(U,G);if(U.tagName.toLowerCase()=="a"){T=U.href}L=document.createElement("input");L.type="button";L.value=(U.textContent||U.innerText);L.className=U.className;L.id=U.id;U.parentNode.replaceChild(L,U);E.removeClass(this._elInput.id+"_menu",G);this.oYUIButton=new YAHOO.widget.Button(L,{type:(T?"split":"menu"),menu:this._elInput.id+"_menu"});this.oYUIButton.getMenu().subscribe("render",function(){document.body.appendChild(this.element)});if(S=this.GetAttribDefault("Confirm")){fnClickHandler=function(V){if(!confirm(S)){K.stopEvent(V);this.bCancelled=true}else{this.bCancelled=false}};this.AddEvent(fnClickHandler,"click",this,10)}if(T&&!this.GetAttribDefault("LinksDisabled")){this.AddEvent(function(W){if(this.bCancelled){return }var V=E.getAttribute(this._elInput,"target"),X;if(V&&V!="_self"){var X=window.open(T,V);if(X){return }YAHOO.log("window.open returned null, fallback to current window","debug","Links_Button")}window.location=T},"DefaultLink",this,500)}else{if(this.GetAttribDefault("LinksDisabled")){this.oYUIButton.addClass("yui-button-disabled");this.oYUIButton.getMenu().cfg.setProperty("disabled",true)}}return true};O.prototype._WireUpEvent=function(L){switch(L){case"click":this.oYUIButton.getMenu().subscribe(L,function(Q,P){this._EventDispatcher(L,P[0])},this,true);case"DefaultLink":if(this.oYUIButton.get("type")=="menu"){return }this.oYUIButton.on("click",function(P){this._EventDispatcher(L,P)},this,true);break;default:this.oYUIButton.on(L,function(P){this._EventDispatcher(L,P)},this,true);break}};O.prototype.Destruct=function(){I.Links_Button.superclass.Destruct.apply(this,arguments);this.oYUIButton=null};O=I.Create("MenuButton");O.prototype.CustomSetupStart=function(){if(this.GetAttribDefault("Widgets",[]).length<2){return false}var R=E.get(this.aDef.Widgets.MenuOptions.ID),Q=E.get(this.aDef.Widgets.MenuSubmit.ID),a,Y,X,T,V,W,P,Z=[];if(!R||!Q){return false}this._elInput=R;var L;if(!this.AttribIsset("Default")){L="menu";for(var U=0,S=R.options.length;U<S;U++){if(R.options[U].value==""){R.removeChild(R.options[U]);break}}}else{L="split"}if(!this.AttribIsset("Options")){P=R}else{a=document.createElement("input");a.type="button";a.id=Q.id;a.name=Q.name;a.value=Q.value;Q.parentNode.replaceChild(a,Q);Q=a;X=function(h,g,d){var c=true,f=d.Widget.oYUIMenuButton,b;R.value=this.value;d.Widget.oForm.AddHiddenField(f.get("name"),f.get("value"));d.Widget._FireEventHandlers("click",this);if(d.Events){C.ForEach(d.Events,function(j){c=c&&ZC.JSManager.GetEvent(d.Widget._InternalEventName(j)).fire(this,d.Widget)},this)}if(d.Widget.GetAttribDefault("Submit",true)&&c&&d.Submit){d.Widget.bSubmitted=true;f.submitForm()}return c};T=function(c){var b=[];C.ForEach(c,function(f,d){var g,h={value:d,onclick:{fn:X,obj:{Widget:this,Submit:true}}};if(H.isObject(f)){h.onclick.obj.Submit=H.isUndefined(f.Submit)||f.Submit;h.onclick.obj.Events=!H.isUndefined(f.Events)?f.Events:false;if(!H.isUndefined(f.Group)){h=T.call(this,f.Options);if(H.isString(h.Group)){Z.push(h.Group)}else{Z.push(false)}}else{h.text=f.Text;if(!H.isUndefined(f.Options)){if(!H.isUndefined(f.Selectable)&&!f.Selectable){delete h.onclick}g=T.call(this,f.Options);if(g.length){h.submenu={id:E.generateId(),itemdata:g}}}}}else{h.text=f}b.push(h)},this);return b};E.addClass(R,D);P=T.call(this,this.GetAttrib("Options"))}if(YAHOO.env.ua.gecko){Q.type="button"}this.oYUIMenuButton=new YAHOO.widget.Button(Q,{type:L,menu:P});C.ForEach(Z,function(b,c){if(b){this.oYUIMenuButton.setItemGroupTitle(b,c)}},this);if(this.AttribIsset("Default")){this.oYUIMenuButton.subscribe("click",function(b){this.SetValue(this.GetAttrib("Default"));this._FireEventHandlers("click",b)},this,true);if(!C.Some(R.options,function(b){return(b.value==this.GetAttrib("Default"))},this)){Y=document.createElement("option");Y.value=this.GetAttrib("Default");R.appendChild(Y)}}if(V=this.GetAttribDefault("LoadingMessage")){W=new YAHOO.widget.Panel(E.generateId(this._elInput)+"wait",{fixedcenter:true,close:false,draggable:false,zindex:40000,modal:true,visible:false});W.setHeader(V);W.setBody('<img style="margin: 0 auto; display: block;" width="220" height="19" src="/zc/images/ajax-loader-bar.gif">');W.render(document.body);this.oYUIMenuButton.getMenu().subscribe("click",function(){if(this.bSubmitted){W.show()}},this,true)}this.AddEvent(function(){if(this.oForm){this.oForm.SetSelectedEndWidget(this)}if(YAHOO.env.ua.gecko){H.later(0,this.oYUIMenuButton,function(){this.get("srcelement").type="submit";this.submitForm();this.get("srcelement").type="button"})}},"click",this);this.aDef.Widgets=[];return true};O.prototype.Destruct=function(){I.MenuButton.superclass.Destruct.apply(this,arguments);this.oYUIMenuButton=null};O.prototype._WireUpEvent=function(L){switch(L){case"click":this.oYUIMenuButton.getMenu().subscribe(L,function(Q,P){this._EventDispatcher(L,P[0])},this,true);case"DefaultLink":if(this.oYUIMenuButton.get("type")=="menu"){return }this.oYUIMenuButton.on("click",function(P){this.oYUIMenuButton.set("selectedMenuItem",null);this._EventDispatcher(L,P)},this,true);break;default:this.oYUIMenuButton.on(L,function(P){this._EventDispatcher(L,P)},this,true);break}};O=I.Create("Password");O.prototype.GetTextValue=function(){return C.StrRepeat("*",this.GetValue().length)};O=I.Create("Password_Change","Core",O);O.prototype.GetValue=function(){return this._elInput[0].value};O.prototype._FindElements=function(){var L;L=this._WidgetNameToID();this._elInput=[E.get(L),E.get(L+"_confirm")];this._FindContainers()};O.prototype.Validate=function(){var P,L;P=this._elInput[0].value;L=this._elInput[1].value;if(P&&L&&P!=L){this.SetValid(false,B("The two passwords do not match"));return false}return O.superclass.Validate.call(this)};O=I.Create("LinkedSelect");O.prototype.bChangeRODisplay=false;O.prototype.CustomSetupEnd=J;O.prototype.CustomSetupStart=function(){this.sSeparator=this.GetAttrib("Separator");if(this._elInput.length){initLinkedSelect(this._elInput);return true}return false};O.prototype._FindElements=function(){var Q,P,L;Q=this._WidgetNameToID();P=this.GetAttribDefault("FirstVisibleLevel",0);this._elInput=[];do{L=E.get(Q+"."+P);if(L){this._elInput.push(L)}P++}while(L);this._FindContainers()};O.prototype.Clear=function(){C.ForEach(this._elInput,function(L){if(C.InArray(L.options[0].value,["Any","__Any__",""])){L.selectedIndex=0}if(H.isFunction(L.onchange)){L.onchange()}})};O.prototype.GetValue=function(){var L=this.GetCompoundValue();if(H.isUndefined(L)){return undefined}return L.pop()};O.prototype.GetCompoundValue=function(){var L;if(H.isUndefined(this._elInput)||H.isUndefined(this._elInput[this._elInput.length-1])){return undefined}L=this._elInput[this._elInput.length-1].value;aValues=L.split(this.GetAttrib("Separator"));return aValues};O.prototype.GetTextValue=function(){if(H.isUndefined(this._elInput)){return undefined}var P=0,L="";while(P<this._elInput.length){if(H.isUndefined(this._elInput[P])){return undefined}L+=this._elInput[P].options[this._elInput[P].selectedIndex].text+" ";P++}return L};O.prototype.SetValue=function(T){var Q,S,L,V=this.GetAttrib("FirstVisibleLevel"),P,U=[],R=this.GetAttrib("Separator");if(H.isString(T)||H.isNumber(T)){T=String(T);if(this._elInput.length>0&&T.indexOf(R)==-1){Q=new RegExp(R+T+"$");P=this._elInput[this._elInput.length-1];for(S=0,L=P.options.length;S<L;S++){if(P.options[S].value.match(Q)){T=P.options[S].value;break}}}T=T.split(R);if(T.length==1&&T[0].indexOf("-")!=-1){T=T[0].split("-")}}if(H.isArray(T)){for(S=0,L=T.length;S<L;S++){if(S<V){U.push(T[S])}else{if(!H.isUndefined(this._elInput[S-V])){U.push(T[S]);this._elInput[S-V].value=U.join(R)}else{this.SetValid(false)}}}}};A=I.Create("LinkedSelect_AllWidgetValues","Core",I.LinkedSelect);A.prototype.GetValue=I.LinkedSelect.prototype.GetCompoundValue;I.Create("LinkedSelect_AllowBlank","Core",I.LinkedSelect);I.Create("LinkedSelect_LinkedSearch","Core",I.LinkedSelect);A=I.Create("LinkedSelect_Multiple","Core",I.LinkedSelect);A.prototype.CustomSetupStart=function(){if(!A.superclass.CustomSetupStart.apply(this,arguments)){return false}var P,T,L,R,S,Q;P=this.oForm.sName+"."+this.sName;T=P+".collection";this.elCollection=E.get(T);LinkedMultipleSelect_SynchroniseHiddenField(T,P);LinkedSelect_RegisterMultiple(P+"."+this.GetAttrib("MaxLevel"),T);S=function(){LinkedMultipleSelect_AddSelected(this._elInput,T,P);this._EventDispatcher("change",null)};Q=function(){LinkedMultipleSelect_RemoveSelected(this._elInput,T,P);this._EventDispatcher("change",null)};K.on(this._WidgetNameToID()+"_Select","click",S,this,true);K.on(this._WidgetNameToID()+"_Deselect","click",Q,this,true);return true};A.prototype._WireUpEvent=function(L){if(L=="change"){return }return A.superclass._WireUpEvent.apply(this,arguments)};var F=function(P){if(!this.elCollection){return undefined}var L=[];C.ForEach(this.elCollection.options,function(Q){L.push(P?Q.text:Q.value)});return L};A.prototype.GetValue=function(){return C.Map(F.call(this,false),function(L){return L.replace(/^.*-/,"")})};A.prototype.GetTextValue=function(){return F.call(this,true)};A=I.Create("SelectRelated","Core",I.LinkedSelect);A.prototype.CustomSetupStart=function(){if(this._elInput.length){initSelectRelated(this._elInput);return true}return false};O=I.Create("DateTime_FromRange");O.prototype.CustomSetupStart=function(){C.ForEach(["FromDate","ToDate","FromTime","ToTime"],function(L){if(!this.AttribIsset(L)){O.superclass.SetAttrib.call(this,L,new Date())}else{var P=this.GetAttrib(L);if(H.isNumber(P)||P.match(/^\d+$/)){O.superclass.SetAttrib.call(this,L,new Date(P*1000))}else{O.superclass.SetAttrib.call(this,L,new Date(P))}}},this);return true};O.prototype.GetValue=function(){var Q=this.aChildWidgets.Date,P=this.aChildWidgets.Time,S=["1970-01-01"],R=[""],L=[],T;if(!H.isUndefined(Q)&&!H.isUndefined(Q.GetValue())){S=Q.GetValue()}if(!H.isUndefined(P)&&!H.isUndefined(P.GetValue())){R=P.GetValue()}C.ForEach(S,function(U){C.ForEach(R,function(V){L.push(new Date(U+" "+V))})});if(this.GetAttribDefault("Multiple")){return L}else{return L[0]}};O.prototype.GetTextValue=function(){var P=this.GetValue(),L=YAHOO.util.Date.format,Q=this.GetAttrib("DisplayFormat");if(H.isUndefined(P)){return this.GetAttribDefault("DisplayValueWhenNull","")}else{if(H.isArray(P)){return C.Map(P,function(R){return L(R,{format:Q})}).join(this.GetAttribDefault("ValueSeparator",", "))}else{return L(this.GetValue,{format:Q})}}};O.prototype.SetValue=function(T){var Q=this.aChildWidgets.Date,L=this.aChildWidgets.Time,P=YAHOO.util.Date.format,S=[],R=[];if(this.GetAttribDefault("Multiple")&&H.isArray(T)){if(Q){S=C.Map(T,function(U){P(U,"%Y-%m-%d")});Q.SetValue(S)}if(L){R=C.Map(T,function(U){P(U,"%H:%M")});L.SetValue(R)}}else{if(!(T instanceof Date)){if(H.isNumber(T)){T=new Date(T*1000)}else{T=new Date(T)}if(!T){return }}if(Q){Q.SetValue(P(T,"%Y-%m-%d"))}if(L){L.SetValue(P(T,"%H:%M"))}}};O.prototype.SetAttrib=function(V,L){var R=this.aChildWidgets.Date,T=this.aChildWidgets.Time,Q=YAHOO.util.Date.format,W={},P={},S;O.superclass.SetAttrib.apply(this,arguments);S=this.GetValue();switch(V){case"DateOptions":if(R){R.SetAttrib("Options",L)}break;case"TimeOptions":if(T){T.SetAttrib("Options",L)}break;case"FromDate":case"ToDate":if(!R){return }oFromDate=this.GetAttrib("FromDate");oToDate=this.GetAttrib("ToDate");for(var U=new Date(oFromDate.getTime());U<=oToDate;U.setTime(U.getTime()+86400000)){W[Q(U,{format:"%Y-%m-%d"})]=Q(U,{format:this.GetAttrib("DateFormat")})}R.SetAttrib("Options",W);return ;case"FromTime":case"ToTime":if(!T){return }oFromTime=this.GetAttrib("FromTime");oToTime=this.GetAttrib("ToTime");for(var U=new Date(oFromTime.getTime());U<=oToTime;U.setTime(U.getTime()+86400000)){P[Q(U,{format:"%H:%M"})]=Q(U,{format:this.GetAttrib("TimeFormat")})}T.SetAttrib("Options",P);break;default:return }this.SetValue(S)};I.Create("Date_FromRange","Core",O);I.Create("Time_FromRange","Core",O);O=I.Create("Integer");O.prototype.Validate=function(){if(!I.Integer.superclass.Validate.call(this)){return false}var P=C.Trim(this.GetValue()),Q=this.GetAttribDefault("Min"),L=this.GetAttribDefault("Max");if(P==""){return true}if(!P.match(/^\d+$/)){this.SetValid(false,B(this.GetAttrib("WholeNumberValMsg")));return false}P=parseInt(P);if(Q!==false&&P<Q){this.SetValid(false,M(B(this.GetAttrib("MinValMsg")),{MIN:Q}));return false}if(L!==false&&P>L){this.SetValid(false,M(B(this.GetAttrib("MaxValMsg")),{MAX:L}));return false}this.SetValid(true);return true}})();
