var Fluxion={version:20121210,doAjax:function(a,f,h,e){e||(e={"":""});h||(h={"":""});var d="ajax.web";h.url&&""!=h.url&&(d=h.url);d=new Fluxion.Ajax.newAjax(d);return e.passthrough?(d.doAjax(a,f,h,e),d.getPassthroughResponse()):e.ajaxType&&"periodical"==e.ajaxType?(d.doAjax(a,f,h,e),d.getProgressUpdater()):d.doAjax(a,f,h,e)},doAjaxUpload:function(a,f,h,e,d,k){d||(d={"":""});e||(e={"":""});k||(k={"":""});var b="ajax.web";e.url&&""!=e.url&&(b=e.url);return(new Fluxion.Ajax.newAjaxUpload(b,a)).doAjaxUpload(f,
h,e,d,k)},Ajax:{}};
Fluxion.Ajax.newAjax=function(a){var f=this;f.passthrough={};f.pu=null;this.getProgressUpdater=function(){return f.pu};this.getPassthroughResponse=function(){return f.passthrough.response};var h=function(a){a.error?clientParams&&clientParams.alertError&&alert("Error: "+decodeResponse(a.error)):f.passthrough.response=a.response?decodeResponse(a.response):decodeEncodedJSON(a)};this.doAjax=function(e,d,k,b){if(b&&b.ajaxType&&"periodical"==b.ajaxType){var l="FRAME-"+Math.floor(99999*Math.random()),i=
document.createElement("iframe");i.setAttribute("id",l);i.setAttribute("name",l);i.setAttribute("src","");i.setAttribute("style","width:0;height:0;visibility:hidden;");i.style.cssText="width:0;height:0;visibility:hidden;";document.getElementsByTagName("body")[0].appendChild(i);var q=i=1;b.updateFrequency&&(i=b.updateFrequency);b.updateDecay&&(q=b.updateDecay);f.pu=new Ajax.PeriodicalUpdater(l,a,{method:"post",postBody:"servicename="+e+"&action="+d+"&params="+encodeURIComponent(JSON.stringify(k)),
onLoading:function(){b.doOnLoading&&processJavascript(b.doOnLoading)},onSuccess:function(j){j=JSON.parse(j.responseText);if(b.passthrough)h(j);else if(j.error)if(f.pu.stop(),b&&b.doOnError)if("[object Array]"===Object.prototype.toString.apply(b.doOnError)){if(1==b.doOnError.length){var a=b.doOnError[0];return a(decodeEncodedJSON(j))}for(var c=0;c<b.doOnError.length;c++)a=b.doOnError[c],a(decodeEncodedJSON(j))}else return b.doOnError(decodeEncodedJSON(j));else alert("Error: "+j.error);else if(j.sessiontimeout)confirm("Your session has expired.")&&
window.location.reload(!0);else{j.stopUpdater&&f.pu.stop();b.updateElement&&(j.response=decodeResponse(j.response),b&&b.updateElement&&processOutputJSON(b.updateElement,j.response));if(j.doOnSuccess)if("[object Array]"===Object.prototype.toString.apply(j.doOnSuccess)){a=j.doOnSuccess;for(c=0;c<a.length;c++)processJavascript(a[c])}else processJavascript(j.doOnSuccess);if(b.doOnSuccess)if("[object Array]"===Object.prototype.toString.apply(b.doOnSuccess)){if(1==b.doOnSuccess.length)return a=b.doOnSuccess[0],
a(decodeEncodedJSON(j));for(c=0;c<b.doOnSuccess.length;c++)a=b.doOnSuccess[c],a(decodeEncodedJSON(j))}else return b.doOnSuccess(decodeEncodedJSON(j))}},frequency:i,decay:q,onFailure:errFunc})}else new Ajax.Request(a,{method:"post",postBody:"servicename="+e+"&action="+d+"&params="+encodeURIComponent(JSON.stringify(k)),onLoading:function(){b&&b.doOnLoading&&b.doOnLoading()},onSuccess:function(a){a=JSON.parse(a.responseText);if(b&&b.passthrough)h(a);else if(a.error)if(b&&b.doOnError)if("[object Array]"===
Object.prototype.toString.apply(b.doOnError)){if(1==b.doOnError.length){var m=b.doOnError[0];return m(decodeEncodedJSON(a))}for(var c=0;c<b.doOnError.length;c++)m=b.doOnError[c],m(decodeEncodedJSON(a))}else return b.doOnError(decodeEncodedJSON(a));else alert("Error: "+decodeResponse(a.error));else if(a.sessiontimeout)confirm("Your session has expired.")&&window.location.reload(!0);else{b&&b.updateElement&&a.response&&processOutputJSON(b.updateElement,decodeResponse(a.response));if(a.doOnSuccess)if("[object Array]"===
Object.prototype.toString.apply(a.doOnSuccess)){m=a.doOnSuccess;for(c=0;c<m.length;c++)processJavascript(m[c])}else processJavascript(a.doOnSuccess);if(b&&b.doOnSuccess)if("[object Array]"===Object.prototype.toString.apply(b.doOnSuccess)){if(1==b.doOnSuccess.length)return m=b.doOnSuccess[0],m(decodeEncodedJSON(a));for(c=0;c<b.doOnSuccess.length;c++)m=b.doOnSuccess[c],m(decodeEncodedJSON(a))}else return b.doOnSuccess(decodeEncodedJSON(a))}},onFailure:errFunc})}};
var decodeResponse=function(a){-1<a.indexOf("+")&&(a=a.replace(/\+/g,"%20"));a=a.replace(/'/g,"'").replace(/"/g,'"');return decodeURIComponent(a)},decodeEncodedJSON=function(a){var f={},h;for(h in a)a.hasOwnProperty(h)&&(f[h]="string"===typeof a[h]?decodeResponse(a[h]):a[h]);return f},processJavascript=function(a){("<script>"+a+"<\/script>").evalScripts()},processOutputJSON=function(a,f){$(a).innerHTML=f},errFunc=function(a){alert("Error "+a.status+" -- "+a.statusText)};
Fluxion.Ajax.newAjaxUpload=function(a,f){var h=!1,e,d={},k="CONTAINER-"+Math.floor(99999*Math.random()),b="FRAME-"+Math.floor(99999*Math.random()),l=null,i=null;$(f).setAttribute("target",b);l=document.createElement("div");l.setAttribute("id",k);i=document.createElement("iframe");i.setAttribute("id",b);i.setAttribute("name",b);i.setAttribute("src","");i.setAttribute("style","width:0;height:0;visibility:hidden;");i.style.cssText="width:0;height:0;visibility:hidden;";l.appendChild(i);$(f).appendChild(l);
frames[b].id||(frames[b].id=b);frames[b].name||(frames[b].name=b);this.doAjaxUpload=function(f,j,m,c){e=new Ajax.PeriodicalUpdater(c.progressElement,a,{asynchronous:!0,onSuccess:function(a){d=JSON.parse(a.responseText);null!=d.error?alert("Error: "+d.error):h||(a=0,d.bytes_read&&d.content_length&&(a=100*(d.bytes_read/d.content_length)),100!=a?$(c.statusElement).innerHTML="Uploading: "+a+"% complete...<br/>":($(c.statusElement).innerHTML="Upload complete<br/>",new Effect.Highlight($(c.statusElement)),
e.stop(),h=!0))},onComplete:function(){d.frameId=b;d.doOnSuccess&&(i.onload="[object Array]"===Object.prototype.toString.apply(d.doOnSuccess)?function(a){for(var b=0;b<a.length;b++)processJavascript(a[b])}:processJavascript(d.doOnSuccess));c&&c.doOnSuccess&&("[object Array]"===Object.prototype.toString.apply(c.doOnSuccess)?i.onload=function(a,b){for(var c=0;c<a.doOnSuccess.length;c++){var j=a.doOnSuccess[c];b.response="OK";j(decodeEncodedJSON(b))}}:(d.response="OK",i.onload=c.doOnSuccess(decodeEncodedJSON(d))))},
frequency:1,method:"post",postBody:"servicename="+f+"&action="+j+"&params="+encodeURIComponent(JSON.stringify(m)),onFailure:errFunc})}};var doValidation=function(a){return(new Fluxion.Ajax.newAjax("ajax.web")).doAjax(a.validationBeanId,"validate",a,null)},JSON=JSON||{};
(function(){function a(a){return 10>a?"0"+a:a}function f(a){d.lastIndex=0;return d.test(a)?'"'+a.replace(d,function(a){var b=l[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function h(a,j){var d,c,e,l,p=k,n,g=j[a];g&&("object"===typeof g&&"function"===typeof g.toJSON)&&(g=g.toJSON(a));"function"===typeof i&&(g=i.call(j,a,g));switch(typeof g){case "string":return f(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);
case "object":if(!g)return"null";k+=b;n=[];if("[object Array]"===Object.prototype.toString.apply(g)){l=g.length;for(d=0;d<l;d+=1)n[d]=h(d,g)||"null";e=0===n.length?"[]":k?"[\n"+k+n.join(",\n"+k)+"\n"+p+"]":"["+n.join(",")+"]";k=p;return e}if(i&&"object"===typeof i){l=i.length;for(d=0;d<l;d+=1)c=i[d],"string"===typeof c&&(e=h(c,g))&&n.push(f(c)+(k?": ":":")+e)}else for(c in g)Object.hasOwnProperty.call(g,c)&&(e=h(c,g))&&n.push(f(c)+(k?": ":":")+e);e=0===n.length?"{}":k?"{\n"+k+n.join(",\n"+k)+"\n"+
p+"}":"{"+n.join(",")+"}";k=p;return e}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,k,b,l={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,d,e){var c;b=k="";if("number"===typeof e)for(c=0;c<e;c+=1)b+=" ";else"string"===typeof e&&(b=e);if((i=d)&&"function"!==typeof d&&("object"!==typeof d||"number"!==typeof d.length))throw Error("JSON.stringify");return h("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function d(a,c){var e,f,g=a[c];if(g&&"object"===typeof g)for(e in g)Object.hasOwnProperty.call(g,e)&&(f=d(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,c,g)}var c;e.lastIndex=0;e.test(a)&&(a=a.replace(e,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,
"")))return c=eval("("+a+")"),"function"===typeof b?d({"":c},""):c;throw new SyntaxError("JSON.parse");})})();String.prototype.trim=function(){var a;a=this.replace(/^\s*(.*)/,"$1");return a=a.replace(/(.*?)\s*$/,"$1")};