jQuery.AjaxCFC=function(s){if(s.require){jQuery.AjaxCFCHelper.require(s.require);return }s=jQuery.extend({type:"POST",data:null,method:null,contentType:"application/x-www-form-urlencoded",processData:true,async:true,unnamedargs:false,serialization:jQuery.AjaxCFCHelper.getSerialization(),useDefaultErrorHandler:jQuery.AjaxCFCHelper.getUseDefaultErrorHandler(),blockUI:jQuery.AjaxCFCHelper.getBlockUI(),blockMessage:null},s);if(s.blockUI&&typeof jQuery().blockUI=="undefined"){jQuery.AjaxCFCHelper.require("blockUI");return }var data=s.data;s.data={};s.data.engine="jquery";s.data.serialization=s.serialization;s.data["c0-id"]=(Math.floor(Math.random()*10001)+"_"+new Date().getTime()).toString(),s.data.method="__initialize_AjaxCFC";s.data["c0-methodName"]=s.method;s.data["c0-serialization0"]="string";s.data["c0-param0"]=data;var ____success=s.success;s.success=function(data){data=jQuery.AjaxCFCHelper.trim(data);if(data.substring(0,9)=="__json__:"){data=eval("("+data.slice(9)+")")}else{if(data.substring(0,7)=="__js__:"){data=eval(data.slice(7))}else{if(data.substring(0,9)=="__wddx__:"){var oWddx=new WddxDeserializer();data=oWddx.deserialize(data.slice(9))}}}____success(data)};if(s.useDefaultErrorHandler){s.error=function(xml){var displayError=confirm("A critical error has occurred. Press OK to view it or Cancel to discard it");if(displayError){var win=window.open(null,null,"status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=600,width=750");win.document.write(xml.responseText)}}}if(jQuery.AjaxCFCHelper.getDebug()){log.info("invoking method: "+s.method)}if(data){if(s.processData&&s.unnamedargs&&typeof data=="object"&&data instanceof Array){for(var i=0;i<data.length;i++){if(typeof data=="string"){s.data["c0-serialization"+i.toString()]="string";s.data["c0-param"+i.toString()]=data[i]}else{s.data["c0-serialization"+i.toString()]=s.serialization.toLowerCase();s.data["c0-param"+i.toString()]=jQuery.AjaxCFCHelper.serialize(data[i],s.serialization)}if(jQuery.AjaxCFCHelper.getDebug()){log.info("unnamed argument "+i.toString()+": "+s.data["c0-param"+i.toString()])}}}else{if(s.processData&&typeof data!="string"){data=jQuery.AjaxCFCHelper.serialize(data,s.serialization);s.data["c0-serialization0"]=s.serialization.toLowerCase();s.data["c0-param0"]=data}if(jQuery.AjaxCFCHelper.getDebug()){log.info("data: "+data)}}}if(s.blockUI){jQuery().blockUI(s.blockMessage);jQuery().ajaxComplete(function(){jQuery().unblockUI()})}jQuery.ajax(s)};jQuery.AjaxCFCHelper={__debug:false,__blockUI:false,__useDefaultErrorHandler:true,__serialization:"json",include:function(A){document.write("<script");document.write(' language="javascript"');document.write(' type="text/javascript"');document.write(' src="'+A+'">');document.write("<\/script>")},findPath:function(){var A;jQuery("script",document).each(function(){if(this.src.match(/jquery\.AjaxCFC\.js(\?.*)?$/)){A=this.src.replace(/jquery\.AjaxCFC\.js(\?.*)?$/,"")}});return A},require:function(D){var C=D.split(",");var B=this.findPath();for(var A=0;A<C.length;A++){switch(C[A]){case"DWRSyntax":this.include(B+"jquery.AjaxCFC.DWRSyntaxCompatibility.js");break;case"wddx":this.include(B+"wddx.js");this.include(B+"wddxDes.js");break;case"log4j":this.include(B+"log4javascript.js");this.include(B+"log4javascriptSetup.js");break;case"blockUI":this.include(B+"jquery.block.js");break;default:this.include(B+C[A]+".js");break}}},trim:function(A){return A.replace(/^\s*|\s*$/g,"")},serialize:function(C,A){if(A.toLowerCase()=="json"){return JSON.stringify(C)}else{if(A.toLowerCase()=="wddx"){var B=new WddxSerializer();return B.serialize(C)}else{return C}}},setDebug:function(A){this.__debug=A;if(A&&typeof window.log=="undefined"){this.require("log4j")}},getDebug:function(){return this.__debug},setBlockUI:function(A){this.__blockUI=A;if(A&&typeof jQuery().blockUI=="undefined"){this.require("blockUI")}},getBlockUI:function(){return this.__blockUI},setUseDefaultErrorHandler:function(A){this.__useDefaultErrorHandler=A},getUseDefaultErrorHandler:function(){return this.__useDefaultErrorHandler},setSerialization:function(A){this.__serialization=A;if(A=="json"&&typeof window.JSON=="undefined"){this.require("json")}if(A=="wddx"&&typeof window.WddxSerializer=="undefined"){this.require("wddx")}},getSerialization:function(){return this.__serialization}};