var count=1;var updateTrans=0;var waitingTrans=0;var fx=[];var errHTML="<p>Sorry, we are not able to process your request at this time. Please try again shortly, or contact a system administrator if the problem persists.</p>";var redirHTML="<p>Please wait while we forward you...</p>";var submitting={};function updateContentFromAjax(text,contentId,failed){if(text&&$(contentId)){if(failed){var fwd=text.getResponseHeader("X-Forward-Client");if(fwd&&fwd=="true"){var loc=text.getResponseHeader("Location");if(loc){var currError=$(contentId).getElement("#ajaxError");if(currError){currError.setHTML(redirHTML)}else{$(contentId).setHTML("<div id='ajaxError' class='ajaxWaiting message'>"+redirHTML+"</div>")}setTimeout(function(){document.location=loc},1000);return }}var currError=$(contentId).getElement("#ajaxError");if(currError){currError.setHTML(errHTML)}else{$(contentId).setHTML("<div id='ajaxError' class='errors message'>"+errHTML+"</div>"+$(contentId).innerHTML)}var scripts=$ES("script",$(contentId).innerHTML);for(id in scripts){if(scripts[id].innerHTML){eval(scripts[id].innerHTML)}}}else{$(contentId).setHTML("<a id='update"+count+"'></a>"+text);var scripts=$ES("script",text);for(id in scripts){if(scripts[id].innerHTML){eval(scripts[id].innerHTML)}}var docloc=document.location.toString().replace(/#update\d+/,"");document.location=docloc+"#update"+count;count++}}}function setContentUpdateTransition(A){if(!A){var A=1}switch(A){case 1:case 2:updateTrans=A;break;default:updateTrans=0}}function setWaitingUpdateTransition(A){if(!A){var A=1}switch(A){case 1:case 3:waitingTrans=A;break;default:updateTrans=0}}function transitionContent(B,D,A){var C=$(D);if(C){switch(B){case 1:if(A){fx[D]=new Fx.Style(C,"opacity",{wait:false}).start(1,0)}else{fx[D]=new Fx.Style(C,"opacity",{wait:false}).start(0,1)}break;case 2:if(!fx[D]){fx[D]=new Fx.Slide(C,{mode:"horizontal",duration:300})}else{fx[D].stop()}if(A){fx[D].slideOut()}else{fx[D].slideIn()}break;case 3:if(!fx[D]){fx[D]=new Fx.Slide(C,{duration:300})}else{fx[D].stop()}if(A){fx[D].slideOut()}else{fx[D].slideIn()}break;default:if(A){C.setStyle("display","none")}else{C.setStyle("display","block")}}}}function sendForm(E,B,D,A,F){if(!$(E)||submitting.formId){return }submitting.formId=true;var C={evalScripts:true};if(B){C.update=$(B);$(B).setStyle("display","none")}C.onComplete=function(G){submitting.formId=false;transitionContent(updateTrans,F,false);if(D){transitionContent(waitingTrans,D,true)}if(typeof A=="string"){setTimeout(A,1)}else{A.call(this,G,F)}};C.onFailure=function(G){submitting.formId=false;transitionContent(updateTrans,F,false);if(D){transitionContent(waitingTrans,D,true)}if(typeof A!="string"){A.call(this,G,F,true)}};transitionContent(updateTrans,F,true);if(D){if($(D)&&$(D).getStyle("display","none")){$(D).setStyle("display","block")}transitionContent(waitingTrans,D,false)}$(E).send(C)};
