var proxies=new Object();proxies.current=null;proxies.xmlhttp=null;var ajax=new Object();ajax.current=null;ajax.option=null;ajax.queue=new Array();ajax.options=new Array();ajax.timer=null;ajax.Start=function(B,A){ajax.Add(B,A);if((ajax.current==null)&&(ajax.timer==null)){ajax._next(false)}};ajax.Add=function(B,A){if(B==null){alert("ajax.Start: Argument action must be set.");return }else{if((B.queueClear!=null)&&(B.queueClear==true)){ajax.queue=new Array();ajax.options=new Array()}else{if((ajax.queue.length>0)&&((B.queueMultiple==null)||(B.queueMultiple==false))){if((ajax.timer!=null)&&(ajax.queue[0]==B)){window.clearTimeout(ajax.timer);ajax.timer=null}var C=0;while(C<ajax.queue.length){if(ajax.queue[C]==B){ajax.queue.splice(C,1);ajax.options.splice(C,1)}else{C++}}}}}if((B.queueTop==null)||(B.queueTop==false)){ajax.queue.push(B);ajax.options.push(A)}else{ajax.queue.unshift(B);ajax.options.unshift(A)}};ajax._next=function(D){var A=null;var E=null;var C=null;if(ajax.current!=null){return }if(ajax.timer!=null){return }if(ajax.queue.length==0){return }A=ajax.queue[0];E=ajax.options[0];if((D==true)||(!A.delay)||(A.delay==0)){ajax.current=A;ajax.queue.shift();ajax.option=E;ajax.options.shift();if(A.prepare!=null){try{C=A.prepare(E)}catch(B){}}if(A.call==null){ajax.Finsh(C)}else{A.call.func=ajax.Finsh;A.call.onException=ajax.Exception;A.call(C);if(A.timeout!=null){ajax.timer=window.setTimeout(ajax.Cancel,A.timeout*1000)}}}else{ajax.timer=window.setTimeout(ajax.EndWait,A.delay)}};ajax.EndWait=function(){ajax.timer=null;ajax._next(true)};ajax.Cancel=function(){proxies.cancel(false);ajax.timer=null;ajax.current=null;ajax.option=null;window.setTimeout(ajax._next,200)};ajax.Finsh=function(B){if(ajax.timer!=null){window.clearTimeout(ajax.timer);ajax.timer=null}try{if((ajax.current!=null)&&(ajax.current.finish!=null)){ajax.current.finish(B,ajax.option)}}catch(A){}ajax.current=null;ajax.option=null;ajax._next(false)};ajax.Exception=function(A){if(ajax.current.onException!=null){ajax.current.onException(A,ajax.option)}ajax.current=null;ajax.option=null};ajax.CancelAll=function(){ajax.Cancel();ajax.queue=new Array();ajax.options=new Array()};proxies.callSoap=function(I){var A=I.callee;var J=null;if(A._cache!=null){if((A.params.length==1)&&(I.length==1)&&(A._cache[I[0]]!=null)){if(A.func!=null){A.func(A._cache[I[0]]);return(null)}else{return(A._cache[I[0]])}}else{A._cachekey=I[0]}}proxies.current=A;try{J=new ActiveXObject("Msxml2.XMLHTTP")}catch(H){}if(J==null){try{J=new ActiveXObject("Microsoft.XMLHTTP")}catch(H){}}if((J==null)&&(typeof (XMLHttpRequest)!="undefined")){J=new XMLHttpRequest()}proxies.xmlhttp=J;var F="<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><"+A.fname+" xmlns='"+A.service.ns+"'>";for(n=0;(n<A.params.length)&&(n<I.length);n++){var D=I[n];var E=A.params[n].split(":");if((E.length==1)||(E[1]=="string")){D=String(I[n]).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else{if(E[1]=="int"){D=parseInt(I[n])}else{if(E[1]=="float"){D=parseFloat(I[n])}else{if((E[1]=="x")&&(typeof (I[n])=="string")){D=I[n]}else{if((E[1]=="x")&&(typeof (XMLSerializer)!="undefined")){D=(new XMLSerializer()).serializeToString(I[n].firstChild)}else{if(E[1]=="x"){D=I[n].xml}else{if((E[1]=="bool")&&(typeof (I[n])=="string")){D=I[n].toLowerCase()}else{if(E[1]=="bool"){D=String(I[n]).toLowerCase()}else{if(E[1]=="date"){var K,G;G=String(D.getFullYear());G+="-";K=String(D.getMonth()+1);G+=(K.length==1?"0"+K:K);G+="-";K=String(D.getDate()+1);G+=(K.length==1?"0"+K:K);G+="T";K=String(D.getHours()+1);G+=(K.length==1?"0"+K:K);G+=":";K=String(D.getMinutes()+1);G+=(K.length==1?"0"+K:K);G+=":";K=String(D.getSeconds()+1);G+=(K.length==1?"0"+K:K);D=G}}}}}}}}}F+="<"+E[0]+">"+D+"</"+E[0]+">"}F+="</"+A.fname+"></soap:Body></soap:Envelope>";var C=iFactor.StormCenter.RequestParameters;if(C==null){iFactor.StormCenter.RequestParameters={};C=iFactor.StormCenter.RequestParameters}var B=C.webServicesProxyUrl;if((B!=null)&&(B!="")){J.open("POST",B,(A.func!=null));J.setRequestHeader("Content-Type","application/x-www-form-urlencoded");F=encodeURI("url="+A.service.url+"&soapmessage="+F);F=F.replace(/\+/g,"%2B")}else{J.open("POST",A.service.url,(A.func!=null));J.setRequestHeader("Content-Type","text/xml; charset=utf-8")}J.setRequestHeader("SOAPAction",A.action);if(A.corefunc!=null){J.onreadystatechange=A.corefunc;J.send(F)}else{if(A.func!=null){J.onreadystatechange=proxies._response;J.send(F)}else{J.send(F);return(proxies._response())}}};proxies.cancel=function(B){var C=proxies.current;var A=proxies.xmlhttp;if(B==null){B==true}if(proxies.xmlhttp!=null){proxies.xmlhttp.onreadystatechange=function(){};proxies.xmlhttp.abort();if(B&&(proxies.current.onException!=null)){proxies.current.onException("WebService call was canceled.")}proxies.current=null;proxies.xmlhttp=null}};proxies.EnableCache=function(A){A._cache=new Object()};proxies.IsActive=function(){return(proxies.xmlhttp!=null)};proxies._response=function(){var F=null;var I=proxies.xmlhttp;var D=proxies.current;if(D!=null){var H=D.rtype[0].split(":");if((I!=null)&&(I.readyState==4)){if(I.status==200){var B=I.responseXML.getElementsByTagName(H[0])[0];if((B==null)||(B.firstChild==null)){F=null}else{if((H.length==1)||(H[1]=="string")){F=(B.textContent?B.textContent:B.text)}else{if(H[1]=="bool"){F=((B.textContent?B.textContent:B.text).toLowerCase()=="true")}else{if(H[1]=="int"){F=parseInt(B.textContent?B.textContent:B.text)}else{if(H[1]=="float"){F=parseFloat(B.textContent?B.textContent:B.text)}else{if((H[1]=="xmlDoc")&&(typeof (XMLSerializer)!="undefined")){var G=null;if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){G=new Number(RegExp.$1)}if(G==9){F=B.firstChild.xml}else{F=(new XMLSerializer()).serializeToString(B.firstChild)}F=ajax._getXMLDOM(F)}else{if(H[1]=="xmlDoc"){F=B.firstChild.xml;F=ajax._getXMLDOM(F)}else{if((H[1]=="other")&&(typeof (XMLSerializer)!="undefined")){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){G=new Number(RegExp.$1)}if(G==9){F=B.xml}else{F=(new XMLSerializer()).serializeToString(B)}F=ajax._getXMLDOM(F)}else{if(H[1]=="other"){F=B.xml;F=ajax._getXMLDOM(F)}else{if(H[1]=="ArrayOfString"){F=[];var A;var K=B.childNodes;var J=K.length;for(var E=0;E<J;E=E+1){A=K[E];F.push(A.textContent?A.textContent:A.text)}}else{F=(B.textContent?B.textContent:B.text)}}}}}}}}}}if((D._cache!=null)&&(D._cachekey!=null)){D._cache[D._cachekey]=F;D._cachekey=null}proxies.xmlhttp=null;proxies.current=null;if(D.func==null){return(F)}else{D.func(F);return(null)}}else{if(proxies.current.onException==null){}else{F=new Error();if(I.status==404){F.message="The webservice could not be found."}else{if(I.status==500){F.name="SoapException";var C=I.responseXML.documentElement.firstChild.firstChild.firstChild;while(C!=null){if(C.nodeName=="faultcode"){F.message=C.firstChild.nodeValue}if(C.nodeName=="faultstring"){F.description=C.firstChild.nodeValue}C=C.nextSibling}}else{if((I.status==502)||(I.status==12031)){F.message="The server could not be found."}else{F.message="Result-Status:"+I.status+"\n"+I.responseText}}}proxies.current.onException(F)}}proxies.xmlhttp=null;proxies.current=null}}};proxies.alertResult=function(){var A=proxies.xmlhttp;if(A.readyState==4){if(A.status==200){if(A.responseXML.documentElement.firstChild.firstChild.firstChild==null){alert("(no result)")}else{alert(A.responseXML.documentElement.firstChild.firstChild.firstChild.firstChild.nodeValue)}}else{if(A.status==404){alert("Error!\n\nThe webservice could not be found.")}else{if(A.status==500){var B=new Error();B.name="SoapException";var C=A.responseXML.documentElement.firstChild.firstChild.firstChild;while(C!=null){if(C.nodeName=="faultcode"){B.message=C.firstChild.nodeValue}if(C.nodeName=="faultstring"){B.description=C.firstChild.nodeValue}C=C.nextSibling}alert("The server threw an exception.\n\n"+B.message+"\n\n"+B.description)}else{if(A.status==502){alert("Error!\n\nThe server could not be found.")}else{alert("Result-Status:"+A.status+"\n"+A.responseText)}}}}proxies.xmlhttp=null;proxies.current=null}};proxies.alertResponseText=function(){if(proxies.xmlhttp.readyState==4){alert("Status:"+proxies.xmlhttp.status+"\nRESULT:"+proxies.xmlhttp.responseText)}};proxies.alertException=function(A){var B="Exception:\n\n";if(A.constructor==String){B=A}else{if((A.name!=null)&&(A.name!="")){B+="Type: "+A.name+"\n\n"}if((A.message!=null)&&(A.message!="")){B+="Message:\n"+A.message+"\n\n"}if((A.description!=null)&&(A.description!="")&&(A.message!=A.description)){B+="Description:\n"+A.description+"\n\n"}}alert(B)};ajax._getXMLDOM=function(A){var C=null;if((document.implementation!=null)&&(typeof document.implementation.createDocument=="function")){var D=new DOMParser();C=D.parseFromString(A,"text/xml")}else{try{C=new ActiveXObject("MSXML2.DOMDocument")}catch(B){}if(C==null){try{C=new ActiveXObject("Microsoft.XMLDOM")}catch(B){}}if(C!=null){C.async=false;C.validateOnParse=false}C.loadXML(A)}return(C)};function inspectObj(C){var A="InspectObj:";if(C==null){A="(null)";alert(A);return }else{if(C.constructor==String){A='"'+C+'"'}else{if(C.constructor==Array){A+=" _ARRAY"}else{if(typeof (C)=="function"){A+=" [function]"+C}else{if((typeof (XMLSerializer)!="undefined")&&(C.constructor==XMLDocument)){A="[XMLDocument]:\n"+(new XMLSerializer()).serializeToString(C.firstChild);alert(A);return }else{if((C.constructor==null)&&(typeof (C)=="object")&&(C.xml!=null)){A="[XML]:\n"+C.xml;alert(A);return }}}}}}for(p in C){try{if(C[p]==null){A+="\n"+String(p)+" (...)"}else{if(typeof (C[p])=="function"){A+="\n"+String(p)+" [function]"}else{if(C[p].constructor==Array){A+="\n"+String(p)+" [ARRAY]: "+C[p];for(n=0;n<C[p].length;n++){A+="\n  "+n+": "+C[p][n]}}else{A+="\n"+String(p)+" ["+typeof (C[p])+"]: "+C[p]}}}}catch(B){A+=B}}alert(A)};
