function htmldb_Get(d,b,h,f,j,g,a){this.obj=$x(d);this.proc=g!=null?g:"wwv_flow.show";this.flow=b!=null?b:$x("pFlowId").value;this.request=h!=null?h:"";this.page=f;this.params="";this.response="";this.base=null;this.queryString=a!=null?a:null;this.syncMode=false;this.addParam=htmldb_Get_addParam;this.add=htmldb_Get_addItem;this.getPartial=htmldb_Get_trimPartialPage;this.getFull=htmldb_Get_fullReturn;this.get=htmldb_Get_getData;this.url=htmldb_Get_getUrl;this.escape=htmldb_Get_escape;this.clear=htmldb_Get_clear;this.sync=htmldb_Get_sync;this.setNode=i;this.replaceNode=e;var k=window.location.href.indexOf("?")>0?window.location.href.substring(0,window.location.href.indexOf("?")):window.location.href;this.base=k.substring(0,k.lastIndexOf("/"));if(this.proc==null||this.proc==""){this.proc=k.substring(k.lastIndexOf("/")+1)}this.base=this.base+"/"+this.proc;if(j==null||j==""){var c=document.getElementById("pInstance");if(typeof(c)=="object"){this.instance=c.value}}else{this.instance=j}if(!a){this.addParam("p_request",this.request);this.addParam("p_instance",this.instance);this.addParam("p_flow_id",this.flow);this.addParam("p_flow_step_id",this.page)}function i(l){this.node=html_GetElement(l)}function e(m){var l=0;for(l=this.node.childNodes.length-1;l>=0;l--){this.node.removeChild(this.node.childNodes[l])}this.node.appendChild(m)}}function htmldb_Get_sync(a){this.syncMode=a}function htmldb_Get_clear(a){this.addParam("p_clear_cache",a)}function htmldb_Get_getUrl(){return this.queryString==null?this.base+"?"+this.params:this.queryString}function htmldb_Get_escape(a){a=a+"";a=a.replace(/\%/g,"%25");a=a.replace(/\+/g,"%2B");a=a.replace(/\ /g,"%20");a=a.replace(/\./g,"%2E");a=a.replace(/\*/g,"%2A");a=a.replace(/\?/g,"%3F");a=a.replace(/\\/g,"%5C");a=a.replace(/\//g,"%2F");a=a.replace(/\>/g,"%3E");a=a.replace(/\</g,"%3C");a=a.replace(/\{/g,"%7B");a=a.replace(/\}/g,"%7D");a=a.replace(/\~/g,"%7E");a=a.replace(/\[/g,"%5B");a=a.replace(/\]/g,"%5D");a=a.replace(/\`/g,"%60");a=a.replace(/\;/g,"%3B");a=a.replace(/\?/g,"%3F");a=a.replace(/\@/g,"%40");a=a.replace(/\&/g,"%26");a=a.replace(/\#/g,"%23");a=a.replace(/\|/g,"%7C");a=a.replace(/\^/g,"%5E");a=a.replace(/\:/g,"%3A");a=a.replace(/\=/g,"%3D");a=a.replace(/\$/g,"%24");return a}function htmldb_Get_addParam(a,b){if(this.params==""){this.params=a+"="+(b!=null?this.escape(b):"")}else{this.params=this.params+"&"+a+"="+(b!=null?this.escape(b):"")}return}function htmldb_Get_addItem(a,b){this.addParam("p_arg_names",a);this.addParam("p_arg_values",b)}function htmldb_Get_trimPartialPage(d,c,f){setTimeout(html_processing,1);if(f){this.obj=$x(f)}if(!d){d="<!--START-->"}if(!c){c="<!--END-->"}var g=this.response.indexOf(d);var b;if(g>0){this.response=this.response.substring(g+d.length);var a=this.response.indexOf(c);this.response=this.response.substring(0,a)}if(this.obj){if(this.obj.nodeName=="INPUT"){if(document.all){gResult=this.response;gNode=this.obj;var e="htmldb_get_WriteResult()";setTimeout(e,100)}else{this.obj.value=this.response}}else{if(document.all){gResult=this.response;gNode=this.obj;var e="htmldb_get_WriteResult()";setTimeout(e,100)}else{this.obj.innerHTML=this.response}}}setTimeout(html_Doneprocessing,1);return this.response}var gResult=null;var gNode=null;function htmldb_get_WriteResult(){if(gNode&&(gNode.nodeName=="INPUT"||gNode.nodeName=="TEXTAREA")){gNode.value=gResult}else{gNode.innerHTML=gResult}gResult=null;gNode=null;return}function htmldb_Get_fullReturn(b){setTimeout(html_processing,1);if(b){this.obj=html_GetElement(b)}if(this.obj){if(this.obj.nodeName=="INPUT"){this.obj.value=this.response}else{if(document.all){gResult=this.response;gNode=this.obj;var a="htmldb_get_WriteResult()";setTimeout(a,10)}else{this.obj.innerHTML=this.response}}}setTimeout(html_Doneprocessing,1);return this.response}function htmldb_Get_getData(g,b,a){html_processing();var f;try{f=new XMLHttpRequest()}catch(d){f=new ActiveXObject("Msxml2.XMLHTTP")}try{var c=new Date();f.open("POST",this.base,this.syncMode);f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");f.send(this.queryString==null?this.params:this.queryString);this.response=f.responseText;if(this.node){this.replaceNode(f.responseXML)}if(g==null||g=="PPR"){return this.getPartial(b,a)}if(g=="XML"){setTimeout(html_Doneprocessing,1);return f.responseXML}else{return this.getFull()}}catch(d){setTimeout(html_Doneprocessing,1);return}}function html_Doneprocessing(){document.body.style.cursor="default"}function html_processing(){document.body.style.cursor="wait"}htmldb_Get.prototype.GetAsync=function(a){try{p=new XMLHttpRequest()}catch(c){p=new ActiveXObject("Msxml2.XMLHTTP")}try{var b=new Date();p.open("POST",this.base,true);if(p){p.onreadystatechange=a;p.setRequestHeader("Content-Type","application/x-www-form-urlencoded");p.send(this.queryString==null?this.params:this.queryString);return p}}catch(c){return false}};function htmldb_ExternalPost(f,b,e){var c="f?p="+html_GetElement("pFlowId").value+":"+html_GetElement("pFlowStepId").value+":"+html_GetElement("pInstance").value+":FLOW_FOP_OUTPUT_R"+b;document.body.innerHTML=document.body.innerHTML+'<div style="display:none;" id="dbaseSecondForm"><form id="xmlFormPost" action="'+e+'?ie=.pdf" method="post" target="pdf"><textarea name="vXML" id="vXML" style="width:500px;height:500px;"></textarea></form></div>';var d=html_GetElement("vXML");var a=new htmldb_Get(d,null,null,null,null,"f",c.substring(2));a.get();a=null;setTimeout('html_GetElement("xmlFormPost").submit()',10);return}function $xml_Control(b){this.xsl_string='<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html"/><xsl:param name="xpath" /><xsl:template match="/"><xsl:copy-of select="//*[@id=$xpath]"/></xsl:template></xsl:stylesheet>';if(document.all){this.xsl_object=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");this.xsl_object.async=false;this.xsl_object.loadXML(this.xsl_string);tmp=new ActiveXObject("Msxml2.XSLTemplate.3.0");tmp.stylesheet=this.xsl_object;this.xsl_processor=tmp.createProcessor()}else{this.xsl_object=(new DOMParser()).parseFromString(this.xsl_string,"text/xml");this.xsl_processor=(new XSLTProcessor());this.xsl_processor.importStylesheet(this.xsl_object);this.ownerDocument=document.implementation.createDocument("","test",null)}this.xml=b;this.CloneAndPlace=a;return;function a(g,d,f){var c=$x(d);if(document.all){this.xsl_processor.addParameter("xpath",g);this.xsl_processor.input=this.xml;this.xsl_processor.transform;var e=this.xsl_processor.output}else{this.xsl_processor.setParameter(null,"xpath",g);var e=this.xsl_processor.transformToFragment(this.xml,this.ownerDocument)}if(c){if(document.all){c.innerHTML="";c.innerHTML=e}else{c.innerHTML="";c.appendChild(e)}return e}}};

