if(typeof ZC=="undefined"||!ZC){var ZC={}}ZC.Namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=ZC;for(B=(D[0]=="ZC")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]]}}return E};(function(){var L=YAHOO.lang,Dom=YAHOO.util.Dom,Evt=YAHOO.util.Event;var _ForEachArray=function(aArray,fnCallback,oThis){if(Array.forEach){_ForEachArray=Array.forEach}else{_ForEachArray=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}for(var i=0,iMax=aArray.length;i<iMax;i++){if(i in aArray){fnCallback.call(oThis,aArray[i],i,aArray)}}}}_ForEachArray(aArray,fnCallback,oThis)};var 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("*")},TextDomain:function(sTextDomain){if(!L.isUndefined(sTextDomain)){this.sCurrentDomain=sTextDomain}return this.sCurrentDomain},GetText:function(sStr){var sTextDomain=ZC.Util.TextDomain();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();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},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){oAnim=new YAHOO.util.Scroll(document.body,{scroll:{to:aToXY}},fDuration,fnEasing);oAnim.animate()}},InArray:function(Value,aSearch){return(this.IndexOf(aSearch,Value)>=0)},IndexOf:function(aSearch,SearchElement,iFrom){if(Array.indexOf){this.IndexOf=Array.indexOf}else{this.IndexOf=function(aSearch,SearchElement,iFrom){iFrom=Number(iFrom)||0;var iLen=aSearch.length;if(iFrom<0){iFrom+=iLen}for(;iFrom<iLen;iFrom++){if(iFrom in aSearch&&aSearch[iFrom]===SearchElement){return iFrom}}return -1}}return this.IndexOf(aSearch,SearchElement,iFrom)},LastIndexOf:function(aSearch,SearchElement,iFrom){if(Array.indexOf){this.LastIndexOf=Array.lastIndexOf}else{this.LastIndexOf=function(aSearch,SearchElement,iFrom){var iLen=aSearch.length;iFrom=Number(iFrom)||0;if(isNaN(iFrom)){iFrom=iLen-1}else{if(iFrom<0){iFrom+=iLen}else{if(iFrom>=iLen){iFrom=iLen-1}}}for(;iFrom>-1;iFrom--){if(iFrom in aSearch&&aSearch[iFrom]===SearchElement){return iFrom}}return -1}}return this.LastIndexOf(aSearch,SearchElement,iFrom)},ForEach:function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}if(L.isArray(aArray)){return _ForEachArray(aArray,fnCallback,oThis)}if(!L.isUndefined(aArray.length)){for(var i=0,iMax=aArray.length;i<iMax;i++){fnCallback.call(oThis,aArray[i],i,aArray)}}else{for(var Key in aArray){if(L.hasOwnProperty(aArray,Key)){fnCallback.call(oThis,aArray[Key],Key,aArray)}}}},Map:function(aArray,fnCallback,oThis){if(Array.map){this.Map=Array.map}else{this.Map=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;var aResult=new Array(iLen);for(var i=0;i<iLen;i++){if(i in aArray){aResult[i]=fnCallback.call(oThis,aArray[i],i,aArray)}}return aResult}}return this.Map(aArray,fnCallback,oThis)},Filter:function(aArray,fnCallback,oThis){if(Array.filter){this.Filter=Array.filter}else{this.Filter=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;var aResult=new Array();for(var i=0;i<iLen;i++){if(i in aArray){var Val=aArray[i];if(fnCallback.call(oThis,Val,i,aArray)){aResult.push(Val)}}}return aResult}}return this.Filter(aArray,fnCallback,oThis)},Some:function(aArray,fnCallback,oThis){if(Array.some){this.Some=Array.some}else{this.Some=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;for(var i=0;i<iLen;i++){if(i in aArray&&fnCallback.call(oThis,aArray[i],i,aArray)){return true}}return false}}return this.Some(aArray,fnCallback,oThis)},Every:function(aArray,fnCallback,oThis){if(Array.every){this.Every=Array.every}else{this.Every=function(aArray,fnCallback,oThis){if(!L.isFunction(fnCallback)){throw new TypeError()}var iLen=aArray.length;for(var i=0;i<iLen;i++){if(i in aArray&&!fnCallback.call(oThis,aArray[i],i,aArray)){return false}}return true}}return this.Every(aArray,fnCallback,oThis)},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}};var U=ZC.Util;var _GetAttrib=function(sName){if(this.AttribIsset(sName)){return this.aDef[sName]}else{YAHOO.log("Attrib "+sName+" is not set","error",this.sName+"::GetAttrib")}};var _GetAttribDefault=function(sName,mDefault){if(L.isUndefined(mDefault)){mDefault=false}return this.AttribIsset(sName)?this.GetAttrib(sName):mDefault};var _AttribIsset=function(sName){return !L.isUndefined(this.aDef[sName])};var _AttribsAreSet=function(aAttribs){return U.Every(aAttribs,_AttribIsset,this)};var _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)){oChildSearch=oSearchObject[sName].GetWidget(sSearch);if(!L.isUndefined(oChildSearch)){return oChildSearch}}}}return undefined};var _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};ZC.Namespace("Core");ZC.JSManager={aClientSideObjects:{},aEvents:{},aForms:{},aBlocks:{},aValidators:{},Init:function(oConfig,bIframeInit){if(!bIframeInit&&window.frameElement&&YAHOO.env.ua.ie){Evt.on(window,"load",function(){this.Init(oConfig,true)},this,true);return }this.oConfig=oConfig;if(YAHOO.widget.Logger){Evt.throwErrors=true;if(window.console&&console.log){YAHOO.widget.Logger.enableBrowserConsole()}else{Evt.onDOMReady(function(){var myContainer=document.createElement("div");document.body.appendChild(myContainer);new YAHOO.widget.LogReader(myContainer)})}}Evt.onDOMReady(function(){Dom.addClass(document.body,"yui-skin-sam");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.subscribe(this._AutoTooltips,this,true);oInitEvent.subscribe(this._AutoPopups,this,true);oInitEvent.fire();var oAfterInitEvent=this.GetEvent("AfterManagerInit");oAfterInitEvent.fire()},null,this)},_AutoTooltips:function(){if(YAHOO.env.getVersion("container")){var aTooltips=Dom.getElementsByClassName("tooltip");if(aTooltips.length){var oTTCfg={context:aTooltips,autofillheight:false,autodismissdelay:120000};if(!L.isUndefined(YAHOO.util.Anim)){oTTCfg.effect={effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}}new YAHOO.widget.Tooltip("zcb_auto_tt",oTTCfg)}}},_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},GetComponent:function(sCmpName,sModule,sType){var sFirstPart,sSecondPart,iFirstPos,iSecondPos,aTry=[],i,iMax;if(L.isUndefined(sCmpName)){return false}iFirstPos=sCmpName.indexOf("_");if(iFirstPos){sFirstPart=sCmpName.substring(0,iFirstPos)}iSecondPos=sCmpName.indexOf("_",iFirstPos+1);if(iSecondPos){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([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])){YAHOO.log("Module '"+sM+"' not loaded","debug","ZC.JSManager#GetComponent");continue}if(L.isUndefined(ZC[sM][sT])){YAHOO.log("Object type '"+sT+"' in module '"+sM+"' not loaded","debug","ZC.JSManager#GetComponent");continue}if(L.isUndefined(ZC[sM][sT][sST])){YAHOO.log("Object '"+sST+"' (type '"+sT+"') in module '"+sM+"': not loaded","debug","ZC.JSManager#GetComponent");continue}YAHOO.log("Loaded object ZC."+[sM,sT,sST].join("."),"debug","ZC.JSManager#GetComponent");return ZC[sM][sT][sST]}YAHOO.log("Unable to load component ("+[sCmpName,sModule,sType].join(", ")+")","warning","ZC.JSManager#GetComponent");return undefined},GetBlockByUniqueID:function(sUniqueID){for(var sName in this.aBlocks){if(L.hasOwnProperty(this.aBlocks,sName)){if(this.aBlocks[sName].aDef.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},GetWidget:_GetWidget,GetWidgetsBy:_GetWidgetsBy,_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.aValidators[sName])){return this.aValidators[sName]}if(L.isUndefined(this.oValidatorRegex)){this.oValidatorRegex=/^(.*)_Validator_(.*)$/}var aMatches=this.oValidatorRegex.exec(sName);if(!aMatches){if(L.isUndefined(ZC.Core.Validator[sName])){return undefined}return(this.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(this.aValidators[sName]=new ZC[aMatches[1]].Validator[aMatches[2]]())}},URL:function(oParams,sURL){oParams=oParams||{};sURL=sURL||window.location.href.replace(/(\?|#).*/,"");if(sURL.lastIndexOf("/")==(sURL.length-1)){sURL+="index"}var iQSPos=sURL.indexOf("?");if(iQSPos>-1){var aTmpParams=sURL.substr(iQSPos+1).split(/&/);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]||""});sURL=sURL.substr(0,iQSPos)}if(this.oConfig.StateID){oParams._ts=this.oConfig.StateID}var aParamParts=[];U.ForEach(oParams,function(sValue,sKey){if(L.isObject(sValue)&&sValue.GetValue){sValue=sValue.GetValue()}aParamParts.push(encodeURIComponent(sKey)+"="+encodeURIComponent(sValue))});sURL=sURL+"?"+aParamParts.join("&");return sURL},Alert:function(sMessage,fnOKHandler){if(L.isUndefined(fnOKHandler)){fnOKHandler=function(){}}if(!L.isUndefined(YAHOO.widget.SimpleDialog)){var oPanel=new YAHOO.widget.SimpleDialog("alert",{width:"300px",fixedcenter:true,visible:false,draggable:false,close:false,modal:true,text:sMessage,icon:YAHOO.widget.SimpleDialog.ICON_ALARM,constraintoviewport:true,buttons:[{text:"OK",handler:function(){this.hide();fnOKHandler()},isDefault:true}]});oPanel.render(document.body);oPanel.show()}else{alert(sMessage);fnOKHandler()}},CreateDialog:function(sCaption,elBody,elContainer,oConfig){var elDialogContainer=document.createElement("div"),elDialogHeader=document.createElement("div"),elDialogBody=document.createElement("div"),oDialog;elDialogHeader.className="hd";elDialogHeader.innerHTML=sCaption;elDialogBody.className="bd clearfix";elDialogBody.appendChild(elBody);elDialogContainer.appendChild(elDialogHeader);elDialogContainer.appendChild(elDialogBody);(elContainer||document.body).appendChild(elDialogContainer);if(L.isUndefined(oConfig)){oConfig={}}if(L.isUndefined(oConfig.close)){oConfig.close=true}if(L.isUndefined(oConfig.draggable)){oConfig.draggable=true}if(L.isUndefined(oConfig.visible)){oConfig.visible=false}if(L.isUndefined(oConfig.effect)&&!L.isUndefined(YAHOO.util.Anim)){oConfig.effect={effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}}oDialog=new YAHOO.widget.Dialog(elDialogContainer,oConfig);if(L.isUndefined(this.oOverlayManager)){this.oOverlayManager=new YAHOO.widget.OverlayManager()}this.oOverlayManager.register(oDialog);oDialog.render();oDialog.hide();return oDialog}};ZC.Core.Block=function(sName,aDef,oParent){this.sName=sName;this.aDef=aDef;this.oParent=oParent;this.aChildBlocks={};this.aWidgets={};this.aForms={};this.CustomSetupStart();if(!L.isUndefined(aDef.Blocks)){U.ForEach(aDef.Blocks,function(aBlockDef,sBlockName){this.aChildBlocks[sBlockName]=ZC.Core.Block.NewFromDef(sBlockName,aBlockDef,this)},this)}if(!L.isUndefined(aDef.Widgets)){U.ForEach(aDef.Widgets,function(aWidgetDef,sWidgetName){this.aWidgets[sWidgetName]=ZC.Core.Widget.NewFromDef(sWidgetName,aWidgetDef,this)},this)}if(!L.isUndefined(aDef.Forms)){U.ForEach(aDef.Forms,function(aFormDef,sFormName){this.aForms[sFormName]=new ZC.Core.Form(sFormName,aFormDef,this);ZC.JSManager.RegisterForm(this.aForms[sFormName])},this)}this.CustomSetupEnd()};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){sModule=sModule||"Core";oParentClass=oParentClass||ZC.Core.Block;var oNS=ZC.Namespace(sModule+".Block");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(){},CustomSetupEnd:function(){},GetBlockByUniqueID:function(sUniqueID){for(var sName in this.aChildBlocks){if(L.hasOwnProperty(this.aChildBlocks,sName)){if(this.aChildBlocks[sName].aDef.UniqueID==sUniqueID){return this.aChildBlocks[sName]}var oChildBlock=this.aChildBlocks[sName].GetBlockByUniqueID(sUniqueID);if(oChildBlock){return oChildBlock}}}return undefined},GetWidget:_GetWidget,GetWidgetsBy:_GetWidgetsBy,GetAttribDefault:_GetAttribDefault,GetAttrib:_GetAttrib,AttribIsset:_AttribIsset,AttribsAreSet:_AttribsAreSet,_aSearchObjects:["aWidgets","aChildBlocks","aForms"]};ZC.Core.Widget=function(sName,aDef,oForm,oParent){try{YAHOO.log("Started initialising "+sName,"debug",sName+" constructor");this.sName=sName;this.aDef=aDef;this.oParent=oParent;this.oForm=oForm;this.aChildWidgets={};this._FindElements();this.CustomSetupStart();if(!L.isUndefined(this.aDef.EventListeners)){YAHOO.log("Started initialising EventListeners","debug",sName+" constructor");U.ForEach(this.aDef.EventListeners,function(aELDefs,sEventName){U.ForEach(aELDefs,function(aELDef){this.AddEventListener(sEventName,aELDef)},this)},this);YAHOO.log("Finished initialising EventListeners","debug",sName+" constructor")}if(!L.isUndefined(this.aDef.Widgets)){YAHOO.log("Started initialising Widgets","debug",sName+" constructor");U.ForEach(this.aDef.Widgets,function(aWidgetDef,sWidgetName){this.AddChildWidget(sWidgetName,aWidgetDef)},this);YAHOO.log("Finished initialising Widgets","debug",sName+" constructor")}if(L.isUndefined(this.aDef.Validation)){this.aDef.Validation={}}else{if(L.isString(this.aDef.Validation)){var sValidator=this.aDef.Validation;this.aDef.Validation={};this.aDef.Validation[sValidator]=null}else{var oNumberRegex=/^\d+$/;U.ForEach(this.aDef.Validation,function(sValidator,Key,aValidation){if(oNumberRegex.test(Key)){aValidation[sValidator]=null;delete aValidation[Key]}})}}if(!L.isUndefined(this.aDef.Events)){YAHOO.log("Started initialising Events","debug",sName+" constructor");U.ForEach(this.aDef.Events,function(aOn,sEventName){this.AddEvent(sEventName,aOn)},this);YAHOO.log("Finished initialising Events","debug",sName+" constructor")}if(!L.isUndefined(this.aDef.ValidateOnEvents)){this.AddEvent(this.Validate,this.aDef.ValidateOnEvents,this)}var elLabel,bShow;if(this.GetAttribDefault("Overlabel")&&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)}this.CustomSetupEnd();YAHOO.log("Finished initialising "+sName,"debug",sName+" constructor")}catch(ex){YAHOO.log("Exception initialising widget: "+ex.message+" ("+ex.fileName+":"+ex.lineNumber+")","error",sName+" constructor")}};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(sName,aDef,oForm,oParent){oNS[sWidgetClassName].superclass.constructor.call(this,sName,aDef,oForm,oParent)};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(){},CustomSetupEnd:function(){},_WidgetNameToID:function(){var sID="";if(!L.isUndefined(this.aDef.ID)){return this.aDef.ID}if(!L.isUndefined(this.oForm)){sID+=this.oForm.sName+"."}sID+=this.sName;return sID},_FindElements:function(){var sID=this._WidgetNameToID();this._elInput=Dom.get(sID);if(this._elInput){this._FindContainers()}},_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 }}this.elContainer=Dom.getAncestorByClassName(elInput,"form_field")||elInput.parentNode;if(this.elContainer){if(L.isUndefined(this.elContainer._zcRefCount)){this.elContainer._zcRefCount=1}else{++this.elContainer._zcRefCount}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";this.elContainer.appendChild(this.elValidationContainer)}}}if(this.IsReadOnly()){this.elRODisplay=Dom.get(elInput.id+"_rodisplay");if(this.elRODisplay){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},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")},_FireEventHandlers:function(sEvent){var elInput=L.isArray(this._elInput)?this._elInput[0]:this._elInput,aHandlers=Evt.getListeners(elInput,sEvent),aEventArgs=[],i,iMax;if(aHandlers){for(i=1,iMax=arguments.length;i<iMax;i++){aEventArgs.push(arguments[i])}U.ForEach(aHandlers,function(aHandler){var oScope=aHandler.scope;var fnHandler=aHandler.fn;var oArg=aHandler.obj||oScope;fnHandler.call(oScope,aHandler.type,oArg,aEventArgs)})}},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;if(this._elInput&&(sInputId=this._elInput.id)){return Dom.getElementBy(function(el){return Dom.getAttribute(el,"for")==sInputId},"label")}return undefined},IsReadOnly:function(){return(!L.isUndefined(this.aDef.DisplayAs)&&this.aDef.DisplayAs.toLowerCase()=="readonly")},GetAttribDefault:_GetAttribDefault,GetAttrib:_GetAttrib,AttribIsset:_AttribIsset,AttribsAreSet:_AttribsAreSet,SetAttrib:function(sName,Value){this.aDef[sName]=Value},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._elInput){Dom.batch(this._elInput,function(el){if(!bEnable){el.blur()}el.disabled=!bEnable})}var sAddClass=bEnable?sEnableClass:sDisableClass;var sRemoveClass=bEnable?sDisableClass:sEnableClass;this.ReplaceClass(sRemoveClass,sAddClass)},Disable:function(sEnableClass,sDisableClass){this.Enable(false,sEnableClass,sDisableClass)},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)}},Hide:function(){this.Show(false)},_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._zcRefCount==1){Dom.replaceClass(this.elContainer,sOldClass,sNewClass)}if(this._elInput){Dom.replaceClass(this._elInput,sOldClass,sNewClass)}}else{if(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);if(!L.isUndefined(oValidator)&&!oValidator.Validate(this.GetValue(),this)){this.SetValid(false,this.aDef.Validation[sName]||oValidator.GetDefaultValidationMsg());return false}}}var bValid=true;U.ForEach(this.aChildWidgets,function(oWidget){bValid=oWidget.Validate()&&bValid});this.SetValid(bValid);return bValid},IsValid:function(){if(L.isUndefined(this._bIsValid)){return this.Validate()}return this._bIsValid},SetValid:function(bIsValid,sValMsg){this._bIsValid=bIsValid;this.sValidationMessage=sValMsg;if(L.isUndefined(this.aDef.ShowValidationStatus)||this.aDef.ShowValidationStatus){if(this.elContainer){var sOldClass=bIsValid?"invalid":"valid";var sNewClass=bIsValid?"valid":"invalid";Dom.replaceClass(this.elContainer,sOldClass,sNewClass)}if(this.elValidationContainer){this.elValidationContainer.innerHTML=sValMsg||"";Dom[sValMsg?"removeClass":"addClass"](this.elValidationContainer,"hide")}}},GetValidationMsg:function(){return this.sValidationMessage},AddEvent:function(EventNameOrFunction,aOn,oScope,oWidgetOverride){if(!this._elInput&&!this.HasChildWidgets()){YAHOO.log("this._elInput is undefined, no child widgets and AddEvent is not overridden","error",this.sName+"#AddEvent");return undefined}if(L.isUndefined(oWidgetOverride)){oWidgetOverride=this}U.ForEach(this.aChildWidgets,function(oWidget){oWidget.AddEvent(EventNameOrFunction,aOn,oScope,oWidgetOverride)},this);if(!this._elInput){return }if(!L.isArray(aOn)){aOn=[aOn]}var fnFireEvent,oEvent;if(typeof EventNameOrFunction=="function"){fnFireEvent=EventNameOrFunction}else{if(EventNameOrFunction instanceof YAHOO.util.CustomEvent){oEvent=EventNameOrFunction}else{oEvent=ZC.JSManager.GetEvent(EventNameOrFunction)}fnFireEvent=function(oSrcEvent){oEvent.fire(oWidgetOverride,oSrcEvent)}}U.ForEach(aOn,function(sEvent){if(sEvent=="load"){ZC.JSManager.GetEvent("AfterManagerInit").subscribe(function(){fnFireEvent.call(oScope);if(!L.isUndefined(oEvent)){oEvent.subscribeEvent.subscribe(function(sType,aArgs,oObj){var fnEventHandler=aArgs[0];var aEHArgs=[oWidgetOverride,aArgs[1]];var oOverride=aArgs[2];if(oOverride===true){oOverride=oObj}fnEventHandler.call(oOverride,oEvent.type,aEHArgs)})}})}else{if(!Evt.addListener(this._elInput,sEvent,fnFireEvent,this,oScope||true)){YAHOO.log("addListener returned false for "+sEvent,"warn",this.sName+"#AddEvent")}}},this);return oEvent},AddEventListener:function(sEventName,aDef){var oEvent=ZC.JSManager.GetEvent(sEventName);var fnEventListenerConstructor=ZC.JSManager.GetComponent(aDef.EventListenerType,aDef.Module||"Core","EventListener");if(fnEventListenerConstructor){return new fnEventListenerConstructor(this,oEvent,aDef)}else{YAHOO.log("Unable to load event listener: "+(aDef.Module||"Core")+"/"+aDef.EventListenerType,"error")}},AddChildWidget:function(sName,aDef){this.aChildWidgets[sName]=ZC.Core.Widget.NewFromDef(sName,aDef,this.oForm,this)},HasChildWidgets:function(){for(var sName in this.aChildWidgets){if(L.hasOwnProperty(this.aChildWidgets,sName)){return true}}return false},HasValidator:function(sName){return !L.isUndefined((this.GetAttribDefault("Validation",{}))[sName])},GetWidget:_GetWidget,GetWidgetsBy:_GetWidgetsBy,_aSearchObjects:["aChildWidgets"]};ZC.Core.Form=function(sName,aDef,oParent){if(L.isUndefined(aDef.ShowValidationStatus)){aDef.ShowValidationStatus=false}ZC.Core.Form.superclass.constructor.call(this,sName,aDef,this,oParent);if(this.aDef.ValidateOnSubmit){this.AddEvent(this._SubmitCheckValid,"submit",this)}};L.extend(ZC.Core.Form,ZC.Core.Widget);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.Clear=function(){var aArgs=arguments;U.ForEach(this.aChildWidgets,function(oWidget){oWidget.Clear.apply(oWidget,aArgs)})};ZC.Core.Form.prototype._SubmitCheckValid=function(oEvent){if(this.IsValid()){return }Evt.stopEvent(oEvent);ZC.JSManager.Alert(U.GetText("There are still some errors on the form. Please check and re-submit."))};ZC.Core.Form.prototype.IsValid=function(){return this.Validate()};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(){};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||U.GetText("Invalid value")},GetAttribDefault:_GetAttribDefault,GetAttrib:_GetAttrib,AttribIsset:_AttribIsset,AttribsAreSet:_AttribsAreSet,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)}}};ZC.Core.EventListener=function(oDestWidget,oEvent,aDef){this.oDestWidget=oDestWidget;this.oEvent=oEvent;this.aDef=aDef;if(this.Setup()){oEvent.subscribe(this._EventHandler,null,this)}};ZC.Core.EventListener.Create=function(sName,sModule){sModule=sModule||"Core";var oNS=ZC.Namespace(sModule+".EventListener");oNS[sName]=function(oDestWidget,oEvent,aDef){oNS[sName].superclass.constructor.call(this,oDestWidget,oEvent,aDef)};L.extend(oNS[sName],ZC.Core.EventListener);return oNS[sName]};ZC.Core.EventListener.prototype={Setup:function(){return true},GetAttribDefault:_GetAttribDefault,GetAttrib:_GetAttrib,AttribIsset:_AttribIsset,AttribsAreSet:_AttribsAreSet,_EventHandler:function(sEventName,aArgs){var oEvent=ZC.JSManager.GetEvent(sEventName);var oWidget=aArgs[0];var oSrcEvent=aArgs[1];this.HandleEvent(oWidget,oEvent,oSrcEvent)},_SearchLists:function(Value,Equals,NotEquals){var fnCompare=function(Value,CompareValues,bReturnIfMatch){if(L.isArray(CompareValues)){for(var mVal in CompareValues){if(L.hasOwnProperty(CompareValues,mVal)&&Value==CompareValues[mVal]){return bReturnIfMatch}}return !bReturnIfMatch}else{return(Value==CompareValues)?bReturnIfMatch:!bReturnIfMatch}};var bResult=false;if(!L.isUndefined(Equals)){bResult=fnCompare(Value,Equals,true)}if(!L.isUndefined(NotEquals)){bResult=bResult||fnCompare(Value,NotEquals,false)}return bResult},HandleEvent:function(oWidget,oEvent,oSrcEvent){throw new Error("EventListener::HandleEvent is abstract and must be overridden")}};ZC.Core.ClientSideObject=function(aDef){this.aDef=aDef;this.Setup()};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(){},GetAttribDefault:_GetAttribDefault,GetAttrib:_GetAttrib,AttribIsset:_AttribIsset,AttribsAreSet:_AttribsAreSet}})();document.getElementsByClass=function(A,E){var C=document.all?document.all.tags(A):document.getElementsByTagName(A);var B=new Array();var D=0;for(i=0;i<C.length;i++){if(C[i].className==E){B[D++]=C[i]}}return B};function showelementsofclass(A,B,C){root=document.getElementById(C);if(C&&root){classitems=root.getElementsByClass(A,B)}else{classitems=document.getElementsByClass(A,B)}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=root.getElementsByClass(A,B)}else{classitems=document.getElementsByClass(A,B)}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=document.getElementsByClass("div",A);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 ShowHelp(J,C){var B=document.getElementById(C);var F=B.offsetTop;var H=J.offsetLeft+10;var G=J;var E=B.innerHTML;var I=document.getElementById("zcoverlibifr");var D=215;var K=300;var A=40;if(B.style.display=="none"||B.style.display==""){while(G.offsetParent&&(G.offsetParent!=document.body)){G=G.offsetParent;F+=G.offsetTop;H+=G.offsetLeft}displaydiv(C);if(!B.done){K=B.clientHeight;B.done=1;B.innerHTML='<iframe frameborder="0" scrolling="no" src="javascript:false;" width="'+D+'" height="'+K+'" style="z-index: '+A+'; filter: Beta(Style=0,Opacity=0);"></iframe><div class="zcoverlib2" style="position: absolute; top: 0; left: 0; width: '+(D-3)+"px; z-index: "+A+++';">'+B.innerHTML+"</div>"}H=mouseX;if(H+B.clientWidth>document.body.clientWidth){H-=(B.clientWidth+15)}B.style.left=H}timeout[name]=window.setTimeout("_HideHelp('"+C+"');",10000)}function HideHelp(A){window.clearTimeout(timeout[A]);timeout[name]=window.setTimeout("_HideHelp('"+A+"')",100)}function _HideHelp(A){var B=document.getElementById(A);B.style.display="none"}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]})}}}var IE=document.all?true:false;document.onmousemove=getMouseXY;var mouseX=0;var mouseY=0;function getMouseXY(A){if(IE){if(document.documentElement&&document.documentElement.scrollTop){mouseX=event.clientX+document.documentElement.scrollLeft;mouseY=event.clientY+document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){mouseX=event.clientX+document.body.scrollLeft;mouseY=event.clientY+document.body.scrollTop}}}}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 isMaxLength(B){var A=B.getAttribute?parseInt(B.getAttribute("maxlength")):"";if(B.getAttribute&&B.value.length>A){B.value=B.value.substring(0,A)}}function IsNumeric(B){var D="0123456789.";var C=true;var A;for(i=0;i<B.length&&C==true;i++){A=B.charAt(i);if(D.indexOf(A)==-1){C=false}}return C}function findPosX(A){var B=0;if(A.offsetParent){while(1){B+=A.offsetLeft;if(!A.offsetParent){break}A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetTop;if(!B.offsetParent){break}B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function coordsInElement(A,C,B){e=document.getElementById(B);x1pos=findPosX(e);x2pos=x1pos+e.offsetWidth;y1pos=findPosY(e);y2pos=y1pos+e.offsetHeight;if(A>=x1pos&&A<=x2pos&&C>=y1pos&&C<=y2pos){return true}return false}function stopEventPropagation(A){if(A.stopPropagation){A.stopPropagation()}else{window.event.cancelBubble=true}}function parentNodeOfType(A,C){var B=A.parentNode;while(B.tagName.toLowerCase()!=C.toLowerCase()&&B.parentNode){B=B.parentNode}if(B.tagName.toLowerCase()==C.toLowerCase()){return B}return undefined}function eventTarget(A){if(!A){A=window.event}if(A.target){element=A.target}if(A.srcElement){element=A.srcElement}if(element.nodeType==3){element=element.parentNode}return element}function showNextTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }nextIndex=tr.rowIndex+1;nextTr=tr.parentNode.parentNode.rows[nextIndex];nextTr.style.display=""}function hideThisTableRow(A){thisElement=eventTarget(A);if(thisElement.tagName=="TR"){tr=thisElement}else{tr=parentNodeOfType(thisElement,"TR")}if(!tr){return }tr.style.display="none"}function hideNextTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }nextIndex=tr.rowIndex+1;nextTr=tr.parentNode.parentNode.rows[nextIndex];nextTr.style.display="none"}function hidePrevTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }prevIndex=tr.rowIndex-1;prevTr=tr.parentNode.parentNode.rows[prevIndex];prevTr.style.display="none"}function showPrevTableRow(B){var A=eventTarget(B);if(A.tagName=="TR"){tr=A}else{tr=parentNodeOfType(A,"TR")}if(!tr){return }prevIndex=tr.rowIndex-1;prevTr=tr.parentNode.parentNode.rows[prevIndex];prevTr.style.display=""}function addClass(A,B){if(!hasClass(A,B)){A.className+=(A.className?" ":"")+B;return true}return false}function hasClass(A,B){if(A.className==""){return false}return new RegExp("\\b"+B+"\\b").test(A.className)}function removeClass(A,B){if(hasClass(A,B)){A.className=A.className.replace(A.className.indexOf(" "+B)>=0?" "+B:B)}}(function(){var A=YAHOO.lang,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-]+";var B="['A-Za-z0-9_.-]+@(['A-Za-z0-9_-]+\\.['A-Za-z0-9_.-]+)";var 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("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){return(J.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_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,U=ZC.Util,_GT=U.GetText;var oEL;oEL=ZC.Core.EventListener.Create("Alert");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){ZC.JSManager.Alert(this.aDef.Message)};oEL=ZC.Core.EventListener.Create("EnableDisable");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var bEnable,sEnabledClass,sDisabledClass,sPopulateWhenDisabledFrom,oPopulateFromWidget;bEnable=this._SearchLists(oWidget.GetValue(),this.aDef.EnableWhenSrcEquals,this.aDef.EnableWhenSrcNotEquals);sEnabledClass=this.aDef.EnabledClass||"";sDisabledClass=this.aDef.DisabledClass||"disabled";this.oDestWidget.Enable(bEnable,sEnabledClass,sDisabledClass);sPopulateWhenDisabledFrom=this.aDef.PopulateWhenDisabledFrom;if(sPopulateWhenDisabledFrom&&!bEnable){oPopulateFromWidget=ZC.JSManager.GetWidget(sPopulateWhenDisabledFrom);if(oPopulateFromWidget){this.oDestWidget.SetValue(oPopulateFromWidget.GetValue())}}};oEL=ZC.Core.EventListener.Create("EnableDisableTab");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){this.oTabView=ZC.JSManager.GetWidget(this.aDef.TabViewName);if(!L.isUndefined(this.oTabView)){var bEnable=this._SearchLists(oWidget.GetValue(),this.aDef.EnableWhenSrcEquals,this.aDef.EnableWhenSrcNotEquals);this.oTabView.EnableTab(this.aDef.TabID,bEnable)}};oEL=ZC.Core.EventListener.Create("SelectOrUpload");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var sDestId=this.oDestWidget._elInput.id;var eSelectDiv=Dom.get("div."+sDestId+".select");var eUploadDiv=Dom.get("div."+sDestId+".upload");if(oWidget.GetValue()==1){eSelectDiv.style.display="block";eUploadDiv.style.display="none"}else{eSelectDiv.style.display="none";eUploadDiv.style.display="block"}};oEL=ZC.Core.EventListener.Create("SetOptionsFromJSArray");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(!L.isUndefined(window[this.aDef.ArrayName])){var aNewOptions=window[this.aDef.ArrayName][oWidget.GetValue()];this.oDestWidget.SetAttrib("Options",aNewOptions)}};oEL=ZC.Core.EventListener.Create("SetValue_FromSource");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){oDestWidget.SetValue(oWidget.GetValue())};oEL=ZC.Core.EventListener.Create("ShowHideElements");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var bShow=this._SearchLists(oWidget.GetValue(),this.aDef.ShowWhenSrcEquals,this.aDef.ShowWhenSrcNotEquals);var Elements;if(this.aDef.ElementType&&this.aDef.ElementClass){Elements=YAHOO.util.Selector.query(this.aDef.ElementType+"."+this.aDef.ElementClass)}else{if(this.aDef.ElementID){Elements=this.aDef.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=ZC.Core.EventListener.Create("CallJSFunction");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(this.aDef.JSArgs){eval(this.aDef.JSFunction+"("+this.aDef.JSArgs+");")}else{var fn=window[this.aDef.JSFunction];if(L.isFunction(fn)){fn()}}};oEL=ZC.Core.EventListener.Create("SetRelatedOptions_FromSource");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var elDest=Dom.get(this.aDef.ID+".1");if(elDest){setOptionsRelatedTo(elDest,oWidget.GetValue())}};oEL=ZC.Core.EventListener.Create("SetRelatedOptions_FromInitialValue");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){var sID=this.aDef.ID;var elDest=Dom.get(sID+".1");var elInitial=Dom.get(sID+".initial");var opt=oWidget.GetValue()+"-"+elInitial.value;for(var i=0,iMax=elDest.length;i<iMax;i++){if(elDest.options[i].value==opt){elDest.value=(opt);return }}};oEL=ZC.Core.EventListener.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;ZC.JSManager.GetEvent("ManagerInit").subscribe(function(){U.ForEach(this.GetAttrib("LookupFields"),function(sField){var oWidget=(this.oParent&&this.oParent.GetWidget(sField))||this.oForm.GetWidget(sField)||ZC.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.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(){ZC.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)||ZC.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=ZC.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=ZC.Core.EventListener.Create("SetValue_ToValue");oEL.prototype.HandleEvent=function(oWidget,oEvent,oSrcEvent){if(!this._SearchLists(oWidget.GetValue(),this.GetAttribDefault("SetWhenSrcEquals",undefined),this.GetAttrib("SetWhenSrcNotEquals",undefined))){return }this.oDestWidget.SetValue(this.GetAttrib("Value"))}})();(function(){var A=YAHOO.lang,B=ZC.Util,D=YAHOO.util.Dom,E=YAHOO.util.Event;var C=ZC.Core.Block.Create("Menu_Menu");C.prototype.CustomSetupEnd=function(){var F=new YAHOO.widget.MenuBar(this.aDef.ID),G;F.render();F.show();this.oYUIMenuBar=F;G=D.getElementsByClassName("menulink","a");if(G.length){E.on(G,"click",function(J){var M=E.getTarget(J),I=F.getSubmenus(),L=M.href.replace(/.*#/,""),K,H;for(K=0,H=I.length;K<H;K++){if(I[K].id==L){I[K].show();I[K].parent.cfg.setProperty("selected",true);I[K].focus();E.stopEvent(J);return }}},this,true)}};C=ZC.Core.Block.Create("TabView");C.prototype.CustomSetupEnd=function(){var O,I,L=this.GetAttribDefault("Orientation","top"),M=false,F,G,N,J,H,P,K;if(L=="top+bottom"){M=true;L="top"}this.oYUITabView=new YAHOO.widget.TabView(this.aDef.ID,{orientation:L});O=this.oYUITabView.get("tabs");if(!O){return }this.oTabs={};B.ForEach(O,function(Q){this.oTabs[Q.get("href").substr(1)]=Q},this);if(M){G=this.oYUITabView.getElementsByClassName("yui-nav","ul")[0];N=this.oYUITabView.getElementsByClassName("yui-content")[0];if(G&&N){F=document.createElement("div");F.className="yui-navset-bottom";F.appendChild(G.cloneNode(true));D.insertAfter(F,N);J=function(Q,R){E.stopEvent(Q);this.oYUITabView.set("activeIndex",R)};B.ForEach(D.getChildren(F.firstChild),function(T,S){var U,R,Q;U=this.oYUITabView.getTab(S);E.on(T,"click",J,S,this);R=U.addClass;U.addClass=function(V){D.addClass(T,V);R.apply(this,arguments)};Q=U.removeClass;U.removeClass=function(V){D.removeClass(T,V);Q.apply(this,arguments)}},this)}}I=D.getElementsByClassName("tabviewlink","a");if(I.length){E.on(I,"click",function(Q){var S=E.getTarget(Q),R=S.href.replace(/.*#/,"");if(!A.isUndefined(this.oTabs[R])){this.oYUITabView.set("activeTab",this.oTabs[R]);E.stopEvent(Q)}},this,true)}P=this.GetAttribDefault("StoreSelectedTab");if(P){H=YAHOO.util.Cookie;K=H.getSub("TabViewSelectedTab",P,Number);if(K){this.oYUITabView.set("activeIndex",K)}this.oYUITabView.on("activeIndexChange",function(Q){var R=new Date();R.setUTCFullYear(R.getUTCFullYear()+1);H.setSub("TabViewSelectedTab",P,this.oYUITabView.get("activeIndex"),{expires:R})},this,true)}};C.prototype.EnableTab=function(G,F){if(A.isUndefined(F)){F=true}if(!A.isUndefined(this.oTabs[G])){this.oTabs[G].set("disabled",!F)}};C.prototype.DisableTab=function(F){this.EnableTab(F,false)};C.prototype.AddTabClass=function(F,G){if(!A.isUndefined(this.oTabs[F])){this.oTabs[F].addClass(G)}};C.prototype.RemoveTabClass=function(F,G){if(!A.isUndefined(this.oTabs[F])){this.oTabs[F].removeClass(G)}}})();(function(){var L=YAHOO.lang,Dom=YAHOO.util.Dom,Evt=YAHOO.util.Event,U=ZC.Util,_GT=U.GetText;var oWidget;oWidget=ZC.Core.Widget.Create("Checkbox");oWidget.prototype.CustomSetupEnd=function(){var sCheckedClass=this.GetAttribDefault("CheckedClass","checked"),fnChangeHandler;if(this._elInput&&this.elContainer&&sCheckedClass){fnChangeHandler=function(){Dom[this._elInput.checked?"addClass":"removeClass"](this.elContainer,sCheckedClass)};Evt.on(this._elInput,"change",fnChangeHandler,this,true);Evt.on(this._elInput,"click",fnChangeHandler,this,true);fnChangeHandler.call(this)}};oWidget.prototype.GetValue=function(){if(!this._elInput){return undefined}return this._elInput.checked};oWidget.prototype.SetValue=function(bValue){this._elInput.checked=!!bValue;this._FireEventHandlers("change")};ZC.Core.Widget.Boolean=oWidget;var fnOptionKeysFindElements=function(){var sID=this.aDef.ID||this._WidgetNameToID();if(this.IsReadOnly()){this._elInput=Dom.get(sID);return }this.elContainer=Dom.get(sID);this._elInput=[];if(this.aDef.OptionKeys){this._elInput=U.Map(this.aDef.OptionKeys,function(sOptKey){return Dom.get(sID+sOptKey)});this._elInput=U.Filter(this._elInput,function(el){return L.isObject(el)});if(this._elInput.length==0){this._elInput=null}}if(!this.elContainer){this._FindContainers()}};var fnGetLabelForElement=function(elInput){var sInputId=elInput.id;var aLabels=Dom.getElementsBy(function(el){return(el.htmlFor==sInputId)},"label");if(aLabels.length==0){return elSelected.value}var elLabel=aLabels[0];return elLabel.innerText||elLabel.textContent};oWidget=ZC.Core.Widget.Create("Radio");oWidget.prototype._FindElements=fnOptionKeysFindElements;oWidget.prototype._GetSelectedInput=function(){for(var i=0,iMax=this._elInput.length;i<iMax;++i){if(this._elInput[i].checked){return this._elInput[i]}}return undefined};oWidget.prototype.GetValue=function(){if(this.IsReadOnly()){return this._elInput.value}var elSelected=this._GetSelectedInput();return elSelected?elSelected.value:undefined};oWidget.prototype.GetTextValue=function(){if(this.IsReadOnly()){return this._elInput.value}var elSelected=this._GetSelectedInput();if(!elSelected){return undefined}return fnGetLabelForElement(elSelected)};oWidget.prototype.SetValue=function(Value){if(L.isUndefined(Value)){return this.Clear()}for(var i=0,iMax=this._elInput.length;i<iMax;++i){if(this._elInput[i].value==Value){this._elInput[i].checked=true;this._FireEventHandlers("change");return }}};oWidget.prototype.Clear=function(){if(!L.isUndefined(this.GetValue())){Dom.batch(this._elInput,function(el){el.checked=false});this._FireEventHandlers("change")}};oWidget=ZC.Core.Widget.Create("CheckboxGroup");oWidget.prototype._FindElements=fnOptionKeysFindElements;oWidget.prototype.CustomSetupEnd=function(){var sSelectedClass=this.aDef.SelectedClass||"checked";var fnToggleSelectedClass=function(){var elAncestor=Dom.getAncestorByTagName(this,"tr");Dom[this.checked?"addClass":"removeClass"](elAncestor,sSelectedClass)};Evt.on(this._elInput,"change",fnToggleSelectedClass);if(YAHOO.env.ua.ie){Evt.on(this._elInput,"click",fnToggleSelectedClass)}U.ForEach(this._elInput,function(el){fnToggleSelectedClass.apply(el)})};oWidget.prototype._GetSelectedInputs=function(){return U.Filter(this._elInput,function(el){return el.checked})};oWidget.prototype.GetValue=function(){var elSelected=this._GetSelectedInputs();return U.Map(elSelected,function(el){return el.value})};oWidget.prototype.GetFormattedValue=function(sSeparator){var elSelected=this._GetSelectedInputs();if(!elSelected.length){return this.aDef.FormattedValueWhenEmpty||""}var aTextValues=U.Map(elSelected,fnGetLabelForElement);return aTextValues.join(sSeparator)};oWidget.prototype.GetTextValue=function(){return this.GetFormattedValue(this.aDef.TextValueSeparator||"\n")};oWidget.prototype.GetHTMLValue=function(){return this.GetFormattedValue(this.aDef.HTMLValueSeparator||"<br />")};oWidget.prototype.SetValue=function(aValue){var bChanged=false;U.ForEach(this._elInput,function(el){if(U.InArray(el.value,aValue)){if(!el.checked){el.checked=true;bChanged=true}else{if(el.checked){el.checked=false;bChanged=true}}}});if(bChanged){this._FireEventHandlers("change")}};oWidget.prototype.EnableOption=function(Value,bEnable){if(!L.isArray(Value)){Value=[Value]}var sAddRemove=bEnable?"removeClass":"addClass";U.ForEach(this._elInput,function(el){if(U.InArray(el.value,Value)){el.disabled=!bEnable;var elTR=Dom.getAncestorByTagName(el,"tr");Dom[sAddRemove](elTR,"disabled")}})};oWidget=ZC.Core.Widget.Create("Select");var fnSetupCopyOptionClass=function(){var elSelectedOption,sCurrentOptionClass,fnChangeHandler;fnChangeHandler=function(elSelect){if(elSelect.target){elSelect=Evt.getTarget(elSelect)}if(this.sOldOptionClass){Dom.removeClass(elSelect,this.sOldOptionClass)}var elSelectedOption=elSelect.options[elSelect.selectedIndex],sNewClass=Dom.getAttribute(elSelectedOption,"class");if(sNewClass){Dom.addClass(elSelect,sNewClass);this.sOldOptionClass=sNewClass}};if(this.aDef.CopyOptionClass){Evt.on(this._elInput,"change",fnChangeHandler,this,true);Evt.on(this._elInput,"keydown",function(){var self=this;this.iKeyInterval=window.setInterval(function(){fnChangeHandler.apply(self,self._elInput)},10)},this,true);Evt.on(this._elInput,"keyup",function(){window.clearInterval(this.iKeyInterval)},this,true);Dom.batch(this._elInput,fnChangeHandler,this,true)}};oWidget.prototype.CustomSetupEnd=fnSetupCopyOptionClass;oWidget.prototype.GetValue=function(bTextValue){if(this._elInput.type=="hidden"&&this._elInput.tagName.toLowerCase()=="input"){this.bHiddenField=true;this.GetValue=oWidget.superclass.GetValue}else{if(this._elInput.type=="select-one"){this.GetValue=function(bTextValue){var iIndex=this._elInput.selectedIndex;if(iIndex<0){return undefined}var oOpt=this._elInput.options[iIndex];return bTextValue?oOpt.text:oOpt.value}}else{this.GetValue=function(bTextValue){var aValues=[];U.ForEach(this._elInput.options,function(oOpt){if(oOpt.selected){aValues.push(bTextValue?oOpt.text:oOpt.value)}});return aValues}}}return this.GetValue(bTextValue)};oWidget.prototype.GetTextValue=function(){return this._GetFormattedValue("\n")};oWidget.prototype.GetHTMLValue=function(){return this._GetFormattedValue(this.aDef.HTMLValueSeparator||"<br />")};oWidget.prototype._GetFormattedValue=function(sSeparator){if(this.bHiddenField){return(this.elContainer.textContent||this.elContainer.innerText)}var Value=this.GetValue(true);if(Value.length==0){return(this.aDef.FormattedValueWhenEmpty||"")}if(!L.isArray(Value)){return Value}return Value.join(sSeparator)};oWidget.prototype.SetValue=function(Value){var bSingle=!L.isArray(Value);var bChanged=false;for(var iOpt=0,iOptMax=this._elInput.length;iOpt<iOptMax;++iOpt){var oOpt=this._elInput.options[iOpt];if(bSingle){if(oOpt.value==Value){if(!oOpt.selected){oOpt.selected=true;this._FireEventHandlers("change")}return }}else{var bInArray=U.InArray(oOpt.value,Value);bChanged=bChanged||(oOpt.selected!=bInArray);oOpt.selected=bInArray}}if(bChanged){this._FireEventHandlers("change")}};oWidget.prototype.SetAttrib=function(sName,AttribValue){if(sName=="Options"){var aSelectedOptions=(this._elInput.type=="select-one")?[this.GetValue()]:this.GetValue();this._elInput.options.length=0;for(var sOptVal in AttribValue){if(L.hasOwnProperty(AttribValue,sOptVal)){var elOption=document.createElement("option");elOption.value=String(sOptVal);elOption.innerHTML=String(AttribValue[sOptVal]);elOption.selected=U.InArray(sOptVal,aSelectedOptions);this._elInput.appendChild(elOption)}}}else{oWidget.superclass.SetAttrib.call(this,sName,AttribValue)}};oWidget.prototype.Clear=function(){var sFirstOptVal=this._elInput.options[0].value;if(sFirstOptVal.match(/^(_?_?Any_?_?|)$/i)){this._elInput.selectedIndex=0}};ZC.Core.Widget.Create("Reference","Core",oWidget);oWidget=ZC.Core.Widget.Create("Button_Clear");oWidget.prototype.CustomSetupStart=function(){if(!this._elInput){return }var elButton=document.createElement("input");var oAttribs=this._elInput.attributes;for(var i=0,iMax=oAttribs.length;i<iMax;i++){Dom.setAttribute(elButton,oAttribs[i].nodeName,oAttribs[i].nodeValue)}elButton.type="button";elButton.value=this.aDef.Caption||"Clear";var fnButtonClickHandler=function(event){this.oForm.Clear();Evt.stopEvent(event)};Evt.on(elButton,"click",fnButtonClickHandler,this,true);this._elInput.parentNode.replaceChild(elButton,this._elInput);this._elInput=elButton};oWidget=ZC.Core.Widget.Create("Text");oWidget.prototype.InsertText=function(sText){U.InsertAtCursor(this._elInput,sText)};oWidget=ZC.Core.Widget.Create("TextArea");oWidget.prototype.CustomSetupEnd=function(){if(this.aDef.Size){this.AddEvent(this.UpdateNRemaining,["keyup","focus"],this);this.AddEvent(this.HideNRemaining,"blur",this)}};oWidget.prototype.UpdateNRemaining=function(event){if(L.isUndefined(this._elRemaining)){this._elRemaining=document.createElement("span");this._elRemaining.className="textarea-remainingchars";Dom.insertAfter(this._elRemaining,this._elInput)}var iUsed=this.GetValue().length,iMax=this.aDef.Size,sRemainingText="";var iRemaining=iMax-iUsed;if(iRemaining>=0){sRemainingText=U.sprintf("Used %1$d of %2$d characters, %3$d remaining.",iUsed,iMax,iRemaining)}else{sRemainingText=U.sprintf("Used %1$d of %2$d characters.",iUsed,iMax)}this._elRemaining.innerHTML=sRemainingText;var bOverLimit=iUsed>iMax;var sNewClass=bOverLimit?"invalid":"valid";var sOldClass=bOverLimit?"valid":"invalid";Dom.replaceClass(this._elRemaining,sOldClass,sNewClass);Dom.removeClass(this._elRemaining,"invisible")};oWidget.prototype.HideNRemaining=function(event){if(this._elRemaining){Dom.addClass(this._elRemaining,"invisible")}};oWidget.prototype.Validate=function(){var iUsed=this.GetValue().length,iMax=this.aDef.Size;var sValMsg=sprintf(_GT("Please reduce this to %d  characters, it is currently at %d."),iMax,iUsed);if(iUsed>iMax){this.SetValid(false,sValMsg);return false}return oWidget.superclass.Validate.call(this)};oWidget.prototype.InsertText=function(sText){U.InsertAtCursor(this._elInput,sText)};oWidget=ZC.Core.Widget.Create("HTML");oWidget.prototype.CustomSetupEnd=function(){var iAttempts=0,fnInitMCE=function(){var oTinyMCE=this.GetTinyMCE(),oWidget=this,fnOldHandleEvent;if(!oTinyMCE){if(++iAttempts<10){window.setTimeout(function(){fnInitMCE.call(oWidget)},200)}return }fnOldHandleEvent=oTinyMCE.settings.handle_event_callback;oTinyMCE.settings.handle_event_callback=function(e){if(e.type=="blur"){oWidget.oSelectionBookmark=oTinyMCE.selection.getBookmark()}if(fnOldHandleEvent!=""&&!L.isUndefined(fnOldHandleEvent)){return tinyMCE.evalFunc(typeof (fnOldHandleEvent)=="function"?fnOldHandleEvent:eval(fnOldHandleEvent),0,arguments)}return true}};Evt.on(window,"load",fnInitMCE,this,true)};oWidget.prototype.GetTinyMCE=function(){if(this._elInput&&!this.oTinyMCE){this.oTinyMCE=tinyMCE.getInstanceById(this._elInput.id)}return this.oTinyMCE};oWidget.prototype.GetValue=function(){if(this.GetTinyMCE()){return this.oTinyMCE.getBody().innerHTML}else{return oWidget.superclass.GetValue.apply(this,arguments)}};oWidget.prototype.SetValue=function(sValue){if(this.GetTinyMCE()){return this.oTinyMCE.getBody().innerHTML=sValue}else{return oWidget.superclass.SetValue.apply(this,arguments)}};oWidget.prototype.InsertText=function(sText){sText=sText.replace(/['"&<>\n]/g,function(sVal){switch(sVal){case"\n":return"<br>";case'"':return"&quot;";case"'":return"&apos;";case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;"}});this.InsertHTML(sText)};oWidget.prototype.InsertHTML=function(sText){if(this.GetTinyMCE()){if(this.oSelectionBookmark){this.oTinyMCE.selection.moveToBookmark(this.oSelectionBookmark)}this.oTinyMCE.execCommand("mceInsertContent",false,sText)}else{U.InsertAtCursor(this._elInput,sText)}};oWidget=ZC.Core.Widget.Create("Group");oWidget.prototype.CustomSetupEnd=function(){if(this.aDef.HideFields){var sID,elPlaceHolder,fnToggleVisible,elOpenCloseLink,sLabelShow,sLabelHide,sShowLinkTitle,sHideLinkTitle;sLabelShow=this.GetAttribDefault("LabelShow",_GT("Show"));sLabelHide=this.GetAttribDefault("LabelHide",_GT("Hide"));sShowLinkTooltip=this.GetAttribDefault("ShowLinkTooltip",_GT("Show this section"));sHideLinkTooltip=this.GetAttribDefault("HideLinkTooltip",_GT("Hide this section"));sID=this.aDef.ID;elPlaceholder=Dom.get(sID+"-toggle");this.elContainer=Dom.get(sID+"-hidediv");if(!elPlaceholder){return }elOpenCloseLink=this.elOpenCloseLink=document.createElement("a");elOpenCloseLink.href="#";elOpenCloseLink.innerHTML=sLabelShow;this.oOpenCloseTooltip=new YAHOO.widget.Tooltip("grp-oc-tt-"+this.sName,{context:elOpenCloseLink,autofillheight:false,autodismissdelay:120000,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},text:sShowLinkTooltip});elPlaceholder.appendChild(elOpenCloseLink);var fnToggleVisible=function(event){if(event){Evt.stopEvent(event)}if(this.IsVisible()){this.Hide();this.elOpenCloseLink.innerHTML=sLabelShow;this.oOpenCloseTooltip.cfg.setProperty("text",sShowLinkTooltip)}else{this.Show();this.elOpenCloseLink.innerHTML=sLabelHide;this.oOpenCloseTooltip.cfg.setProperty("text",sHideLinkTooltip)}};Evt.on(elOpenCloseLink,"click",fnToggleVisible,this,true);if(this.IsVisible()){fnToggleVisible.call(this)}}};oWidget.prototype.GetTextValue=function(){var aResult=U.Map(this.aChildWidgets,function(oWidget){return oWidget.GetTextValue()});return aResult.join(this.aDef.TextValueSeparator||", ")};oWidget.prototype.GetHTMLValue=function(){var aResult=U.Map(this.aChildWidgets,function(oWidget){return oWidget.GetHTMLValue()});return aResult.join(this.aDef.HTMLValueSeparator||"<br />")};oWidget.prototype.GetValue=function(){var oValue={};U.ForEach(this.aChildWidgets,function(oWidget,sWidgetName){oValue[sWidgetName]=oWidget.GetValue()});return oValue};oWidget.prototype.Enable=function(bEnable,sEnableClass,sDisableClass){U.ForEach(this.aChildWidgets,function(oChild){oChild.Enable(bEnable,sEnableClass,sDisableClass)})};ZC.Core.Widget.Create("Document","Core",oWidget);ZC.Core.Widget.Create("Group_List","Core",oWidget);oWidget=ZC.Core.Widget.Create("TextInsertion","Core",oWidget);oWidget.prototype.CustomSetupEnd=function(){ZC.JSManager.GetEvent("ManagerInit").subscribe(function(){var sDestination,fnInsertClick;sDestination=this.GetAttrib("Destination");this.oDestWidget=this.oParent.GetWidget(sDestination)||((this.oParent!=this.oForm)&&this.oForm.GetWidget(sDestination))||ZC.JSManager.GetWidget(sDestination);if(!this.oDestWidget){return }var fnInsertClick=function(){this.oDestWidget.InsertText(decodeURIComponent(this.GetWidget("SelectTag").GetValue()))};this.GetWidget("Insert").AddEvent(fnInsertClick,"click",this);this.GetWidget("SelectTag").AddEvent(fnInsertClick,"dblclick",this)},this,true)};oWidget=ZC.Core.Widget.Create("Submit");oWidget.prototype.CustomSetupEnd=function(){var oLoadingPanel,sLoadingMessage;if(!this._elInput){return }if(this.GetAttribDefault("CreateYUIButton")){this.oYUIButton=new YAHOO.widget.Button(this._elInput);this.oYUIButton.on("click",function(){this._FireEventHandlers("click")},this,true)}if(sLoadingMessage=this.GetAttribDefault("LoadingMessage")){oLoadingPanel=new YAHOO.widget.Panel(Dom.generateId(this._elInput)+"wait",{fixedcenter:true,close:false,draggable:false,zindex:40000,modal:true,visible:false});oLoadingPanel.setHeader(sLoadingMessage);oLoadingPanel.setBody('<img style="margin: 0 auto; display: block;" width="220" height="19" src="/zc/images/ajax-loader-bar.gif">');oLoadingPanel.render(document.body);Evt.on(this._elInput,"click",function(){oLoadingPanel.show()})}};oWidget.prototype.SetAttrib=function(sName,AttribValue){if(sName=="value"){this._elInput.value=AttribValue;if(this.oYUIButton){this.oYUIButton.set("label",AttribValue)}}else{oWidget.superclass.SetAttrib.call(this,sName,AttribValue)}};oWidget=ZC.Core.Widget.Create("Button");oWidget.prototype.CustomSetupEnd=function(){if(!this._elInput){return }if(this.GetAttribDefault("CreateYUIButton")){this.oYUIButton=new YAHOO.widget.Button(this._elInput);this.oYUIButton.on("click",function(){this._FireEventHandlers("click")},this,true)}};ZC.Core.Widget.Create("AutoPopulate","Core",oWidget);oWidget=ZC.Core.Widget.Create("MenuButton");oWidget.prototype.CustomSetupStart=function(){if(this.GetAttribDefault("Widgets",[]).length<2){return }var elSelect=Dom.get(this.aDef.Widgets.MenuOptions.ID),elSubmit=Dom.get(this.aDef.Widgets.MenuSubmit.ID),elNewSubmit,fnMenuItemHandler,fnMakeMenuItems,mMenu,aMenuGroupTitles=[];if(!elSelect||!elSubmit){return }var sType,sTitle=elSubmit.title;if(!this.AttribIsset("Default")){sType="menu";for(var i=0,iMax=elSelect.options.length;i<iMax;i++){if(elSelect.options[i].value==""){elSelect.removeChild(elSelect.options[i]);break}}}else{sType="split"}if(!this.AttribIsset("Options")){mMenu=elSelect}else{elNewSubmit=document.createElement("input");elNewSubmit.type="button";elNewSubmit.id=elSubmit.id;elNewSubmit.name=elSubmit.name;elNewSubmit.value=elSubmit.value;elSubmit.parentNode.replaceChild(elNewSubmit,elSubmit);elSubmit=elNewSubmit;fnMenuItemHandler=function(sType,aArgs,oObj){var bResult=true,oButton=oObj.Widget.oYUIMenuButton,oHiddenField;elSelect.value=this.value;oHiddenField=document.createElement("input");oHiddenField.type="hidden";oHiddenField.name=oButton.get("name");oHiddenField.value=oButton.get("value");oButton.getForm().appendChild(oHiddenField);oObj.Widget._FireEventHandlers("click",this);if(oObj.Events){U.ForEach(oObj.Events,function(sEvent){bResult=bResult&&ZC.JSManager.GetEvent(sEvent).fire(this,oObj.Widget)},this)}if(bResult&&oObj.Submit){oButton.submitForm()}return bResult};fnMakeMenuItems=function(aOptions){var aMenu=[];U.ForEach(aOptions,function(mOption,mKey){var aSubMenu,aItemDef={value:mKey,onclick:{fn:fnMenuItemHandler,obj:{Widget:this,Submit:true}}};if(L.isObject(mOption)){aItemDef.onclick.obj.Submit=L.isUndefined(mOption.Submit)||mOption.Submit;aItemDef.onclick.obj.Events=!L.isUndefined(mOption.Events)?mOption.Events:false;if(!L.isUndefined(mOption.Group)){aItemDef=fnMakeMenuItems.call(this,mOption.Options);if(L.isString(aItemDef.Group)){aMenuGroupTitles.push(aItemDef.Group)}else{aMenuGroupTitles.push(false)}}else{aItemDef.text=mOption.Text;if(!L.isUndefined(mOption.Options)){if(!L.isUndefined(mOption.Selectable)&&!mOption.Selectable){delete aItemDef.onclick}aSubMenu=fnMakeMenuItems.call(this,mOption.Options);if(aSubMenu.length){aItemDef.submenu={id:Dom.generateId(),itemdata:aSubMenu}}}}}else{aItemDef.text=mOption}aMenu.push(aItemDef)},this);return aMenu};Dom.addClass(elSelect,"hide");mMenu=fnMakeMenuItems.call(this,this.GetAttrib("Options"))}this.oYUIMenuButton=new YAHOO.widget.Button(elSubmit,{type:sType,menu:mMenu});U.ForEach(aMenuGroupTitles,function(sTitle,iIndex){if(sTitle){this.oYUIMenuButton.setItemGroupTitle(sTitle,iIndex)}},this);if(sTitle){var sDefaultTitleVar=sType.toUpperCase()+"BUTTON_DEFAULT_TITLE";var sVisibleTitleVar=sType=="menu"?"MENUBUTTON_MENU_VISIBLE_TITLE":"SPLITBUTTON_OPTION_VISIBLE_TITLE";this.oYUIMenuButton[sDefaultTitleVar]=elSubmit.title+" ("+this.oYUIMenuButton[sDefaultTitleVar]+")";this.oYUIMenuButton[sVisibleTitleVar]=elSubmit.title+" ("+this.oYUIMenuButton[sVisibleTitleVar]+")";this.oYUIMenuButton.set("title",this.oYUIMenuButton[sDefaultTitleVar])}this.aDef.Widgets=[]};oWidget=ZC.Core.Widget.Create("Password");oWidget.prototype.GetValue=function(){return this._elInput[0].value};oWidget.prototype.GetTextValue=function(){return U.StrRepeat("*",this.GetValue().length)};oWidget=ZC.Core.Widget.Create("Password_Change","Core",oWidget);oWidget.prototype._FindElements=function(){var sName;sName=this._WidgetNameToID();this._elInput=[Dom.get(sName),Dom.get(sName+"_confirm")];this._FindContainers()};oWidget.prototype.Validate=function(){var sVal1,sVal2;sVal1=this._elInput[0].value;sVal2=this._elInput[1].value;if(sVal1&&sVal2&&sVal1!=sVal2){this.SetValid(false,_GT("The two passwords do not match"));return false}return oWidget.superclass.Validate.call(this)};oWidget=ZC.Core.Widget.Create("LinkedSelect");oWidget.prototype.CustomSetupEnd=fnSetupCopyOptionClass;oWidget.prototype._FindElements=function(){var sBaseName,i,elInput;sBaseName=this._WidgetNameToID();i=0;this._elInput=[];do{elInput=Dom.get(sBaseName+"."+i);if(elInput){this._elInput.push(elInput)}i++}while(elInput);this._FindContainers()};oWidget.prototype.Clear=function(){U.ForEach(this._elInput,function(elSelect){if(U.InArray(elSelect.options[0].value,["Any","__Any__",""])){elSelect.selectedIndex=0}if(L.isFunction(elSelect.onchange)){elSelect.onchange()}})};oWidget.prototype.GetValue=function(){var mVal;if(L.isUndefined(this._elInput)||L.isUndefined(this._elInput[this._elInput.length-1])){return undefined}mVal=this._elInput[this._elInput.length-1].value;if(mVal.lastIndexOf("-")!=-1){mVal=mVal.substring(mVal.lastIndexOf("-")+1)}return mVal};ZC.Core.Widget.Create("LinkedSelect_AllWidgetValues","Core",oWidget);ZC.Core.Widget.Create("LinkedSelect_AllowBlank","Core",oWidget);ZC.Core.Widget.Create("LinkedSelect_LinkedSearch","Core",oWidget);ZC.Core.Widget.Create("LinkedSelect_Multiple","Core",oWidget)})();(function(){var A=ZC.Util.GetText;ZC.Namespace("Billing.Validator");ZC.Billing.Validator.CCExpiryDate=ZC.Core.Validator;ZC.Billing.Validator.CCExpiryDate.sDefaultValidationMsg=A("Expiry date must be in the format mmyy");ZC.Billing.Validator.CCExpiryDate.Validate=function(E,D){if(E==""){return true}var C=/^(0[1-9]|1[0-2])(\d{2})$/.exec(E);if(C){var B=C[1];var H=C[2];var G=((H>=70)?"19":"20")+H;var F=new Date(G,B,0,0,0,-1);if(F<new Date){this.sDefaultValidationMsg=A("Expiry date must not be in the past");return false}return true}return false}})();(function(){var A=YAHOO.lang,D=YAHOO.util.Dom,F=YAHOO.util.Event,B=ZC.Util,E=B.GetText;var C=ZC.Core.Block.Create("ViewBasket","Billing");C.prototype.CustomSetupEnd=function(){var G=D.get("CheckoutButton"),H=this.GetAttribDefault("FormValues");if(this.GetAttrib("Page")!="ViewBasket"||!G||!H){return }F.on(G,"click",function(K){var J=false,M;for(sKey in H){if(A.hasOwnProperty(H,sKey)){var I=ZC.JSManager.GetWidget(sKey),L;if(!I){continue}L=I.GetValue();if(!A.isUndefined(L)&&L!=H[sKey]){J=true;break}}}if(J){F.stopEvent(K);M=new YAHOO.widget.SimpleDialog("dlg",{width:"30em",fixedcenter:true,modal:true,visible:false,draggable:false,buttons:[{text:E("OK"),handler:function(){this.hide()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_WARN});M.setHeader(E("Warning!"));M.setBody(E('You have changed quantities and/or removed items without first clicking "Update". Please make sure your order is correct and then click "Update" to update the order totals.'));M.render(document.body);M.show()}})}})();(function(){var A=ZC.Core.EventListener.Create("Admin_ApplyOnline","GraduateLink");A.prototype.HandleEvent=function(E,F,I){var C=ZC.JSManager.GetWidget("FrmAddEdit.applyonline");var D=ZC.JSManager.GetWidget("FrmAddEdit.appenquiriesbyemail");var H=ZC.JSManager.GetWidget("FrmAddEdit.applicationemail");var B=this.aDef.EnabledClass;var G=this.aDef.DisabledClass;if(C.GetValue()==1||C.GetValue()==2){D.Enable(true,B,G);if(D.GetValue()){H.Enable(true,B,G)}else{H.Disable(B,G)}}else{D.Disable(B,G);H.Disable(B,G)}};var A=ZC.Core.EventListener.Create("Admin_UsersAddressEnableDisable","GraduateLink");A.prototype.HandleEvent=function(L,J,C){var G=ZC.JSManager.GetWidget("FrmAddEdit.addressasemployer");var B=["FrmAddEdit.address1","FrmAddEdit.address2","FrmAddEdit.address3","FrmAddEdit.town","FrmAddEdit.countyid","FrmAddEdit.postcode"];var H=this.aDef.EnabledClass;var E=this.aDef.DisabledClass;var I=!G.GetValue();for(var F=0,D=B.length;F<D;++F){var K=ZC.JSManager.GetWidget(B[F]);K.Enable(I,H,E)}}})();(function(){var A=YAHOO.lang,B=ZC.Util,D=YAHOO.util.Dom,E=YAHOO.util.Event;var C=ZC.Core.Block.Create("Poll","Poll");C.prototype.CustomSetupEnd=function(){var H=ZC.JSManager.GetWidget(this.GetAttrib("FormName")),F=H.GetWidget("Vote"),G=function(O,K,Q){var R=0,P=true,N=this.GetAttribDefault("Polls"),L=K[0],M=L.sName.substr(4),I=N[M].MinSelections,J=N[M].MaxSelections;B.ForEach(L.GetValue(),function(S){if(S){R++}});if(I&&R<I){P=false}if(J){if(R>J){P=false}else{if(R==J){B.ForEach(L.aChildWidgets,function(S){if(!S.GetValue()){S.Disable()}})}else{L.Enable()}}}F.Enable(P)};B.ForEach(this.GetAttrib("Polls"),function(J,M){var I=H.GetWidget("poll"+M),L="SelectionsChanged"+M,K;if(I){K=I.AddEvent(L,"change",this);if(K){K.subscribe(G,this,true);G.call(this,"load",[I])}}},this)}})();(function(){var A=YAHOO.lang,D=YAHOO.util.Dom,G=YAHOO.util.Event,C=ZC.Util,E=C.GetText,F=ZC.JSManager,B;B=ZC.Core.ClientSideObject.Create("QuickFind");B.prototype.Setup=function(){var H,L,N,O,J,M,P,I;H=[];for(L in this.aDef.Items){if(A.hasOwnProperty(this.aDef.Items,L)){H.push(L)}}M=function(){N=new YAHOO.widget.Menu("QuickFindMenu");N.addItems(H);N.subscribe("click",this.MenuClickHandler,this,true)};switch(this.aDef.AttachTo){case"Button":P=D.get(this.aDef.AttachToID);if(P){if(H.length==1){var K=H[0];this.oYUIButton=new YAHOO.widget.Button({type:"push",label:E("Quick find")+": "+K,container:P});this.oYUIButton.on("click",function(){this.OpenQuickFind(K)},this,true)}else{M.apply(this);N.render(document.body);this.oYUIButton=new YAHOO.widget.Button({type:"menu",label:E("Quick find"),menu:N,container:P})}this.elContext=this.oYUIButton.get("element")}break;case"AdminMenu":default:M.apply(this);O=new YAHOO.widget.MenuBarItem("QuickFindMenuBarItem",{text:E("Quick find"),submenu:N});J=function(){var R=F.GetWidget("adminmenu"),Q;if(R){Q=R.oYUIMenuBar;Q.insertItem(O,this.GetAttribDefault("MenuPos",1));Q.render();this.elContext=O.element}};F.GetEvent("ManagerInit").subscribe(J,this,true);break}I=D.getElementsByClassName("qflink","a");if(I.length){G.on(I,"click",function(Q){var S=G.getTarget(Q),R=S.href.replace(/.*#/,"");this.OpenQuickFind(R)},this,true)}};B.prototype.MenuClickHandler=function(H,I){if(I.length<2){return }this.OpenQuickFind(I[1].cfg.getProperty("text"))};B.prototype.OpenQuickFind=function(L){var L,P,Y,W,H,a="qf-loading",X,b,J,M,U,R,Z,O,V,N,T,d,I,Q,S,c,K;P=this.aDef.Items[L];Z=new YAHOO.util.XHRDataSource(P.AjaxURL+"&");Z.responseSchema={resultsList:"Results",fields:["HTML","URLs","Text"],metaFields:{ExtraRows:"ExtraRows"}};N=document.createElement("div");N.className="qf-dialog";T=document.createElement("div");N.appendChild(T);U=F.CreateDialog(P.DialogTitle,N,document.body,{width:"22em",context:[this.elContext,"tl","bl"]});d=document.createElement("label");d.innerHTML=P.FieldCaption;T.appendChild(d);Q=document.createElement("div");T.appendChild(Q);I=document.createElement("input");I.type="text";Q.appendChild(I);S=document.createElement("div");Q.appendChild(S);D.setStyle(Q,"z-index",1000-(D.getRegion(I).top/10));Y={animHoriz:false,animVert:true,queryQuestionMark:false,queryDelay:0.5,resultTypeList:false,forceSelection:false};R=new YAHOO.widget.AutoComplete(I,S,Z,Y);W=YAHOO.env.ua.ie;if(W&&W<7){R.useIFrame=true}R.formatResult=function(g,h,f){return g.HTML};R.doBeforeLoadData=function(h,f,g){if(A.isUndefined(f.meta)||A.isUndefined(f.meta.ExtraRows)||f.meta.ExtraRows==0){R.setFooter(false);return true}R.setFooter('<div class="qf-extrarows">'+C.sprintf(E("%d more items matched..."),f.meta.ExtraRows)+"</div>");return true};H=function(m,l){var h=document.createElement("span"),f,g,k,j;h.className="qf-selectedvalue";h.innerHTML=E("Selected: ")+l[2].Text;D.setStyle(h,"opacity",0);D.addClass(h,"hide");N.appendChild(h);k=new YAHOO.util.Anim(T,{opacity:{to:0}},0.5);j=new YAHOO.util.Anim(h,{opacity:{to:1}},0.5);k.onComplete.subscribe(function(){D.addClass(T,"hide");j.animate()});j.onStart.subscribe(function(){D.removeClass(h,"hide")});if(l[2].URLs.length==1){h.appendChild(document.createElement("br"));h.appendChild(document.createElement("br"));h.appendChild(document.createTextNode(E("Loading...")));j.onComplete.subscribe(function(){window.location=l[2].URLs[0].URL})}else{h.appendChild(document.createElement("br"));h.appendChild(document.createElement("br"));h.appendChild(document.createTextNode(E("Select an action:")));f=document.createElement("ul");f.className="qf-linklist";C.ForEach(l[2].URLs,function(q){var p=document.createElement("a"),o=document.createElement("li");p.href=q.URL;p.appendChild(document.createTextNode(q.Caption));o.appendChild(p);f.appendChild(o);if(!g){g=p}});h.appendChild(f);j.onComplete.subscribe(function(){g.focus()})}k.animate()};R.itemSelectEvent.subscribe(H,this,true);R.suppressInputUpdate=true;X=function(){D.addClass(K,"hide");D.addClass(T,a)};b=function(){D.removeClass(T,a)};R.dataRequestEvent.subscribe(X);R.dataReturnEvent.subscribe(b);R.dataErrorEvent.subscribe(b);K=document.createElement("span");K.className="qf-error hide";T.appendChild(K);J=function(){K.innerHTML=E("An error has occurred loading data, please refresh the page and try again.");D.removeClass(K,"hide")};R.dataErrorEvent.subscribe(J);if(P.AdvancedSearchURL){c=document.createElement("a");c.className="qf-advsearch";c.href=P.AdvancedSearchURL;c.innerHTML=E("Advanced search");T.appendChild(c)}this.oYUIAutoComplete=R;U.render();U.show();I.focus()}})();