var processingImgId="i-processing-feedback";function ajaxCall(ajaxUrl,paramString){if(isdefined("isFeedbackStarted")&&!isFeedbackStarted()&&$(processingImgId)){showProgressImage()}resetDeferred();new Ajax.Request(ajaxUrl,{parameters:paramString,onSuccess:ajaxResponseDOMUpdate,onFailure:ajaxResponseFailure,asynchronous:true});return false}function ajaxResponseFailure(response){if($(processingImgId)){Element.hide(processingImgId)}alert("Request failed. Error sent back: >>"+response.responseText+"<<")}function ajaxResponseDOMUpdate(response){if(isdefined("stopFeedback")){stopFeedback()}if($(processingImgId)){Element.hide(processingImgId)}try{ckeditorCleanAll()}catch(e){}var objDom=new XMLDoc(response.responseText,xmlErrorHandler);var operationStatus=objDom.selectNode("/status").getText();if(operationStatus=="success"){var sectionListEl=objDom.selectNode("/sectionList");var sectionList=sectionListEl.getElements("section");for(var idx=0;idx<sectionList.length;idx++){var oneSection=sectionList[idx];var sectionId=oneSection.getAttribute("id");var sectionText=oneSection.getText();if(sectionId=="alert"){alert(sectionText)}else{var frameId=oneSection.getAttribute("frameid");if(frameId){var frameDocument=document;if(frameId=="parent"){if(parent){frameDocument=parent.document}}else{frameDocument=window.frames[Number(frameId)].document}oneSection=frameDocument.getElementById(sectionId);Element.update(oneSection,sectionText)}else{if($(sectionId)){Element.update($(sectionId),sectionText)}}}}setupAdminPage();runDeferred()}else{if(operationStatus=="redirect"){var location=objDom.selectNode("/location").getText();if(location.length==0){alert("Redirect location not specified.")}window.location=location}else{var errorMsg=objDom.selectNode("/text").getText();if(isdefined("stopFeedback")){stopFeedback()}if($("dialog-operation-error")&&$("dialog-operation-error-msg")&&showDialog){$("dialog-operation-error-msg").innerHTML=errorMsg;showDialog("dialog-operation-error")}else{alert("Operation failed, error: "+errorMsg)}}}}function xmlErrorHandler(oneError){nothing.nowherse=oneError;alert("XML parsing error: "+oneError);sleep(23)}function showProgressImage(){var ref=processingImgId;$(ref).style.left=getWindowWidthCenter($(ref).getWidth());$(ref).style.top=getWindowHeightCenter($(ref).getHeight());$(ref).show()}function getWindowWidthCenter(w){Position.prepare();return(parseInt(document.documentElement.clientWidth-w)/2)+Position.deltaX+"px"}function getWindowWidthCenterInt(w){Position.prepare();return(parseInt(document.documentElement.clientWidth-w)/2)+Position.deltaX}function getWindowHeightCenter(h){Position.prepare();return(parseInt(document.documentElement.clientHeight-h)/2)+Position.deltaY+"px"}function getWindowHeightCenterInt(h){Position.prepare();return(parseInt(document.documentElement.clientHeight-h)/2)+Position.deltaY}function getWidthCenter(w){Position.prepare();return(parseInt(document.documentElement.clientWidth-w)/2)+Position.deltaX+"px"}function getHeightCenter(h){Position.prepare();return(parseInt(document.documentElement.clientHeight-h)/2)+Position.deltaY+"px"}function escapeHTML(origString){return origString.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function xmlError(oneError){nothing.nowherse=oneError;alert("XML parsing error: "+oneError);sleep(23)}function isdefined(variable){return(typeof(window[variable])=="undefined")?false:true}function prefetchImage(url){var im=new Image();im.src=url};
