var Settings={gotoView:function(a,b,c){if(!b||(typeof(leavePage)!="function")||leavePage()){window.location.href=FORM_ACTION_READ_ONLY+"?type="+a+(c?c:"")}}};Settings.AutoCompletion={autoCompleterRegistry:new Array(),eacAcceptWasRemapped:false,setupAutoCompleter:function(b,c,a){Debug.println("Setting up auto-completion for ",b," with handler ",(a==null?"none":a.getName()));if(!b){return}eac_setup(b,c);this.autoCompleterRegistry[b.name]=a;b.onfocus=Settings.AutoCompletion.onFocusAutoCompleterField.bindAsEventListener(Settings.AutoCompletion);if(!this.eacAcceptWasRemapped){this.remapEacAccept()}},remapEacAccept:function(){eac_accept=Settings.AutoCompletion.acceptAutoCompletionMatch.bind(Settings.AutoCompletion)},acceptAutoCompletionMatch:function(a){if(eac_visible()&&eac_Element!=null){var b=this.autoCompleterRegistry[eac_Element.name];if(b){Debug.println("Using '",b.name,"' to accept an auto-completion match.");b.acceptMatch.bind(b)(a)}else{Debug.println("No handler for ",eac_Element.name,"?")}}},onFocusAutoCompleterField:function(a){var b=(typeof(a.target)=="undefined")?a.srcElement:a.target;this.setCompletionField(b)},setCompletionField:function(b){Debug.println("setCompletionField received ",b);var a=this.autoCompleterRegistry[b.name];if(a==null){return}a.setup.bind(a)();Debug.println("Set auto-complete view type to '",EAC_TYPE_COMPLETER,"'");if(a.onFocusField){Debug.println("Invoking onFocusField for ",a.getName());a.onFocusField.bind(a)()}}};function dialog_reset(){document.fm.fb_submit.value="Reset";submitForm()}function dialog_apply(){triggerCustomEvent("apply");document.fm.fb_submit.value="Apply";submitForm()}function dialog_custom(a){triggerCustomEvent(a);document.fm.fb_submit.value=a;submitForm()}function setupAdminView(){onSetupAdminView();isDirty=(document.fm.isDirty)?(document.fm.isDirty.value=="true"):false;syncButtons()}function closeInsertLabelDialog(labelArray,dialogname){var set="";if(labelArray!=null){for(var i=0;i0){eval("document.fm."+dialogname+".value = params[0][0];document.fm."+dialogname+"_text.value = params[0][1];");makeDirty()}}function setup_disable_select(source,showArray,hideArray,targets){var select=eval("document.fm."+source);if(select){var old_onchange=select.onchange;select.onchange=function(){old_onchange();do_disable_select(source,showArray,hideArray,targets)};do_disable_select(source,showArray,hideArray,targets)}}function do_disable_select(source,enableArray,disableArray,targets){var select=eval("document.fm."+source);var value=currentSelValue(select);var enable=matchesShowHideArray(value,enableArray,disableArray);for(var i=0;i0){a=false;for(var c=0;c=8&&a.substring(0,8)=="def-val-")}function isTemplateValue(a){return a.match(new RegExp("\\.template$"))}function isEditableValue(a){return TEMPLATE_DATA[a]&&TEMPLATE_DATA[a].editable}function template_edit(formElement,editortype,directory){var select=eval("document.fm."+formElement);var value=currentSelValue(select);if(isDefaultValue(value)){value=select.getAttribute("defval",0)}template_dialog(formElement,editortype,directory,value)}function template_new(c,b,a){template_dialog(c,b,a,"")}function template_dialog(e,c,a,b){var d="";d+="&dir="+a;if(b){d+="&name="+b}openDialogEx(c,SKINEDIT_FEATURES,720,725,"",e,d,DIALOG_FLAG_MULTIPLE_WINDOWS)}function template_choose(a){if(currentSelValue(document.fm.name)=="-"){document.fm.name.selectedIndex++}if(warnIgnoreChanges()){document.fm.fb_submit.value="Reset";document.fm.isDirty.value="false";submitForm()}else{selectOptionByValue(document.fm.name,a)}}function template_validate(){if(!validateSavedFileName()){return false}return true}function template_save(a){if(a!=null){a.disabled=true}if(template_validate()){document.fm.fb_submit.value="Apply";document.fm.operation.value="save";submitForm()}else{if(a!=null){a.disabled=false}}}function template_delete_allowed(a,b){return true}function template_delete(){var a=currentSel(document.fm.name);var b=currentSelValue(document.fm.name);if(!isTemplateValue(b)&&isEditableValue(b)&&template_delete_allowed(a,b)&&confirm((new MessageFormat(i18n("template_file_delete_confirmation_message",'Are you sure you want to permanently delete "{0}"?\n\nClick OK to delete.\nClick Cancel to return to this page.'))).format(a))){document.fm.fb_submit.value="Apply";document.fm.operation.value="delete";submitForm()}}function template_test(b){var d="";if(document.fm.dir){d+="&dir="+document.fm.dir.value}d+="&name="+currentSelValue(document.fm.name);var c=parseInt(ua("userdirtest_window_width","340"),10);var a=parseInt(ua("userdirtest_window_height","600"),10);openDialogEx(b,ua("userdirtest_window_features")+getSizeAndPosition(c,a),c,a,"","",d,DIALOG_FLAG_MULTIPLE_WINDOWS)}var ud_showAccounts_update;function template_update_opener(b,a){if(window.opener!=null&&!window.opener.closed&&window.opener.template_update&&document.fm.dialogname){window.opener.template_update(document.fm.type.value,document.fm.dialogname.value,b,a)}if(document.fm.Delete){document.fm.Delete.disabled=(isTemplateValue(currentSelValue(document.fm.name))||!isEditableValue(currentSelValue(document.fm.name)))}}function template_finished(a,b){if(warnIgnoreChanges()){template_update_opener(a,b);window.close()}}function template_update(viewtype,dialogname,selectedname,data){Debug.println("settings.js:template_update(",viewtype,", ",dialogname,", ",selectedname,", and some data");var select=eval("document.fm."+dialogname);if(select!=null){var selectedValue=(select.options.length>0)?select.value:null;if(select.options.length>0&&isDefaultValue(select.options[0].value)){select.options.length=1}else{select.options.length=0}var editButton=document.fm[dialogname+"_edit"];for(var cname in data){if(cname=="extend"){continue}var cur=data[cname];var index=select.options.length;select.options[index]=new Option(cur.displayname,cur.name);if(selectedValue==cur.name){select.options[index].selected=true;if(editButton!=null){editButton.disabled=!cur.editable}}if(cur.editable){select.options[index].className="editable"}}var idx=selectIndexOfValue(select,selectedname);if(idx!=-1&&idx<=select.options.length){select.options[idx].selected=true;if(editButton!=null){editButton.disabled=!data[selectedname]["editable"]}}onTemplateSelectUpdate(select,selectedname,data)}onTemplateUpdate(selectedname,data)}function onTemplateSelectUpdate(a,c,b){makeDirty()}function onTemplateUpdate(b,a){}function template_chooseproject(){if(warnIgnoreChanges()){document.fm.proj.value=currentSelValue(document.fm.template_project).substring(2);go("Reset")}else{selectOption(document.fm.template_project,document.fm.proj.value,-1)}}function collapse_toggle(d){var c=document.getElementById(d);if(c){var b=(c.style.display!="none");c.style.display=b?"none":"";var a=document.getElementById(d+".img");if(a){a.src=(b)?"/images/modern/icons/show.gif":"/images/modern/icons/hide.gif"}}}function onImageChange(a,b){if(a==null){return}var c=a.options[a.selectedIndex].value;if(c.indexOf("def-val-")==0){c=c.substring(8)}if(b!=null){b.src=c}}function uncheckUseDefault(a){var b=document.getElementById("_x"+a);if(b&&b.type=="checkbox"){b.checked=false}}Settings.GroupSelect=Class.create();Settings.GroupSelect.prototype={fieldNamespace:null,exclusive:false,val2description:new Array(),errorMessageContainer:null,isReadOnly:false,initialize:function(a,c,b){this.fieldNamespace=a;this.exclusive=c;this.val2description=b},init:function(d){this.isReadOnly=d;var b=document.fm[this.fieldNamespace+"_new"];var a=document.fm[this.fieldNamespace+"_addbutton"];var c=document.fm[this.fieldNamespace+"_removebutton"];if(d){if(b){b.disabled=true}if(a){a.disabled=true}if(c){c.disabled=true}}else{if(b&&a){Events.attach(a,Events.Click,this,this.addNew);Events.attach(b,Events.KeyUp,this,this.onNewFieldKeyUp);Events.attach(c,Events.Click,this,this.removeSelectedOptions);this.errorMessageContainer=document.getElementById(this.fieldNamespace+"_new_value_error");this.validateAddNewValueButtonEnabled()}}this.consolidateSelection()},onNewFieldKeyUp:function(a){switch(keyCode2(a)){case 13:if(!document.fm[this.fieldNamespace+"_addbutton"].disabled){this.addNew()}return;default:this.validateAddNewValueButtonEnabled()}},validateAddNewValueButtonEnabled:function(){document.fm[this.fieldNamespace+"_addbutton"].disabled=(document.fm[this.fieldNamespace+"_new"].value.trim()=="")},addNew:function(){var c=document.fm[this.fieldNamespace+"_new"];var b=c.value;var a=document.fm[this.fieldNamespace+"_selected"];var d=document.fm[this.fieldNamespace+"_available"];if(selectIndexOfValue(a,b)||selectIndexOfValue(d,b)){this.addNewError("That value already exists.")}if(selectIndexOfValue(sel,b)){this.addNewError("That value already exists.")}addOption(a,b,b);this.clearError();this.consolidateSelection();this.makeDirty()},removeSelectedOptions:function(){removeSelected(document.fm[this.fieldNamespace+"_selected"]);removeSelected(document.fm[this.fieldNamespace+"_available"]);this.consolidateSelection();this.makeDirty()},addNewError:function(a){if(this.errorMessageContainer){show_default(true,this.errorMessageContainer);this.errorMessageContainer.innerHTML=a}},clearError:function(){if(this.errorMessageContainer){show_default(false,this.errorMessageContainer);this.errorMessageContainer.innerHTML=""}},activate:function(){if(this.exclusive){moveSelected(document.fm[this.fieldNamespace+"_available"],document.fm[this.fieldNamespace+"_selected"]);this.changeDescription(document.fm[this.fieldNamespace+"_available"])}else{copySelected(document.fm[this.fieldNamespace+"_available"],document.fm[this.fieldNamespace+"_selected"],true)}this.changeDescription(document.fm[this.fieldNamespace+"_selected"]);this.consolidateSelection();this.makeDirty()},deactivate:function(){if(this.exclusive){moveSelected(document.fm[this.fieldNamespace+"_selected"],document.fm[this.fieldNamespace+"_available"]);this.changeDescription(document.fm[this.fieldNamespace+"_available"])}else{removeSelected(document.fm[this.fieldNamespace+"_selected"])}this.changeDescription(document.fm[this.fieldNamespace+"_selected"]);this.consolidateSelection();this.makeDirty()},activeup:function(){if(selShiftUp(document.fm[this.fieldNamespace+"_selected"])){this.consolidateSelection();this.makeDirty()}},activedown:function(){if(selShiftDown(document.fm[this.fieldNamespace+"_selected"])){this.consolidateSelection();this.makeDirty()}},consolidateSelection:function(){var c=document.fm[this.fieldNamespace+"_selected"];var b=document.fm[this.fieldNamespace];b.value=selectToText(c);var d=document.fm[this.fieldNamespace+"_unused"];var a=document.fm[this.fieldNamespace+"_available"];if(a!=null&&d!=null){d.value=selectToText(a)}},changeDescription:function(c){var e=document.getElementById(c.name+"_desc");if(e==null){return}var d="";for(var b=0;b=MARKER.length&&b.substring(b.length-MARKER.length)==MARKER){a.options[a.selectedIndex+1].selected=true}}function onSkinChange(a){}function validateSavedFileName(){var h=document.fm.dispname.value;if(trim(h)==""){alert(i18n("template_no_save_name_alert_message","Please specify a Name before clicking Save."));document.fm.dispname.focus();return false}var a=(document.fm.shared!=null);var d=a?document.fm.shared.checked:false;var g=(document.fm.old_dispname==null||h!=document.fm.old_dispname.value);var c=(a&&((document.fm.old_shared.value=="true")!=d));if(g||c){for(var b in TEMPLATE_DATA){var i=TEMPLATE_DATA[b];if((!a||i.shared==d)&&i.displayname==h){if(i.editable){var f=i18n("template_file_overwrite_confirmation_message","A file named '{0}' already exists. Do you wish to overwrite that file?\n\nClick OK to overwrite.\nClick Cancel to return to this page.");f=(new MessageFormat(f)).format(h);var e=confirm(f);if(!e){document.fm.dispname.focus();return false}}else{alert((new MessageFormat(i18n("template_file_name_uneditable_alert_message",'The name "{0}" is already in use by a read-only file. Please choose another name.')).format(h)));document.fm.dispname.focus();return false}break}}for(var b in TEMPLATE_DATA){var i=TEMPLATE_DATA[b];if(i.shared!=d&&i.displayname==h){var f;if(!d){f=i18n("template_file_same_name_as_shared_file_confirmation_message",'The name "{0}" is already in use by a shared file. You may save a private file with the same name, but it is not recommended. Do you wish to save your private file with this name?\n\nClick OK to save anyway.\nClick Cancel to return to this page.')}else{f=i18n("template_file_same_name_as_private_file_confirmation_message",'The name "{0}" is already in use by a private file. You may save a shared file with the same name, but it is not recommended. Do you wish to save your shared file with this name?\n\nClick OK to save anyway.\nClick Cancel to return to this page.')}f=(new MessageFormat(f)).format(h);var e=confirm(f);if(!e){document.fm.dispname.focus();return false}}}}else{if(document.fm.editable.value=="false"){alert((new MessageFormat(i18n("template_file_name_uneditable_alert_message",'The name "{0}" is already in use by a read-only file. Please choose another name.')).format(h)));document.fm.dispname.focus();return false}}return true}Settings.UserDigestList=Class.create();Settings.UserDigestList.prototype={digestStates:new Array(),digestRowContainer:null,fieldNamespace:"",emailAddresses:null,preferredEmailAddress:null,field:null,isReadOnly:false,initialize:function(c,b,d,a){this.fieldNamespace=c;this.emailAddresses=b;this.preferredEmailAddress=d;this.serverDigestStyle=a},init:function(){this.initDigestRows()},setField:function(b,a){this.field=b;this.isReadOnly=a;if(this.preferredEmailAddress!=null&&!a){this.field.form[this.fieldNamespace+"_add"].disabled=false}},initDigestRows:function(){this.digestRowContainer=document.getElementById(this.fieldNamespace+"_digestrows");this.addEmptyRow(this.digestStates.length==0);for(var a=0;a0){c+=","}c+=this.digestStates[a].serialize(b);b++}}return c},onPropertyChange:function(c,a){Debug.println("onPropertyChange for ",c,"...");var e=this.digestStates[c];var b=parseInt(a.hour.options[a.hour.selectedIndex].value,10);if(b==12){b=0}var d=(a.ampm.options[a.ampm.selectedIndex].value=="AM");if(!d){b+=12}e.hour=b;e.minute=parseInt(a.minute.options[a.minute.selectedIndex].value,10);e.frequencyCode=parseInt(a.frequency.options[a.frequency.selectedIndex].value,10);e.email=a.email.options[a.email.selectedIndex].value;e.styleCode=parseInt(a.style.options[a.style.selectedIndex].value,10);Debug.println("Finished updating properties for ",c,": ",e.serialize(""));this.makeDirty()},onRemoveClick:function(b,a){this.digestStates[b].enabled=false;show_TR(false,a);this.makeDirty()},onAddClick:function(){var b=new Traction.UserDigestState(12,0,7,true,this.preferredEmailAddress,this.serverDigestStyle);var a=this.digestStates.length;this.digestStates[a]=b;this.addDigestRow(b,a);this.makeDirty()},makeDirty:function(){this.field.value=this.getDigestSerialization();Debug.println("New field value: ",this.field.name," = ",this.field.value);var a=0;for(var b=0;b0){c+=","}c+=this.digestStates[a].serialize(b);b++}}return c},onPropertyChange:function(c,a){Debug.println("onPropertyChange for ",c,"...");var e=this.digestStates[c];var b=parseInt(a.hour.options[a.hour.selectedIndex].value,10);if(b==12){b=0}var d=(a.ampm.options[a.ampm.selectedIndex].value=="AM");if(!d){b+=12}e.hour=b;e.minute=parseInt(a.minute.options[a.minute.selectedIndex].value,10);e.frequencyCode=parseInt(a.frequency.options[a.frequency.selectedIndex].value,10);Debug.println("Finished updating properties for ",c,": ",e.serialize(""));this.makeDirty()},onRemoveClick:function(b,a){this.digestStates[b].enabled=false;show_TR(false,a);this.makeDirty()},onAddClick:function(){var b=new Traction.DigestState(12,0,7,true);var a=this.digestStates.length;this.digestStates[a]=b;this.addDigestRow(b,a);this.makeDirty()},makeDirty:function(){this.field.value=this.getDigestSerialization();Debug.println("New field value: ",this.field.name," = ",this.field.value);var a=0;for(var b=0;b(l*1)){l=d}}}document.fm[this.fieldNamespace+"_cur_min"].value=d;document.fm[this.fieldNamespace+"_cur_max"].value=l}else{if(b=="max"){var d=document.fm[this.fieldNamespace+"_cur_min"].value;var l=document.fm[this.fieldNamespace+"_cur_max"].value;var f=new RegExp("\\D+");if(l.match(f)){l=""}else{if((l*1)<=0){l=""}else{if(d!=""&&(d*1)>(l*1)){d=l}}}document.fm[this.fieldNamespace+"_cur_min"].value=d;document.fm[this.fieldNamespace+"_cur_max"].value=l}else{if(b=="title"){document.fm[this.fieldNamespace+"_cur_titleres"].checked=false}else{if(b=="titleres"){this.updateTitle()}else{if(b=="id"){this.updateTitle()}else{if(b=="user"){this.setSortOptions(false)}else{if(b=="size"){this.onUpdateSize(currentSelValue(document.fm[this.fieldNamespace+"_cur_size"]),true)}else{if(b=="active"){var a=document.fm[this.fieldNamespace+"_sectionselect"].options[document.fm[this.fieldNamespace+"_sectionselect"].selectedIndex];a.style.color=(document.fm[this.fieldNamespace+"_cur_active"].checked?"#000":"#999")}else{if(b=="status"){var k=false;var m=false;for(var e=0;e<5;e++){if(document.fm[this.fieldNamespace+"_cur_status"+e].checked){switch(e){case 0:case 1:case 4:k=true;break;case 2:case 3:m=true;break}}}var c=document.getElementById(this.fieldNamespace+"_status_pdr_none");c.style.display=(k)?"none":"";var j=document.getElementById(this.fieldNamespace+"_status_lu_none");j.style.display=(m)?"none":""}else{if(b=="showtitle"){if(currentSelValue(document.fm[this.fieldNamespace+"_cur_showtitle"])=="-1"){document.fm[this.fieldNamespace+"_cur_showadd"].checked=false;document.fm[this.fieldNamespace+"_cur_showadd"].disabled=true}else{document.fm[this.fieldNamespace+"_cur_showadd"].disabled=this.readOnly}}}}}}}}}}}}if(this.currentIndex>=0){this.editor2array(this.currentIndex)}this.updateSerialization();if(b!="usedefault"){var h=document.fm[this.fieldNamespace+"_usedefaultsections"];var g=document.fm[this.fieldNamespace+"_usedefault"];if(h&&h.checked){h.checked=false;this.toggleDisplayUseDefaultSectionsWarning(false);g.value="false"}}},onUpdateSize:function(a,b){switch(a){case"1":this.setShowEnabled([0,0,0,0,0],b);document.fm[this.fieldNamespace+"_cur_show0"].checked=true;break;default:case"2":this.setShowEnabled([1,1,0,0,0],b);break;case"0":this.setShowEnabled([1,1,0,0,0],b);break;case"3":this.setShowEnabled([1,1,1,0,0],b);break;case"4":this.setShowEnabled([1,1,1,1,1],b);break}},setShowEnabled:function(a,d){for(var c=0;c=0){this.array2editor(a);show_TR(0,this.chooseRow);show_TR(1,this.editRow)}else{show_TR(1,this.chooseRow);show_TR(0,this.editRow)}show_TABLE(1,this.editTable);this.currentIndex=a},onMoveUpClick:function(){var c=document.fm[this.fieldNamespace+"_sectionselect"].options;var b;var d=false;for(var a=0;a=0;a--){if(c[a].selected){if(d){if(this.currentIndex==a){this.currentIndex=a+1}b=this.sectionStates[a];this.sectionStates[a]=this.sectionStates[a+1];this.sectionStates[a+1]=b}}else{d=true}}selShiftDown(c);this.makeDirty(null,false)},onNewClick:function(){var c=document.fm[this.fieldNamespace+"_sectionselect"].options.length;this.sectionStates[c]=new Array();for(var a=0;a=0;a--){if(c[a].selected){this.sectionStates[a]=null;c[a]=null;b=a}}deleteNulls(c);deleteNulls(this.sectionStates);if(b>=c.length){b=c.length-1}document.fm[this.fieldNamespace+"_sectionselect"].selectedIndex=b;this.onChooseSection(false);this.makeDirty(null,false)}},onEditCollectionClick:function(){var a=null;var c=null;var d=this.sectionStates[this.getCurrentIndex()][this.i_collection];var b=d.indexOf("|");if(b!=-1){a=trim(d.substring(0,b));c=trim(d.substring(b+1))}this.__closeChooseCollectionDialog=closeChooseCollectionDialog;closeChooseCollectionDialog=this.onChooseCollection.bind(this);openChooseCollectionDialog(this.getCollectionId(a,c),this.getCollectionForUserAdmin(),this.getCollectionForProjectAdmin(),this.getExtrasForCollectionDialog())},getCollectionId:function(a,b){if(a==null||b==null){return""}return a+" | "+b},getCollectionForUserAdmin:function(){if(this.defaults){return false}if(this.listType=="user"||this.listType=="digest"){return true}return false},getCollectionForProjectAdmin:function(){if(this.defaults){return false}if(this.listType=="newspage"){return true}return false},getExtrasForCollectionDialog:function(){if(this.getCollectionForProjectAdmin()){return"&proj="+encode_url_parameter(this.projectName)}if(this.getCollectionForUserAdmin()&&this.userId!=this.editingUserId){return"&userid="+this.userId}return null},onChooseCollection:function(b,c,a){closeChooseCollectionDialog=this.__closeChooseCollectionDialog;var d=b;this.sectionStates[this.getCurrentIndex()][this.i_collection]=d;this.setCollection(d);this.makeDirty(null,false)},showBadSection:function(){if(this.badSection>=0){usedefaultchk.checked=false;sections_mod_usedefault();document.fm[this.fieldNamespace+"_sectionselect"].selectedIndex=this.badSection;this.onChooseSection(false)}},applyChanges:function(){if(typeof(applyChanges)=="function"){applyChanges()}else{dialog_apply()}},customOperation:function(a){this.actionField.value=a;document.fm.fb_submit.value=a;document.fm.submit()},onUpgradeAcceptClick:function(){this.makeDirty(null,false);this.customOperation("upgrade")},onApplyTemplateClick:function(){this.makeDirty(null,false);this.customOperation("applytemplate")},onEditSubsectionsClick:function(){if(typeof(closeSubsectionsDialog)=="function"){this.__closeSubsectionsDialog=closeSubsectionsDialog}closeSubsectionsDialog=this.onEditSubsections.bind(this);openDialog("subsectionseditor","modern_relationships_window","","&data="+encode_url_parameter(this.sectionStates[this.getCurrentIndex()][this.i_sub]),DIALOG_FLAG_REUSE_WINDOW)},onEditSubsections:function(a,b){if(this.__closeSubsectionsDialog){closeSubsectionsDialog=this.__closeSubsectionsDialog}this.sectionStates[this.getCurrentIndex()][this.i_sub]=b;this.setSubsectionsCount(a);this.makeDirty("sub",false)},onChangeTemplate:function(){var a=this.templatename2templatedesc[document.fm[this.fieldNamespace+"_template"].options[document.fm[this.fieldNamespace+"_template"].selectedIndex].value];if(a==null){a=""}document.getElementById(this.fieldNamespace+"_template_description").innerHTML=a},promptSectionFromURL:function(){var a=prompt(i18n("sectionlist_fromurl_prompt_message","Type or copy and paste a URL from any Traction view to have the section information filled in automatically")+":",document.fm[this.fieldNamespace+"_cur_sourceurl"].value);if(a){this.syncSectionToURL(a)}},syncSectionToURL:function(e){var o;if(e){o=new Util.URL(e);document.fm[this.fieldNamespace+"_cur_sourceurl"].value=e}else{o=new Util.URL(document.fm[this.fieldNamespace+"_cur_sourceurl"].value)}if(o.path==FORM_ACTION_READ_ONLY||o.path==FORM_ACTION_READ_WRITE){var c=Settings.SectionList.VIEWTYPE2SECTIONTYPE[o.query.params.type];var g=o.query.params.proj;if(g!=null){if((g.indexOf(",")!=-1)||(g.trim()=="")){g=null}else{if(g.indexOf("::")==0){g=g.substring(2)}else{if(g.indexOf(":")==0){g=g.substring(1)}}}}var p=null;if(c!=null){switch(c){case"cat":case"addcatpresent":case"remcatgone":var j=o.query.params.cat;if(j==null){}var a=Traction.Label.parselist(j,g);var h=new Array(a.length);for(var w=0;w0)?b.options[b.selectedIndex].value:"";var a=(c.indexOf("def-val-")!=-1);var g=false;b.options.length=0;if(h.length>0){b.options[0]=new Option(i18n("default_selection_indicator","Default")+" ("+d+")","def-val-"+d);if(a){b.options[0].selected=true;g=true}for(var e=0;eactive."):i18n("setting_project_status_inactive_message","This project is inactive.");var fmt=new MessageFormat(results.active?i18n("setting_project_status_deactivate_project_button_title","Deactivate {0} Project"):i18n("setting_project_status_activate_project_button_title","Activate {0} Project"));buttonValue=fmt.format(document.fm.projectdisplayname.value);document.fm.toggleprojectstatus.value=buttonValue}else{alert(i18n("setting_project_status_unexpected_error_message","The project status could not be changed."))}}};Settings.Project.DraftSupport={activate:function(){var a=new MessageFormat(i18n("setting_project_draftsupport_activate_confirmation_message","You are about to activate the Publish/Draft feature for the '{0}' project. This operation cannot be reversed.\\nAre you sure you want to continue?\\n\\nClick OK to continue.\\nClick Cancel to Abort."));if(!confirm(a.format(document.fm.projectdisplayname.value))){return}document.fm.activatedraftsupport.disabled=true;var b="";b=fm_append(b,"type=ajaxrpc");b=fm_append(b,"method=activateDraftModeSupport");b=fm_append(b,"p0="+document.fm.proj.value);b=fm_append(b,"browserid="+document.fm.browserid.value);xmlpost_async(FORM_ACTION_READ_WRITE,b,document.fm.activatedraftsupport.nextSibling,true,Settings.Project.DraftSupport.activate_wakeup)},activate_wakeup:function(responseText){if(wasUnauthorized(responseText)){failureUnauthorized();document.fm.toggleprojectstatus.disabled=false;return}if(wasUnreachable(responseText)){failureServerUnavailable();document.fm.toggleprojectstatus.disabled=false;return}var error=findErrorAndFeedback(responseText)[0];if(error!=null&&error!=""&&error!="undefined"){document.fm.toggleprojectstatus.disabled=false;alert(error);return}var results;eval("results = "+responseText);if(results.success){document.fm.projectstatus.value=results.active?"true":"false";document.getElementById("draftsupportmessage").innerHTML=i18n("setting_project_draftsupport_active_message","This project supports the Publish/Draft feature.");document.fm.activatedraftsupport.value=i18n("setting_project_draftsupport_activate_disabled_button_title","Draft Support Activated")}else{alert(i18n("setting_project_draftsupport_unexpected_error_message","The Published/Draft Mode feature could not be activated for this project."))}}};Settings.RenameProject={init:function(c,b,a){},onNewNameChange:function(){},onDisplayNameChange:function(){}};Settings.DeleteProject={id:null,name:null,disp:null,init:function(c,b,a){Settings.DeleteProject.id=c;Settings.DeleteProject.name=b;Settings.DeleteProject.disp=a;if(document.fm.confirmchk){document.fm.confirmchk.checked=false;Settings.DeleteProject.onChangeConfirmCheckboxState()}},confirmDeleteRequest:function(){if(document.fm.go.disabled){return false}return confirm("You are about to permanently delete the project "+Settings.DeleteProject.disp+" / "+Settings.DeleteProject.name+" (id "+Settings.DeleteProject.id+").\nThere is no way to undo this operation. All the entries and properties of this project will be deleted.\n\nClick OK to continue.\nClick Cancel to cancel this operation.")},onChangeConfirmCheckboxState:function(){document.fm.go.disabled=!document.fm.confirmchk.checked}};Settings.People={onToggleUserStatus:function(c){var b=c.target;b.disabled=true;var a=this.getRecord(b);var f=a.getData("id");var e=a.getData("username");var d="type=ajaxrpc&method=toggleUserActive&p0="+f+"&p2="+(b.checked?"true":"false")+"&browserid="+document.fm.browserid.value;xmlpost_async(FORM_ACTION_READ_WRITE,d,null,true,Settings.People.onToggleUserStatus_wakeup,b)},onToggleUserStatus_wakeup:function(responseText,elCheckbox){elCheckbox.disabled=false;if(wasUnauthorized(responseText)){failureUnauthorized();elCheckbox.checked=!elCheckbox.checked;return}if(wasUnreachable(responseText)){failureServerUnavailable();elCheckbox.checked=!elCheckbox.checked;return}var error=findErrorAndFeedback(responseText)[0];if(error!=null&&error!=""&&error!="undefined"){alert(error);elCheckbox.checked=!elCheckbox.checked;return}var results;eval("results = "+responseText);if(results.success){}else{elCheckbox.checked=!elCheckbox.checked;alert(results.error)}},onUserDataTablePageRequest:function(){document.fm.search.disabled=true;document.fm.reset.disabled=true;setWaitCursor(true);var a=document.getElementById("nav_throbber");xmlprogress(1,a)},onUserDataTablePageResponse:function(){document.fm.search.disabled=false;document.fm.reset.disabled=false;var a=document.getElementById("nav_throbber");xmlprogress(0,a);setWaitCursor(false)},userNameFormatter:function(b,a,c,d){YAHOO.util.Dom.addClass(b,"username");b.innerHTML=''+a.getData("username")+""},serverAdminFormatter:function(b,a,c,d){YAHOO.util.Dom.addClass(b,"serveradmin");b.innerHTML=(a.getData("serveradmin")=="true")?'':""}};Settings.People.Browser={existingUsers:null,init:function(){var a={dataSourceViewType:"usertable",historyFieldName:"yui-history-field",historyFrameName:"yui-history-frame",containerID:"userlist",filterField:document.fm.filter,statusFilterCheckbox:document.fm.showinactive,searchButton:document.fm.search,resetButton:document.fm.reset,form:document.fm,emptyMsg:i18n("ssetup_people_usertable_no_records_message","No user accounts found."),toggleStatusListener:Settings.People.onToggleUserStatus,requestListener:Settings.People.onUserDataTablePageRequest,responseListener:Settings.People.onUserDataTablePageResponse,defaultSortKey:"username",defaultSortOrder:"asc",defaultRowsPerPage:15,columnDefs:[{key:"username",label:i18n("ssetup_people_usertable_column_heading_username","User Name"),sortable:true,formatter:Settings.People.userNameFormatter},{key:"fullname",label:i18n("ssetup_people_usertable_column_heading_fullname","Full Name"),sortable:true},{key:"email",label:i18n("ssetup_people_usertable_column_heading_email","Email"),sortable:true,formatter:"email"},{key:"serveradmin",label:i18n("ssetup_people_usertable_column_heading_serveradmin","Server Admin"),sortable:true,formatter:Settings.People.serverAdminFormatter},{key:"active",label:i18n("ssetup_people_usertable_column_heading_active","Active"),sortable:true,formatter:YAHOO.widget.DataTable.formatCheckbox}],fields:["username","fullname","email","serveradmin","id","active"]};Settings.People.Browser.existingUsers=new Traction.TabularDataBrowser(a);tabupdate(document.fm.people_tab.value)}};var SPEC={INITIAL_FIELD_STATES:[{name:"newuser",value:""},{name:"newpassword",value:""},{name:"newfirstname",value:""},{name:"newlastname",value:""},{name:"newfullname",value:""},{name:"newemail",value:""},{name:"newaddtogroupid",value:""},{name:"newactivechk",value:true},{name:"newpwchange",value:false},{name:"newwelcome",value:true},{name:"newserverdigests",value:true}],newUsers:null,fm:null,noNewUsersTable:false,hasMoreOptions:true,callback:null,fullNameDirty:false,init:function(b,a,c,e,d){SPEC.fm=a||document.fm;SPEC.noNewUsersTable=c;SPEC.hasMoreOptions=e;SPEC.callback=d;SPEC.initFullNameSyncListeners();SPEC.initFieldStates();SPEC.initNewUsersTable()},reset:function(){SPEC.resetNewUserFields(true)},initFieldStates:function(){for(var a=0;a'+a.getData("name")+""},onDeleteProjectChange:function(){document.fm.server_delete_project_go.disabled=(document.fm.server_delete_project_target.value=="-1")},openProjectDeleteView:function(){Settings.gotoView("deleteproject",true,"&projid="+document.fm.server_delete_project_target.value)}};Settings.Projects.Browser={existingProjects:null,init:function(){var a={dataSourceViewType:"projecttable",historyFieldName:"yui-history-field",historyFrameName:"yui-history-frame",containerID:"projectlist",filterField:document.fm.filter,statusFilterCheckbox:document.fm.showinactive,searchButton:document.fm.search,resetButton:document.fm.reset,form:document.fm,emptyMsg:i18n("ssetup_projects_projecttable_no_records_message","No spaces found."),toggleStatusListener:Settings.Projects.onToggleProjectStatus,requestListener:Settings.Projects.onProjectDataTablePageRequest,responseListener:Settings.Projects.onProjectDataTablePageResponse,defaultSortKey:"name",defaultSortOrder:"asc",defaultRowsPerPage:15,columnDefs:[{key:"name",label:i18n("ssetup_projects_name_col_heading","Name"),sortable:true,formatter:Settings.Projects.projectNameFormatter},{key:"displayname",label:i18n("ssetup_projects_displayname_col_heading","Display Name"),sortable:true},{key:"active",label:i18n("ssetup_projects_active_col_heading","Active"),sortable:true,formatter:YAHOO.widget.DataTable.formatCheckbox}],fields:["name","displayname","mailbox","active","id"]};Settings.Projects.Browser.existingProjects=new Traction.TabularDataBrowser(a);tabupdate(document.fm.projects_tab.value)}};var SPRC={INITIAL_FIELD_STATES:[{name:"newproj_name",value:""},{name:"newproj_displayname",value:""},{name:"newproj_active",value:true}],nameDirty:false,newProjects:null,fm:null,noNewProjectsTable:false,hasMoreOptions:true,callback:null,init:function(b,a,c,e,d){SPRC.fm=a||document.fm;SPRC.noNewProjectsTable=c;SPRC.hasMoreOptions=e;SPRC.callback=d;SPRC.initFieldStates();SPRC.initNewProjectsTable()},reset:function(){SPRC.resetNewProjectFields(true)},initFieldStates:function(){SPRC.nameDirty=false;for(var a=0;a\+\-]+/g;return a.replace(b,"")},createNewProject:function(){var a=document.getElementById("project-settings-edit-true").checked;if(a){SPRC.createNewProjectEditSettings()}else{SPRC.createNewProjectNormal()}},createNewProjectNormal:function(){SPRC.fm.newproj_add.disabled=true;if(trim(SPRC.fm.newproj_name.value)==""){var d=i18n("ssetup_projects_new_project_requires_name_alert_message","Please enter a name for the new project.");if(this.callback){SPRC.fireCallback(this.callback,null,null,d)}else{alert(d)}SPRC.fm.newproj_add.disabled=false;SPRC.fm.newproj_displayname.focus();return}var c=document.getElementById("project-settings-source-project").checked;var b=SPRC.fm.newproj_project.value;if(c){if(b.trim()==""){var d=i18n("ssetup_projects_new_project_copy_requires_project_alert_message","Please enter the name of a project to copy.");if(this.callback){SPRC.fireCallback(this.callback,null,null,d)}else{alert(d)}SPRC.fm.newproj_project.focus();SPRC.fm.newproj_add.disabled=false;return}b="::"+b}var a="";a=fm_append(a,"type=ajaxrpc");a=fm_append(a,"method=createNewProject");a=fm_append(a,"p0="+encode_url_parameter(SPRC.fm.newproj_name.value));a=fm_append(a,"p1="+encode_url_parameter(SPRC.fm.newproj_displayname.value));a=fm_append(a,"p2="+(SPRC.fm.newproj_active.checked?"true":"false"));a=fm_append(a,"p3="+(c?b:currentSelValue(SPRC.fm.newproj_template)));a=fm_append(a,"p4="+currentSelValue(SPRC.fm.newproj_templatelocale));a=fm_append(a,"p5="+(SPRC.fm.newproj_templatesections.checked?"true":"false"));a=fm_append(a,"p6="+(SPRC.fm.newproj_templatepermissions.checked?"true":"false"));a=fm_append(a,"browserid="+encode_url_parameter(SPRC.fm.browserid.value));xmlpost_async(FORM_ACTION_READ_WRITE,a,SPRC.fm.newproj_add.nextSibling,true,SPRC.createNewProjectNormal_wakeup,this.callback)},createNewProjectNormal_wakeup:function(responseText,callback){SPRC.fm.newproj_add.disabled=false;if(wasUnauthorized(responseText)){if(callback!=null){SPRC.fireCallback(callback)}failureUnauthorized();return}if(wasUnreachable(responseText)){if(callback!=null){SPRC.fireCallback(callback)}failureServerUnavailable();return}var message=null;var isError=false;var results=null;var error=findErrorAndFeedback(responseText)[0];if(error!=null&&error!=""&&error!="undefined"){message=error;isError=true}else{eval("results = "+responseText);if(results.success){}else{message=results.error;isError=true}}var msgContainer=document.getElementById("projects-create-project-status");if(msgContainer){var msgDIV=document.createElement("DIV");if(isError){msgDIV.className="error"}else{SPRC.resetNewProjectFields();if(msgContainer.hasChildNodes()){msgContainer.removeChild(msgContainer.firstChild)}}if(msgContainer.hasChildNodes()){msgContainer.removeChild(msgContainer.firstChild)}if(message!=null){msgDIV.appendChild(document.createTextNode(message));msgContainer.appendChild(msgDIV)}}if(!isError){var newProjectsContainer=document.getElementById("newprojectlist");if(newProjectsContainer){newProjectsContainer.style.display="block";if(typeof(results.projectinfo)!="undefined"){SPRC.newProjects.dataWidgets.dataTable.addRow(results.projectinfo)}}}SPRC.fireCallback(callback,responseText,results.projectinfo,isError?message:null)},fireCallback:function(f,c,e,a){if(f){var d={responseText:c,argument:f.argument,error:a,projectinfo:e};var b=e?f.success:f.failure;if(f.scope){b.apply(f.scope,[d])}else{b(d)}return true}else{return false}},createNewProjectEditSettings:function(){var e=document.getElementById("project-settings-source-project").checked;var d=SPRC.fm.newproj_project.value;if(e){if(d.trim()==""){alert("Please enter a project to copy.");SPRC.fm.newproj_project.focus();return}d="::"+d}if(typeof(leavePage)=="function"){if(!leavePage()){return}}var b=(SPRC.fm.h_referer&&SPRC.fm.h_referer.value)?SPRC.fm.h_referer.value:"/traction";var a=FORM_ACTION_READ_ONLY+"?type=newproject";var c="&dir=config/project/templates&fb_submit=Apply&operation=copy&name=newproject.template&stickyparameters=newproj_active,newproj_name,newproj_displayname,newproj_templatelocale,newproj_templatesections,newproj_templatepermissions&source="+(e?d:currentSelValue(SPRC.fm.newproj_template))+"&newproj_active="+(SPRC.fm.newproj_active.checked?"true":"false")+"&newproj_name="+encode_url_parameter(SPRC.fm.newproj_name.value)+"&newproj_displayname="+encode_url_parameter(SPRC.fm.newproj_displayname.value)+((ua("encode_html_entities_in_javascript","false")=="true")?"&":"&")+"copy_locale="+currentSelValue(SPRC.fm.newproj_templatelocale)+"&newproj_templatesections="+(SPRC.fm.newproj_templatesections.checked?"true":"false")+"&newproj_templatepermissions="+(SPRC.fm.newproj_templatepermissions.checked?"true":"false")+"&h_referer="+encode_url_parameter(b)+"&browserid="+SPRC.fm.browserid.value;Settings.gotoView("newproject",false,c)},resetNewProjectFields:function(d){SPRC.nameDirty=false;for(var a=0;a=2)?"":"none"}}};Settings.InternetAddressList=Class.create();Settings.InternetAddressList.prototype={addresses:new Array(),addressRowContainer:null,fieldNamespace:"",field:null,initialize:function(a){this.fieldNamespace=a},init:function(){this.initAddressRows()},setField:function(a){this.field=a;this.field.form[this.fieldNamespace+"_add"].disabled=false},initAddressRows:function(){this.addressRowContainer=document.getElementById(this.fieldNamespace+"_addressrows");this.addEmptyRow(this.addresses.length==0);for(var a=0;a0){c+=","}c+=this.addresses[a].serialize(b);b++}}return c},onPropertyChange:function(c,a){Debug.println("onPropertyChange for ",c,"...");var b=this.addresses[c];b.ip=a.ip.value;b.notes=a.notes.value;Debug.println("Finished updating properties for ",c,": ",b.serialize(""));this.makeDirty()},onRemoveClick:function(b,a){this.addresses[b].removed=true;show_TR(false,a);this.makeDirty()},onAddClick:function(){var b=new Traction.InternetAddress("","",true);var a=this.addresses.length;this.addresses[a]=b;this.addAddressRow(b,a);this.makeDirty()},makeDirty:function(){this.field.value=this.getAddressListSerialization();Debug.println("New field value: ",this.field.name," = ",this.field.value);var a=0;for(var b=0;b0){c+=","}c+=this.matchers[a].serialize(b);b++}}return c},onPropertyChange:function(d,a,b){Debug.println("onPropertyChange for ",d,"...");var c=this.matchers[d];c.header=a.header.value;c.match=a.match.value;c.labelProjectName=a.project.options[a.project.selectedIndex].value;c.labelName=a.label.options[a.label.selectedIndex].value;Debug.println("Finished updating properties for ",d,": ",c.serialize(""));if(b){this.makeDirty()}},onRemoveClick:function(b,a){this.matchers[b].removed=true;show_TR(false,a);this.makeDirty()},onAddClick:function(){var b=new Traction.MailHeaderMatcher("","",this.currentProjectName,"");var a=this.matchers.length;this.matchers[a]=b;this.addMatcherRow(b,a);this.makeDirty()},makeDirty:function(){this.field.value=this.getMatcherListSerialization();Debug.println("New field value: ",this.field.name," = ",this.field.value);var a=0;for(var b=0;b0){c+=","}c+=this.rules[a].serialize(b);b++}}return c},onPropertyChange:function(c,a,b){Debug.println("onPropertyChange for ",c,"...");var d=this.rules[c];d.header=a.header.value;d.regex=a.regex.value;d.project=a.project.value;Debug.println("Finished updating properties for ",c,": ",d.serialize(""));if(b){this.makeDirty()}},onRemoveClick:function(a,b){this.rules[a].removed=true;show_TR(false,b);this.makeDirty()},onAddClick:function(){var b=new Traction.StandardMailEntryRoutingRule("","","");var a=this.rules.length;this.rules[a]=b;this.addRuleRow(b,a);this.makeDirty();this.field.form[this.fieldNamespace+"_"+a+"_header"].focus()},makeDirty:function(){this.field.value=this.getRuleListSerialization();Debug.println("New field value: ",this.field.name," = ",this.field.value);var a=0;for(var b=0;b0){c+=","}c+=this.aliases[a].serialize(b);b++}}return c},getAliasRecipientsSerialization:function(){var b="";for(var a=0;a0){b=document.getElementById(this.getName("preferred",true,0))}if(b==null){for(var a=0;a0){a+=","}a+=trim(this.localAddresses[c]);b++}}document.fm[this.fieldNamespace].value=a;this.toggleEmptyRowDisplay(b==0&&this.externalAddresses.length==0);if(typeof(makeDirty)=="function"){makeDirty()}}};Settings.HiddenTextWithOptionsAndCustom=Class.create();Settings.HiddenTextWithOptionsAndCustom.prototype={fieldNamespace:null,initialize:function(a){this.fieldNamespace=a},getOptionValue:function(){var a=document.fm[this.fieldNamespace+"_options"];return a.options[a.selectedIndex].value},getCustomField:function(){return document.fm[this.fieldNamespace+"_custom"]},getCustomFieldContainer:function(){return document.getElementById(this.fieldNamespace+"_custom_container")},getCustomValue:function(){return this.getCustomField().value},onChangeOption:function(){var c=this.getOptionValue();var a=(c.indexOf("def-val-")==0);this.toggleUseDefault(a);var b=(c=="custom");this.toggleShowCustomField(b);if(b){this.onCustomValueChange();this.getCustomField().focus()}else{if(a){this.setHidden("")}else{this.setHidden(c)}}if(typeof(makeDirty)=="function"){makeDirty()}},toggleUseDefault:function(a){document.fm[this.fieldNamespace+"_usedefault"].value=(a?"true":"false")},toggleShowCustomField:function(a){show_default(a,this.getCustomFieldContainer())},onCustomValueChange:function(){this.setHidden(this.getCustomValue())},setHidden:function(a){document.fm[this.fieldNamespace].value=a}};Settings.TextInputWithSuggestions=Class.create();Settings.TextInputWithSuggestions.prototype={fieldNamespace:null,defaultSuggestion:"",initialize:function(b,a){this.fieldNamespace=b;this.defaultSuggestion=a},getSuggestionSelector:function(){return document.fm[this.fieldNamespace+"_suggestions"]},getSelectedSuggestion:function(){var a=this.getSuggestionSelector();return a.options[a.selectedIndex].value},setValue:function(a){document.fm[this.fieldNamespace].value=a},toggleUseDefault:function(a){document.fm[this.fieldNamespace+"_usedefault"].checked=a},getUseDefault:function(){return document.fm[this.fieldNamespace+"_usedefault"].checked},setTextValue:function(a){document.fm[this.fieldNamespace].value=a},customIsSelected:function(){var a=this.getSuggestionSelector();return(selectIndexOfValue(a,"")==a.selectedIndex)},onChangeSuggestion:function(){if(!this.customIsSelected()){this.setTextValue(this.getSelectedSuggestion())}this.toggleUseDefault(false);this.makeDirty()},selectCustomSuggestion:function(){var a=this.getSuggestionSelector();a.options[selectIndexOfValue(a,"")].selected=true},selectDefaultSuggestion:function(){var b=this.getSuggestionSelector();var a=selectIndexOfValue(b,this.defaultSuggestion);if(a==-1){a=selectIndexOfValue(b,"")}b.options[a].selected=true},onChangeText:function(){this.selectCustomSuggestion();this.toggleUseDefault(false);this.makeDirty()},onToggleUseDefaultCheckbox:function(){if(this.getUseDefault()){this.selectDefaultSuggestion();this.setTextValue(this.getSelectedSuggestion())}this.makeDirty()},makeDirty:function(){if(typeof(makeDirty)=="function"){makeDirty()}}};Settings.JournalSetup.Confirmation={pinger:null,restartEnabled:true,testing:false,progressCallbackHandler:null,onlineText:null,offlineText:null,init:function(a,b){Settings.JournalSetup.Confirmation.restartEnabled=a;Settings.JournalSetup.Confirmation.testing=b},initNormal:function(a,b,c,d){Settings.JournalSetup.Confirmation.init(a,b);Settings.JournalSetup.Confirmation.onlineText=c;Settings.JournalSetup.Confirmation.offlineText=d;if(a){Settings.JournalSetup.Confirmation.startPingingNormal(false)}},initForRecordProcessProgress:function(a,b,c){Settings.JournalSetup.Confirmation.init(b,c);Settings.JournalSetup.Confirmation.progressCallbackHandler=a;if(b){Settings.JournalSetup.Confirmation.startPingingForRecordProcess(false)}},pingSetup:function(a,c,b){Settings.JournalSetup.Confirmation.pinger=new Util.PingServer(c,null,5000,45,true,null,a);setTimeout(function(){Settings.JournalSetup.Confirmation.pinger.start()},b)},startPingingNormal:function(a){Settings.JournalSetup.Confirmation.pingSetup(Settings.JournalSetup.Confirmation.onServerStatusCallbackNormal,document.getElementById("poll-spinner"),a?1:(Settings.JournalSetup.Confirmation.testing?5000:10000))},startPingingForRecordProcess:function(a){Settings.JournalSetup.Confirmation.pingSetup(Settings.JournalSetup.Confirmation.onServerStatusCallbackForRecordProcess,null,a?1:(Settings.JournalSetup.Confirmation.testing?5000:30000))},onServerStatusCallbackNormal:function(b){Settings.JournalSetup.Confirmation.serveronline=b;document.getElementById("next").disabled=false;document.getElementById("next").style.display="";xmlprogress(0,document.getElementById("poll-spinner"));var a=document.getElementById("serverstatetext");a.innerHTML=b?Settings.JournalSetup.Confirmation.onlineText:Settings.JournalSetup.Confirmation.offlineText;if(Settings.JournalSetup.Confirmation.testing){a.innerHTML=a.innerHTML+" (In test mode, you must click the button to continue.)"}else{Settings.JournalSetup.Confirmation.gotoFrontPage()}},onServerStatusCallbackForRecordProcess:function(a){if(!a){alert("The TeamPage server has not come back online yet after a long delay. Please check to make sure that the server started as expected.")}Settings.JournalSetup.Confirmation.enableRequestProgressButton();xmlprogress(0,document.getElementById("progress-request-spinner"));if(a){Settings.JournalSetup.Confirmation.requestProgressReport()}},gotoFrontPage:function(){Settings.gotoView("home",false,"")},confirmOnlineStatus:function(){if(serveronline){return true}return confirm(i18n("jsetup_journal_creation_complete_server_offline_next_link_confirmation_message","We have not yet established that the server is online. Are you sure you would still like to try to navigate to the home page?"))},enableRequestProgressButton:function(){var a=document.getElementById("request-progress-button");a.disabled=false;a.value=Settings.JournalSetup.Confirmation.testing?"Update (test)":"Update"},requestProgressReport:function(){document.getElementById("request-progress-button").disabled=true;var a=FORM_ACTION_RECORD_PROCESSOR+"?type=recprocprogress_&ajax=true";if(Settings.JournalSetup.Confirmation.testing){a+="&test=true"}xmlget_async(a,document.getElementById("progress-request-spinner"),true,Settings.JournalSetup.Confirmation.showProgress,null,0)},setFinished:function(){show_default(false,document.getElementById("request-progress-button"));show_default(true,document.getElementById("go-home-button"))},showProgress:function(c){document.getElementById("request-progress-button").disabled=false;if(wasUnreachable(c)){document.getElementById("progress-message").innerHTML="Server is offline.";return}var b=wasUnauthorized(c);if(!b){var a=findErrorAndFeedback(c)[0];if(a!=null&&a!=""&&a!="undefined"){alert(a);return}}if(b||c=="nodata"){document.getElementById("progress-message").innerHTML=Settings.JournalSetup.Confirmation.progressCallbackHandler.getCompletionMessage();Settings.JournalSetup.Confirmation.setFinished();return}Settings.JournalSetup.Confirmation.fillInProgressReport(c)},fillInProgressReport:function(responseText){var data;eval("data = "+responseText);var progressTotal=0;var total=0;for(var i=0;i')}var a=document.createElement("input");if(b){a.name=b}return a}};