
/*
	"Hemi" JavaScript Framework
	Engine for Web Applications 3.1
	Composite file "hemi.comp.js" release: 3.1.1
	Copyright 2002 - 2010. All Rights Reserved.
	Author: Stephen W. Cote
	Email: sw.cote@gmail.com
	Project: http://www.whitefrost.com/Hemi/
	BSD License: http://www.whitefrost.com/Hemi.license.txt
*/

if(typeof window!="object")window={};(function(){if(window.Hemi)return;H={LB:[],LM:[],NS:[],NM:[],ClassImports:[],Context:window,hemi_base:(location.protocol.match(/^file/i)?"file://"+location.pathname.substring(0,location.pathname.lastIndexOf("/")+1):"/Hemi/"),uid_prefix:"hemi-",gc:0};var D={S:"string",O:"object",F:"function",U:"undefined",N:"number",T:
function(v,t){return(typeof v==t);},TS:
function(v){return D.T(v,D.S);},TO:
function(v){return D.T(v,D.O);},TF:
function(v){return D.T(v,D.F);},TU:
function(v){return D.T(v,D.U);},TN:
function(v){return D.T(v,D.N);}};var data_undefined;D.X=(typeof XMLHttpRequest!=D.U?XMLHttpRequest:data_undefined);D.A=(typeof ActiveXObject!=D.U?ActiveXObject:data_undefined);if(typeof window.D!=D.O)window.D=D;H.logError=function(s){H.L(s,"100.5");};H.logWarning=function(s){H.L(s,"100.4");};H.logDebug=function(s){H.L(s,"100.1");};H.log=function(s){H.L(s,"100.3");};H.L=function(s,l){H.message.service.S(s,l);};H.isImported=function(s){var o=H.getLibrary(s);return(o&&o.loaded);};H.getLibrary=function(s){if(!D.TN(H.LM[s]))s="hemi."+s;if(D.TN(H.LM[s]))return H.LB[H.LM[s]];return 0;};H.include=function(s,z,n){if(H.isImported(s)||(!z&&D.TN(H.NM[s.replace(/^hemi\./,"")])))return H.getLibrary(s);var v,l=H.LB.length,q,b=0;var x=H.xml.getText((z&&!z.match(/^\//)?H.hemi_base:"")+(z?z:"Framework/")+s.toLowerCase()+".js",0,0,s,1);try{if(x){x=x.replace(/^\s+/,"").replace(/\s+$/,"");if(!n)eval(x);b=1;}}catch(e){alert("Error including library '"+s+"'\n\n"+e.message);}q={package:s,index:l,raw:x,loaded:b};H.LB[l]=q;H.LM[s]=l;return q;};H.namespace=function(c,o,v,b){var a,i=0,s,o,l,p;if(!o)o=H.Context;if(D.TS(c)){if(!H.NM[c]){l=H.NS.length;H.NM[c]=l;H.NS[l]=c;}a=c.split(".");p=o;for(;i<a.length;){s=a[i++];if(!D.TO(p[s]))p[s]={};p=p[s];}}if(v){for(i in v)p[i]=v[i];if(b&&D.TF(p["serviceImpl"]))p.service=new p.serviceImpl();}return p;};H.lookup=function(c){var a,i=0,s,w=window,o,l;if(!D.TS(c))return 0;a=c.split(".");o=w;if(a[0].match(/^hemi$/)){o=H;i=1;}l=a.length;for(;i<l;){s=a[i++];if(!D.TO(o[s]))return 0;o=o[s];}return o;};H.h=function(s){var i=c=0;for(;s&&i<s.length;++i){c=(c+s.charCodeAt(i)*(i+1))&0xFFFFFFFF;}return c.toString(16);},H.guid=function(){var d=new Date(),t,i=4,r,l,x=0;t=new String(d.getTime());r=new String(parseInt(Math.random()*(1000*i)));l=r.length;for(;x<i-l;x++)r="0"+r;return(H.uid_prefix+(++H.gc)+"-"+t+"-"+r);};H.newObject=function(n,v,r,d,h){var o={};if(D.TO(h)){for(i in h)o[i]=h[i];}H.prepareObject(n,v,r,o,d);if(D.TF(o.object_create))o.object_create();return o;};H.prepareObject=function(n,v,r,o,d){if(!o)o={};if(!o.o)o.o={};if(!o.p)o.p={};if(!n)n="custom_object";if(!v)v="1.0";H.IM(o,"base_object",n,v);if(r)H.registry.service.addObject(o);if(d){H.include("hemi.object");H.object.addObjectDeconstructor(o);}if(D.TF(o.object_prepare))o.object_prepare();return o;};H.IM=function(o,s){var v,a=arguments,i,n_a=[];for(i=1;i<a.length;i++)n_a[n_a.length]=a[i];v=H.FN.apply(this.caller,n_a);if(D.TO(o)&&D.TO(v)){for(i in v)o[i]=v[i];}};H.FN=function(s){var v,a=arguments;if(D.TS(H.ClassImports[s])){eval("v="+H.ClassImports[s]);return v;}switch(s){case "base_object":return{i:H.guid(),getObjectId:
function(){return this.i;},t:a[1],getObjectType:
function(){return this.t;},v:a[2],getObjectVersion:
function(){return this.v;},r:0,getReadyState:
function(){return this.r;},getProperties:
function(){return this.p;},getObjects:
function(){return this.o;}};break;}return null;};H.GetSpecifiedAttribute=function(o,n){return H.IsAttributeSet(o,n,1);};H.IsAttributeSet=function(o,n,b){if(o==null||!D.TO(o)||o.nodeType!=1)return 0;var s=o.getAttribute(n);if(!D.TS(s)||s.length==0)return 0;return(b?s:1);};H.namespace("registry",H,{getEvalStatement:
function(o){if(!H.registry.service.isRegistered(o))return 0;return "H.registry.service.getObject('"+o.i+"')";},getApplyStatement:
function(o,f){var a=H.registry.getEvalStatement(o);if(!a)return 0;return a+"."+f+".apply("+a+")";},service:null,serviceImpl:
function(){var t=this;t.p={rt:0};t.o={o:[],om:[]};t.canRegister=function(o){if(!D.TO(o)||(!D.TS(o.i)||!D.TS(o.t)||!D.TS(o.v)||!D.TN(o.r))){return 0;}return 1;};t.addObject=function(o){var i,m,p;if(!t.canRegister(o)){H.L("Invalid Object Structure","540.4",1);return 0;}if(t.isRegistered(o)){H.H.L("Object '"+o.i+"' is already registered","540.4");return 0;}p=t.o;i=o.i;if(!D.TN(p.om[i])){m=p.o.length;p.o[m]=o;p.om[i]=m;if(t.p.rt&&H.isImported("hemi.transaction")){H.transaction.service.register(o);}return 1;}return 0;};t.removeObject=function(o,b){var i=o.i,m,p;p=t.o;if(D.TN(p.om[i])){m=p.om[i];p.o[m]=0;p.om[i]=null;if(!b)H.message.service.publish("onremoveobject",i);return 1;}return 0;};t.getObjectsArray=function(){return t.o.o;};t.getObjectsMap=function(){return t.o.om;};t.getObject=function(i){var p=t.o;if(D.TN(p.om[i])&&D.TO(p.o[p.om[i]])){return p.o[p.om[i]];}return null;};t.isRegistered=function(i){if(D.TO(i)){if(D.TU(i.i))return 0;i=i.i;}if(D.TN(t.o.om[i])){return 1;}return 0;};t.sendSigterm=function(){var o,i,p=t.o;for(i=p.o.length-1;i>=0;){o=p.o[i--];if(o!=null&&o.r==4&&D.TF(o.sigterm)){o.sigterm();}}for(i=0;i<p.o.length;){o=p.o[i++];if(t.isRegistered(o))t.removeObject(o,1);}};t.sendDestroyTo=function(o){if(t.isRegistered(o)&&D.TF(o.destroy)){o.destroy();return 1;}return 0;};H.prepareObject("registry_service","3.1.1",0,t);t.addObject(t);}},1);H.namespace("message",H,{service:null,serviceImpl:
function(){var t=this;t.o={s:[],dd:[],e:[]};t.p={dd:0,me:500,rt:3};t.data={l:["ALL","DEBUG","ADVISORY","NORMAL","WARNING","ERROR","FATAL","NONE"],lm:{ALL:0,DEBUG:1,ADVISORY:2,NORMAL:3,WARNING:4,ERROR:5,FATAL:6,NONE:7},dm:[],ed:[	]};t.getReportThreshold=function(){return t.p.rt;};t.getLevelMap=function(){return this.data.lm;};t.getLevels=function(){return this.data.l;};t.setReportThreshold=function(i){if(D.TN(i))i=t.data.l[i];if(D.TN(t.data.lm[i])){t.p.rt=t.data.lm[i];}};t.getEntries=function(){return t.o.e;};t.clearEntries=function(){t.o.e=[];};t.getDeliveryDelay=function(){return t.p.dd;};t.setDeliveryDelay=function(i){if(D.TN(i)&&i>=0)t.p.dd=i;};t.newSubscriptionObject=function(o,n,h,g){return{object:o,subscription_name:n,handler:h,target:g};};t.subscribe=function(o,e,f,v){var l,a=arguments,t=this;if(a.length==4){if(!o)o=window;if(!v)v=null;}if(a.length==2){var t1=a[0],t2=a[1];o=window;e=t1;f=t2;}if(!D.TO(t.o.s[e]))t.o.s[e]=[];l=t.o.s[e].length;t.o.s[e][l]=t.newSubscriptionObject(o,e,f,v);return 0;};t.unsubscribe=function(o,e,f){var t=this,a=[],l,i=0,z,g=arguments;if(g.length==2){var t1=g[0],t2=g[1];o=window;e=t1;f=t2;}if(!D.TO(t.o.s[e]))return 0;l=t.o.s[e].length;for(;i<l;i++){z=t.o.s[e][i];if(z.object!=o||z.handler!=f){a[a.length]=z;}}t.o.s[e]=a;return 1;};t.sigterm=function(){var t=this;t.r=5;t.p.dd=0;t.o.dd=[];t.o.e=[];};t.flush=function(){t.o.dd=[];};t._P=function(i){var t=this,d;if(t.r!=4)return;if(D.TS(i)&&D.TO(t.o.dd[i])){d=t.o.dd[i];t.P(d.event,d.data);t.o.dd[i]=0;}};t.publish=function(e,o){var t=this,c,x,d;c=t.object_config;if(t.p.dd){d=t.o.dd;x=H.guid();d[x]={data:o,event:e};setTimeout("try{if(Hemi.registry.service.isRegistered('"+t.i+"'))Hemi.registry.service.getObject('"+t.i+"')._P('"+x+"');}catch(er){alert('Publish Error In "+e+" To "+t.t+"'\n+(er.message||er.description));}",t.p.dd);}else{t.P(e,o);}};t.P=function(e,o){var t=this,c,j,l,i,z,x,d;if(t.r!=4)return;c=t.object_config;if(!D.TO(t.o.s[e]))return;l=t.o.s[e].length;for(i=l-1;i>=0;){z=t.o.s[e][i--];if(!z.target||z.target==o){try{if(D.TS(z.handler))z.object[z.handler](e,o);else if(D.TF(z.handler))z.handler(e,o);}catch(e){alert("Publish Error:"+e.message+"\n"+z.subscription_name+":"+z.handler+"\n"+H.error.traceRoute(z.object[z.handler]));}}}};t.sendMessage=function(d,s,p){return t.S(d,s,p);};t.S=function(d,s,p){var o=null,v,t=this,ms;if(t.r!=4)return;if(!D.TS(s))s="200";v=t.I(s);if(v.t<t.p.rt){return o;}if(!D.TN(p))p=0;if(p)o=t.R(s,d,v);o=t.C(s,d,v);ms=t.parseMessage(o);if(ms==null)ms="[message error]";t.publish("onsendmessage",{message:ms,level:v.t,description:o.d});return o;};t.R=function(s,d,v){var t=this,o;o=t.C(s,d,v);alert(t.parseMessage(o));return o;};t.newBasicMessage=function(e,d){return{entry:e,index:-1,data:d,time:new Date(),id:H.guid()};};t.C=function(s,d,v){var o,i,c,t=this;o=t.newBasicMessage(v,d);c=t.object_config;i=t.o.e.length;if(i>=t.p.me&&t.p.me>0){t.o.e.shift();i--;}o.index=i;t.o.e[i]=o;return o;};t.parseMessage=function(o){var v="[error]",a,l,d,c,t=this;c=t.object_config;if(D.TO(o)){a=t.D(o);d=o.time;var m=""+d.getMinutes(),s=""+d.getSeconds(),ms=""+d.getMilliseconds();if(s.length==1)s="0"+s;if(m.length==1)m="0"+m;if(ms.length==1)ms="0"+ms;if(ms.length==2)ms="0"+ms;v=d.getHours()+":"+m+":"+s+":"+ms+"::";v+=t.G(o.entry.t)+":";v+=(a!=null?a[0]:":");v+="("+o.entry.m+").";o.d=(a!=null?a[1]:"");if(o.data)v+=" "+o.data;else v+=" "+o.d;}return v;};t.G=function(i){return this.data.l[i];};t.D=function(o){var v=null,f=100,l,m,n,i=0,a,d,t=this;if(D.TO(o)){l=t.data.ed.length;m=o.entry.mc;n=o.entry.nc;for(;i<l;i++){a=t.data.ed[i];if(a.length>=2){d=a[2];if(m>=d&&m<(d+f))v=a;if(v!=null&&m>(d+f)){break;}}}}return v;};t.I=function(s){var a=[],c,i=100,o,m=0,n,x=900,d,p,y;o=i;if(s)a=s.split(".");c=(a[0])?parseInt(a[0]):200;for(y=i;y<=x;y+=100){if(c>=i&&c<(y+i))m=i;if(m>0&&m<=(y+100))break;}if(m<0||m>900||c<0||c>900){m=200;c=200;}n=c-m;d=(a[1])?parseInt(a[1]):3;if(d>7||d<0)d=3;l=(a[2])?parseInt(a[2]):0;p=(a[3])?parseInt(a[3]):0;return{mc:c,mb:m,nc:n,t:d,l:l,id:p,d:"",m:c+"."+d+"."+l+"."+p};};H.prepareObject("message_service","3.1.1",1,t);t.r=4;}},1);H.namespace("xml",H,{v:"3.1.1",xml_content_type:"text/xml",text_content_type:"text/plain",auto_content_type:1,form_content_type:"application/x-www-form-urlencoded",r:[],rm:[],ax_http_control:"MSXML2.XMLHTTP",ax_dom_control:"MSXML.DOMDocument",gadget_mode:0,gadget_xml_control:"Core.Gadget.GadgetXmlHttp",gadget_base_path:0,ce:1,setCacheEnabled:
function(b){H.xml.clearCache();H.xml.ce=b;},getCacheEnabled:
function(){return H.xml.ce;},nr:[	["soapenc","http://schemas.xmlsoap.org/soap/encoding/"],["wsdl","http://schemas.xmlsoap.org/wsdl/"],["soap","http://schemas.xmlsoap.org/wsdl/soap/"],["SOAP-ENV","http://schemas.xmlsoap.org/soap/envelope/"]	],nl:{},nu:{},nh:0,ho:[],hu:0,hc:0,hs:5,hm:20,hp:0,he:1,si:0,setPoolEnabled:
function(b){H.xml.he=b;},getPoolEnabled:
function(){return H.xml.he;},parseXmlDocument:
function(s){var r=0,e;if(!s)return 0;if(typeof DOMParser!=D.U){e=new DOMParser();r=e.parseFromString(s,"text/xml");}else if(typeof D.A!=D.U){r=new D.A(H.xml.ax_dom_control);r.async=false;r.loadXML(s);}else{}return r;},newXmlDocument:
function(n){var r=0,e;if(!n)return 0;if(typeof document.implementation!=D.U&&typeof document.implementation.createDocument!=D.U){r=document.implementation.createDocument("",n,null);if(r!=null&&r.documentElement==null){r.appendChild(r.createElement(n));}}else if(typeof D.A!=D.U){r=new D.A(H.xml.ax_dom_control);e=r.createElement(n);r.appendChild(e);}else{}return r;},getRequestArray:
function(){return H.xml.r;},clear:
function(){var _x=H.xml;_x.clearCache();_x.R();_x.r=[];rm=[];return 1;},clearCache:
function(){var _x=H.xml,i=0,o;for(;i<_x.r.length;i++){o=_x.r[i];if(o.c&&typeof o.cd==D.O){o.cd=0;}o.obj=null;o.ih=null;o.h=null;}_x.r=[];_x.rm=[];},getXmlHttpArray:
function(){return H.xml.ho;},R:
function(){var _x=H.xml,i=0,o;_x.hp=1;_x.hu=0;_x.ho=[];_x.hc=_x.hs;for(;i<_x.hs;i++)o=_x.ho[i]=_x.newXmlHttpObject(1,i);},testXmlHttpObject:
function(){return H.xml.newXmlHttpObject(null,null,1);},newXmlHttpObject:
function(b,i,z){var o=null,v,f,_m=H.message.service;if(typeof D.X!=D.U){o=new D.X();if(z)return 1;}else if(typeof D.A!=D.U){try{o=new D.A(H.xml.ax_http_control);if(z)return 1;}catch(e){_m.S("XMLError:"+(e.description?e.description:e.message),"512.4",(z?1:0));}if(z)return 0;}if(b&&typeof i==D.N){v={o:o,u:0,i:i,v:-1,h:0};return v;}else{return o;}},P:
function(i,y){var _x=H.xml,b=0,o,a;a=_x.ho;if(typeof a[i]==D.O){o=a[i];if(o.i>=_x.hs)a[i]=0;try{if(!y){if(typeof D.X!=D.U){if(typeof o.o.removeEventListener==D.F)o.o.removeEventListener("load",o.h,false);else o.o.onreadystatechange=_x.B;}else if(typeof D.A!=D.U&&o.o instanceof D.A)o.o.onreadystatechange=_x.B;o.h=0;}}catch(e){H.message.service.S("Error in P:"+(e.description?e.description:e.message),"512.4",1);}o.o.abort();o.u=0;o.v=-1;_x.hu--;}return 1;},G:
function(y){var _x=H.xml,i=0,b=0,o,a,_m=H.message.service,n=-1,z=0;if(!_x.hp)_x.R();a=_x.ho;for(;i<a.length;i++){if(typeof a[i]==D.O&&typeof a[i].u==D.N&&!a[i].u){a[i].u=1;b=i;z=1;break;}if(n==-1&&!a[i])n=i;}if(!z){b=(n>-1)?n:a.length;if(b<_x.hm){a[b]=_x.newXmlHttpObject(1,b);a[b].u=1;}else{_m.S("Max pool size reached!","200.4");return null;}}if(b>-1){_x.hu++;o=a[b];try{if(!y){if(typeof D.X!=D.U){if(typeof o.o.addEventListener==D.F){o.h=function(){H.xml.L(b);};o.o.addEventListener("load",o.h,false);}else{o.h=function(){H.xml.S(b);};o.o.onreadystatechange=o.h;}}else if(typeof D.A!=D.U&&o.o instanceof D.A){o.h=function(){H.xml.S(b);};o.o.onreadystatechange=o.h;}}}catch(e){_m.S("Error in G:"+(e.description?e.description:e.message),"512.4",1);}return o;}return null;},L:
function(i){var _x=H.xml,o,v,_m=H.message.service,z;try{if(_x.he&&typeof _x.ho[i]==D.O){z=_x.ho[i].v;if(z==-1){_m.S("Invalid pool index for "+i,"200.4",1);return 0;}i=z;}if(typeof _x.rm[i]==D.N){o=_x.r[_x.rm[i]];v={text:null,xdom:null,json:null,id:(o.bi?o.bi:i)};if(o.u.match(/^file:/i)&&typeof D.A=="function"&&o.o instanceof D.A){var mp=new D.A(H.xml.ax_dom_control);mp.loadXML(o.o.responseText);v.xdom=mp;}else if(o.o!=null){if(o.t){v.text=o.o.responseText;if(o.t==2&&typeof JSON!=D.U){try{v.json=JSON.parse(v.text,_x.JSONReviver);}catch(e){v.json=null;v.error=e.message;}}}else{v.xdom=o.o.responseXML;if(o.o.responseXML==null||o.o.responseXML.documentElement==null&&o.o.responseText!=null){v.xdom=_x.parseXmlDocument(o.o.responseText);v.text=o.o.responseText;}}}if(!o.t&&v.xdom==null){_m.S("Error loading '"+o.u+"'. Response text is:"+o.o.responseText+". Async is "+o.a+";Pool Index is "+o.pi,"540.4",1);}else if(o.t==2&&v.json==null){_m.S("Error loading '"+o.u+"'. The internal JSON object reference is null. Async is "+o.a+";Pool Index is "+o.pi,"540.4",1);}o.r=1;if(o.ih){o.ih=0;}if(_x.ce&&o.c){o.cd=v.xdom;}H.message.service.publish("onloadxml",v);if(typeof o.h==D.F)o.h("onloadxml",v);if(o.pi>-1)_x.P(o.pi,!o.a);o.o=0;}else{_m.S("Invalid id reference:"+i,"200.4",1);}}catch(e){_m.S("Error in handle_xml_request_load:"+(e.description?e.description:e.message),"512.4",1);}},S:
function(i){var _x=H.xml,o;if(_x.he&&typeof _x.ho[i]==D.O){o=_x.ho[i];if(o!=null&&typeof o.o==D.O&&o.o.readyState==4){_x.L(i);}}else if(typeof _x.rm[i]==D.N){o=_x.r[_x.rm[i]];if(typeof o.o==D.O&&o.o.readyState==4){_x.L(i);}}},getJSON:
function(p,h,a,i,c){return H.xml.X(p,h,a,i,0,null,c,2);},getText:
function(p,h,a,i,c){return H.xml.X(p,h,a,i,0,null,c,1);},getXml:
function(p,h,a,i,c){return H.xml.X(p,h,a,i,0,null,c);},postJSON:
function(p,d,h,a,i){if(typeof JSON=="undefined"){alert("Missing JSON interpreter");return 0;}return H.xml.X(p,h,a,i,1,JSON.stringify(d),0,2);},postText:
function(p,d,h,a,i){return H.xml.X(p,h,a,i,1,d,0,1);},postXml:
function(p,d,h,a,i){return H.xml.X(p,h,a,i,1,d,0);},X:
function(p,h,a,i,x,d,c,t){var _x=H.xml,f,o=null,v,_m=H.message.service,y,z,r,b,b_ia,g,bi=0;if(!_x.si)_x.StaticInitialize();if(typeof p!=D.S||p.length==0){_m.S("Invalid path parameter in X","512.4",1);return 0;}if(typeof c==D.U)c=0;if(typeof x==D.U)x=0;if(typeof d==D.U)d=null;z=(x?"POST":"GET");if(typeof i!=D.S)i=H.guid();if(_x.ce&&typeof _x.rm[i]==D.N&&(r=_x.r[_x.rm[i]])){if(r.c&&(typeof r.cd==D.O||typeof r.ct==D.S)){if(!t)b={xdom:r.cd,id:i};else{b={text:r.ct,id:i};if(t==2&&typeof JSON!=D.U)b.json=JSON.parse(r.ct,_x.JSONReviver);}if(b){_m.publish("onloadxml",b);if(typeof h==D.F)h("onloadxml",b);return r.cd;}}else if(!r.r){c=0;bi=i;i=H.guid();}}b=_x.he;if(_x.gadget_mode){a=0;b=0;p=_x.gadget_base_path+p;r=new ActiveXObject(_x.gadget_xml_control);}else if(b){r=_x.G(!a);}else{r=_x.newXmlHttpObject();}if(!(b?(r&&r.o):r)){_m.S("Null XML object in in X.","512.4");b={text:null,xdom:null,error:"Null XML object in X",id:i};if(typeof h==D.F)h("onloadxml",b);return 0;}if(b)r.v=i;y=_x.r.length;_x.r[y]={u:p,i:i,bi:bi,a:a,o:(b?r.o:r),ih:0,h:h,pi:(b?r.i:-1),c:c,cd:0,r:0,t:t};_x.rm[i]=y;o=_x.r[y].o;if(!p.match(/:\/\//)){var m,e=new RegExp("^/");if(!p.match(e)){if(H.hemi_base){p=H.hemi_base+p;}else{m=location.pathname;if(m.match(/\\/))m=m.replace(/\\/g,"/");m=m.substring(0,m.lastIndexOf("/")+1);p=m+p;}}if(!p.match(/:\/\//)){if(!location.protocol.match(/^file:$/i))p=location.protocol+"//"+location.host+p;else p=location.protocol+"//"+p;}}_x.r[y].u=p;b_ia=(typeof D.A!=D.U&&o instanceof D.A)?1:0;if(b_ia&&typeof XMLHttpRequest!=D.U&&p.match(/^file/i)){_x.P(_x.r[y].pi,!a);o=new D.A(H.xml.ax_http_control);if(bi)i=bi;o.open(z,p,false);o.send(null);var rt=(t?o.responseText:o.responseXML);b={xdom:null,text:null,json:null,id:i};if(t){b.text=rt;if(t==2&&typeof JSON!=D.U){try{b.json=JSON.parse(b.text,_x.JSONReviver);}catch(e){b.json=null;b.error=e.message;}}}else{if(rt==null||rt.documentElement==null){rt=_x.parseXmlDocument(o.responseText);}b.xdom=rt;}_m.publish("onloadxml",b);if(typeof h==D.F)h("onloadxml",b);return rt;}try{if(!b&&a&&typeof D.X!=D.U){if(typeof o.addEventListener==D.F){_x.r[y].ih=function(){H.xml.L(i);};o.addEventListener("load",_x.r[y].ih,false);}else{_x.r[y].ih=function(){H.xml.S(i);};o.onreadystatechange=_x.r[y].ih;}}else if(!b&&a&&b_ia){_x.r[y].ih=function(){H.xml.S(i);};o.onreadystatechange=_x.r[y].ih;}}catch(e){_m.S("Error in X:"+(e.description?e.description:e.message),"512.4",1);}if(b&&!a){_x.ho[_x.r[y].pi]=0;}g=(a?true:false);o.open(z,p,g);if(typeof o.setRequestHeader!=D.U){z=(t?_x.text_content_type:_x.xml_content_type);if(_x.auto_content_type&&!t&&typeof d==D.S)z=H.xml.form_content_type;o.setRequestHeader("Content-Type",z);}o.send(d);if(!a){z=(t?o.responseText:o.responseXML);if(!t&&p.match(/^file:/i)&&b_ia){var mp=new D.A(H.xml.ax_dom_control);mp.loadXML(o.responseText);z=mp;}else if(!t&&(o.responseXML==null||o.responseXML.documentElement==null)){z=_x.parseXmlDocument(o.responseText);}if(b){_x.ho[_x.r[y].pi]=r;_x.L(_x.r[y].pi);}else{_x.L(i);}_x.r[y].o=null;if(!b&&_x.r[y].pi>-1)_x.P(_x.r[y].pi,!a);return z;}return 1;},transformNode:
function(x,s,n,i,j,p,t){var xp,o=null,_m=H.message.service,_x=H.xml,v,a,b,c,d;if(typeof x==D.S&&x.length>0){if(p&&!i)p=0;v=x;x=_x.getXml(x,0,0,i,p);if(v.match(/\?(\S*)$/)){v=v.match(/\?(\S*)/)[1];a=v.split("&");for(b=0;b<a.length;b++){c=a[b].split("=");x.documentElement.setAttribute(c[0],c[1]);}}}if(typeof s==D.S&&s.length>0){if(p&&!j)p=0;s=_x.getXml(s,0,0,j,p);}if(typeof x!=D.O||x==null||typeof s!=D.O||s==null){_m.S("Invalid parameters in transformNode. Xml Node="+x+",xsl document="+s,"512.4",1);return o;}if(typeof n!=D.O)n=x;try{if(typeof XSLTProcessor!=D.U){xp=new XSLTProcessor();xp.importStylesheet(s);o=xp.transformToFragment(n,document);if(o&&o!=null){if(t)o=H.xml.serialize(o);else o=o.firstChild;}}else if(typeof D.A!=D.U&&x instanceof D.A){o=new D.A(H.xml.ax_dom_control);xp=n.transformNode(s);if(t)o=xp;else{o.loadXML(xp);o=o.documentElement;}}else{_m.S("Error in transformNode:"+(e.description?e.description:e.message),"512.4",1);}}catch(e){_m.S("Error in transformNode:"+(e.description?e.description:e.message),"512.4",1);}return o;},HN:
function(){var _x=H.xml,a,i=0,o;_x.nu={};_x.nl={};for(;i<_x.nr.length;i++){o=_x.nr[i];_x.nu[o[0]]=o[1];_x.nl[o[1]]=o[0];}_x.nh=1;},getURIForURL:
function(u){var _x=H.xml,q;if(!_x.nh)_x.HN();q=_x.nl[u];return(q?q:"");},getURLForURI:
function(i){var _x=H.xml,q;if(!_x.nh)_x.HN();q=_x.nu[i];return(q?q:"");},lookupNamespaceURI:
function(n){var _x=H.xml;if(!_x.nh)_x.HN();if(_x.nu[n])return _x.nu[n];return "";},selectSingleNode:
function(d,x,c){var s,i,n;if(typeof d.evaluate!=D.U){c=(c?c:d.documentElement);s=d.evaluate(x,c,H.xml,0,null);return s.iterateNext();}else if(typeof d.selectNodes!=D.U){return(c?c:d).selectSingleNode(x);}return 0;},selectNodes:
function(d,x,c){var s,a=[],i,n;if(typeof d.evaluate!=D.U){c=(c?c:d.documentElement);s=d.evaluate(x,c,H.xml,0,null);n=s.iterateNext();while(typeof n==D.O&&n!=null){a[a.length]=n;n=s.iterateNext();}return a;}else if(typeof d.selectNodes!=D.U){return(c?c:d).selectNodes(x);}return a;},queryNodes:
function(x,p,n,a,v){return H.xml.Q(x,p,n,a,v,1);},queryNode:
function(x,p,n,a,v){return H.xml.Q(x,p,n,a,v,0);},Q:
function(x,p,n,a,v,z){var i=0,b,e,c,r=[];if(!z)r=null;c=x.getElementsByTagName(p);if(typeof n==D.S){if(!c.length){if(!z)return null;else return r;}c=c[0];e=c.getElementsByTagName(n);}else e=c;for(;i<e.length;i++){b=e[i];if((!a&&!v)||(b.getAttribute(a)==v)){if(!z){r=b;break;}else r[r.length]=b;}}return r;},serialize:
function(n){var v;if(typeof XMLSerializer!=D.U){return(new XMLSerializer()).serializeToString(n);}else if(typeof n.xml==D.S){return n.xml;}},getCDATAValue:
function(n){var c,d="",i=0,e;if(n==null)return d;c=n.childNodes;for(;i<c.length;i++){e=c[i];if(e.nodeName=="#cdata-section")d+=e.nodeValue;}return d;},getInnerText:
function(s){var r="",a,i,e;if(typeof s==D.S)return s;if(s==null)return r;if(typeof s==D.O&&s.nodeType==3)return s.nodeValue;if(s.hasChildNodes()){a=s.childNodes;for(i=0;i<a.length;i++){e=a[i];if(e.nodeType==3||e.nodeType==4)r+=e.nodeValue;if(e.nodeType==1&&e.hasChildNodes()){r+=H.xml.getInnerText(e);}}}return r;},removeChildren:
function(o,b){if(!o)return;var i,a=o.childNodes,n,p;for(i=a.length-1;i>=0;i--){n=a[i];if(b&&n.nodeType==1&&H.IsAttributeSet(n,"hemi-id")&&(p=H.registry.service.getObject(n.getAttribute("hemi-id")))){H.xml.removeChildren(n,b);H.registry.service.sendDestroyTo(p);o.removeChild(n);}else o.removeChild(n);}},swapNode:
function(n,c){if(!n||!c)return;if(typeof n.swapNode!=D.U)n.swapNode(c);else{n.parentNode.insertBefore(c,n);n.parentNode.removeChild(n);}},setInnerXHTML:
function(t,s,p,d,z,c,h,ch){var y,e,a,l,x,n,v,r=0,b,f;if(!d)d=document;b=(d==document?1:0);if(!p)H.xml.removeChildren(t);y=(s&&typeof s==D.O)?s.nodeType:(typeof s==D.S)?33:-1;try{switch(y){case 1:if(h){e=s.cloneNode(false);}else{f=s.nodeName;if(typeof ch==D.F)f=ch(y,f);if(!f)return 0;e=d.createElement(f);a=s.attributes;l=a.length;for(x=0;x<l;x++){n=a[x].nodeName;v=a[x].nodeValue;if(typeof ch==D.F){n=ch(2,n);v=ch(2,v);}if(b&&n=="style"){e.style.cssText=v;}else if(b&&n=="id"){e.id=v;}else if(b&&n=="class"){e.className=v;}else if(b&&n.match(/^on/i)){eval("e."+n+"=function(){"+v+"}");}else{e.setAttribute(n,v);}}}if(!z&&s.hasChildNodes()){a=s.childNodes;l=a.length;for(x=0;x<l;x++)H.xml.setInnerXHTML(e,a[x],1,d,z,c,h,ch);}if(b&&s.nodeName.match(/input/i)&&H.IsAttributeSet(s,"checked")){e.checked=true;}t.appendChild(e);r=e;break;case 3:e=s.nodeValue;if(typeof ch==D.F)e=ch(y,e);if(e){e=e.replace(/\s+/g," ");t.appendChild(d.createTextNode(e));r=e;}break;case 4:e=s.nodeValue;if(typeof ch==D.F)e=ch(y,e);t.appendChild(d.createCDATASection(e));break;case 8:break;case 33:e=s;if(typeof ch==D.F)e=ch(y,e);if(e){if(!c){e=e.replace(/^\s*/,"");e=e.replace(/\s*$/,"");e=e.replace(/\s+/g," ");}t.appendChild(d.createTextNode(e));r=e;}break;default:break;}}catch(e){H.message.service.S((e.message?e.message:e.description)+" in type "+y+":"+H.error.traceRoute(H.xml.setInnerXHTML),"200.4");}return r;},B:
function(){},StaticInitialize:
function(){H.message.service.subscribe(H.xml,"destroy","_handle_destroy");H.xml.si=1;},_handle_destroy:
function(s,v){var _x=H.xml;H.message.service.unsubscribe(H.xml,"destroy","_handle_destroy");_x.clearCache();_x.r=[];rm=[];_x.hp=0;_x.hu=0;_x.ho=[];},JSONReviver:
function(k,v){var a;if(typeof v=="string"&&(a=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(v)))return new Date(Date.UTC(+a[1],+a[2]-1,+a[3],+a[4],+a[5],+a[6]));return v;}});H.namespace("error",H,{traceRoute:
function(v){var r="",a=[],i=0,n,q,g,t,l;if(v!=null){while(v&&v!=null){n=H.error.G(v.toString());if(n==null){v=null;break;}n+="(";g=v.arguments;for(i=0;g&&i<g.length;i++){if(i>0)n+=",";q="";t=typeof g[i];l=v;if(t==D.S){q="\"";if(l.length>25)l=l.substring(0,22)+"...";}else if(t==D.O)l="obj";else if(t==D.F)l="func";n+=q+(t==D.O?"obj":l)+q+"{as "+t+"}";}n+=")";a.push(n);v=v.caller;}r=a.reverse().join("->");}else{r="null";}return r;},G:
function(s){var a=s.match(/function\s([A-Za-z0-9_]*)\(/gi),r=null;if(s==r)return r;if(a!=null&&a.length){s=a[0];s=s.replace(/^function\s+/,"");s=s.replace(/^\s*/,"");s=s.replace(/\s*$/,"");s=s.replace(/\($/,"");return s;}return r;}});if(!window.Hemi)window.Hemi=H;})();if(typeof window.Hemi=="object"&&typeof Hemi!="object")Hemi=window.Hemi;
/* End Hemi Framework 3.1 */
