/*
 * Bindows 3.0
 * http://www.bindows.net/
 * Copyright (c) 2003-2007 MB Technologies
 *
 * Bindows(tm) belongs to MB Technologies (Georgia, USA). All rights reserved.
 * You are not allowed to copy or modify this code. Commercial use requires
 * license.
 */
var _biInPrototype=false;function _biExtend(fConstr,fSuperConstr,sName){_biInPrototype=true;var p=fConstr.prototype=new fSuperConstr();if(sName){p._className=sName;}p.constructor=fConstr;_biInPrototype=false;return p;}Object.isEmpty=function(o){for(var _ in o)return false;return true;};Object.getKeys=function(o){var r=[];for(var i in o)r.push(i);return r;};Object.getValues=function(o){var r=[];for(var i in o)r.push(o[i]);return r;};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,fromIndex){if(fromIndex==null){fromIndex=0;}else if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);}for(var i=fromIndex;i<this.length;i++)if(this[i]===obj)return i;return -1;};}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(obj,fromIndex){if(fromIndex==null){fromIndex=this.length-1;}else if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);}for(var i=fromIndex;i>=0; --i)if(this[i]===obj)return i;return -1;};}Array.prototype.contains=function(o){return this.indexOf(o)!=-1;};Array.prototype.copy=function(o){return this.concat();};Array.prototype.insertAt=function(o,i){this.splice(i,0,o);};Array.prototype.insertBefore=function(o,o2){var i=this.indexOf(o2);if(i==-1)this.push(o);else this.splice(i,0,o);};Array.prototype.removeAt=function(i){this.splice(i,1);};Array.prototype.remove=function(o){var i=this.indexOf(o);if(i!=-1)this.splice(i,1);};if(!Array.prototype.forEach){Array.prototype.forEach=function(f,obj){var l=this.length;for(var i=0;i<l;i++)f.call(obj,this[i],i,this);};}if(!Array.prototype.filter){Array.prototype.filter=function(f,obj){var l=this.length;var res=[];for(var i=0;i<l;i++)if(f.call(obj,this[i],i,this)){res.push(this[i]);}return res;};}if(!Array.prototype.map){Array.prototype.map=function(f,obj){var l=this.length;var res=[];for(var i=0;i<l;i++)res.push(f.call(obj,this[i],i,this));return res;};}if(!Array.prototype.some){Array.prototype.some=function(f,obj){var l=this.length;for(var i=0;i<l;i++)if(f.call(obj,this[i],i,this)){return true;}return false;};}if(!Array.prototype.every){Array.prototype.every=function(f,obj){var l=this.length;for(var i=0;i<l;i++)if(!f.call(obj,this[i],i,this)){return false;}return true;};}String._rExpTrim=/(^\s+)|\s+$/g;String.prototype.trim=function(){return this.replace(String._rExpTrim,"");};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.substr(1);};String.prototype.startsWith=function(s){return this.substring(0,s.length)==s;};String.prototype.endsWith=function(s){return this.substring(this.length-s.length,this.length)==s;};String.EMPTY="";String.BOOLEAN_TRUE="true";String.BOOLEAN_FALSE="false";Function.READ=1;Function.WRITE=2;Function.READ_WRITE=3;Function.EMPTY=function(){};Function.prototype.addProperty=function(sName,nReadWrite){var p=this.prototype;nReadWrite=nReadWrite||Function.READ_WRITE;var capitalized=sName.capitalize();sName="_"+sName;if(nReadWrite&Function.READ){p["get"+capitalized]=function(){return this[sName];};}if(nReadWrite&Function.WRITE){p["set"+capitalized]=function(v){this[sName]=v;};}};function BiObject(){}_p=_biExtend(BiObject,Object,"BiObject");_p._disposed=false;_p._id=null;BiObject.TYPE_FUNCTION="function";BiObject.TYPE_OBJECT="object";BiObject.TYPE_STRING="string";BiObject._hashCodeCounter=1;BiObject.toHashCode=function(o){if(o.hasOwnProperty("_hashCode"))return o._hashCode;return o._hashCode="_"+(BiObject._hashCodeCounter++ ).toString(32);};BiObject.addProperty("disposed",Function.READ);BiObject.addProperty("id",Function.READ_WRITE);BiObject.addProperty("userData",Function.READ_WRITE);_p.toHashCode=function(){return BiObject.toHashCode(this);};_p.dispose=function(){this._disposed=true;delete this._userData;delete this._id;this.dispose=Function.EMPTY;};_p.disposeFields=function(fieldNames){var fields=fieldNames instanceof Array?fieldNames:arguments;var n,o,p;for(var i=0;i<fields.length;i++){n=fields[i];if(this.hasOwnProperty(n)){o=this[n];if(o!=null){if(typeof o.dispose==BiObject.TYPE_FUNCTION){o.dispose();}else if(o instanceof Array){for(var j=o.length-1;j>=0; --j){p=o[j];if(p&&typeof p.dispose==BiObject.TYPE_FUNCTION){p.dispose();}}}}delete this[n];}}};_p.toString=function(){if(this._className)return "[object "+this._className+"]";return "[object Object]";};_p.getProperty=function(sPropertyName){var getterName="get"+sPropertyName.capitalize();if(typeof this[getterName]==BiObject.TYPE_FUNCTION)return this[getterName]();throw new Error("No such property, "+sPropertyName);};_p.setProperty=function(sPropertyName,oValue){var setterName="set"+sPropertyName.capitalize();if(typeof this[setterName]==BiObject.TYPE_FUNCTION)this[setterName](oValue);else throw new Error("No such property, "+sPropertyName);};_p.setProperties=function(oProperties){for(var p in oProperties)this.setProperty(p,oProperties[p]);};_p.setAttribute=function(sName,sValue,oParser){var v,vv;if(sValue==String.BOOLEAN_TRUE)v=true;else if(sValue==String.BOOLEAN_FALSE)v=false;else if((vv=parseFloat(sValue))==sValue)v=vv;else v=sValue;this.setProperty(sName,v);};_p.getAttribute=function(sName){return String(this.getProperty(sName));};_p.addXmlNode=function(oNode,oParser){if(oNode.nodeType==1)oParser.fromNode(oNode);};if(typeof BiObject=="undefined")BiObject=new Function();function BiBrowserCheck(){throw new Error("Cannot create instance of BiBrowserCheck.");}_biExtend(BiBrowserCheck,BiObject,"BiBrowserCheck");BiBrowserCheck.ie=/msie/i.test(navigator.userAgent);BiBrowserCheck.moz=navigator.product=="Gecko";BiBrowserCheck.platform=navigator.platform;BiBrowserCheck.hta=BiBrowserCheck.ie&&!window.external;if(!(BiBrowserCheck.moz?/rv\:(.+)[\);]/:/MSIE\s+(.+)[\);]/).test(navigator.userAgent))throw new Error("Unable to detect Browser version.");BiBrowserCheck.version=RegExp.$1;BiBrowserCheck.versionNumber=parseFloat(BiBrowserCheck.version);BiBrowserCheck.supported=BiBrowserCheck.ie&&BiBrowserCheck.versionNumber>=5.5||BiBrowserCheck.moz&&BiBrowserCheck.versionNumber>=1.4;function BiUri(sBase,sRel){if(_biInPrototype)return;this._params={};if(sBase){this.setHref(sBase);if(sRel)this._setRelative(sRel);}}_p=_biExtend(BiUri,BiObject,"BiUri");_p._scheme="";_p._userInfo="";_p._port="";_p._host="";_p._path="";_p._dirPath="";_p._fragment="";_p._query="";_p._hrefCache=null;_p._generic=true;BiUri.addProperty("scheme",Function.READ);BiUri.addProperty("path",Function.READ);BiUri.addProperty("dirPath",Function.READ);BiUri.addProperty("host",Function.READ);BiUri.addProperty("port",Function.READ);BiUri.addProperty("fragment",Function.READ);BiUri.addProperty("userInfo",Function.READ);BiUri.regExps={scheme:/^([^:]+)\:.+$/,user:/^([^@\/]+)@.+$/,host:/^([^:\/\?\#]+).*$/,port:/^:(\d+)/,path:/^([^\?#]*)/,dirPath:/^(.*\/)[^\/]*$/,fragment:/^[^#]*#(.*)$/,absUri:/^\w(\w|\d|\+|\-|\.)*:/i};_p.toString=function(){return this.getHref();};_p.setHref=function(s){this._hrefCache=null;s=String(s);this._scheme="";this._userInfo="";this._host="";this._port=null;this._path="";this._dirPath="";this._query="";this._fragment="";this._params={};var err=new Error("Not a well formatted URI");var ok=BiUri.regExps.scheme.test(s);if(!ok)throw err;this._scheme=RegExp.$1;this._generic=s.substr(this._scheme.length,3)=="://";if(this._generic)s=s.substring(this._scheme.length+3);else s=s.substring(this._scheme.length+1);if(this._generic||this._scheme=="mailto"||this._scheme=="news"){ok=BiUri.regExps.user.test(s);if(ok){this._userInfo=RegExp.$1;s=s.substring(this._userInfo.length+1);}if(this._scheme!="file"||s.charAt(0)!="/"){ok=BiUri.regExps.host.test(s);if(!ok)throw err;this._host=RegExp.$1;s=s.substring(this._host.length);}ok=BiUri.regExps.port.test(s);if(ok){this._port=Number(RegExp.$1);s=s.substring(RegExp.$1.length+1);}}this._parsePathAndRest(s);};_p._parsePathAndRest=function(s){var err=new Error("Not a well formatted URI");var i;var ok=BiUri.regExps.path.test(s);if(!ok)throw err;this._path=RegExp.$1;s=s.substring(this._path.length);if(this._path==""&&(this._scheme=="file"||this._scheme=="http"||this._scheme=="https"||this._scheme=="ftp")){this._path="/";}var segments=this._path.split("/");var sb=[];var j=0;for(i=0;i<segments.length;i++){if(segments[i]==".")continue ;if(segments[i]==".."){ --j;delete sb[j];sb.length=j;continue ;}sb[j++ ]=segments[i];}this._path=sb.join("/");if(this._path.length>0){ok=BiUri.regExps.dirPath.test(this._path);if(!ok)throw err;this._dirPath=RegExp.$1;}ok=BiUri.regExps.fragment.test(s);if(ok){this._fragment=RegExp.$1;s=s.substring(0,s.length-this._fragment.length-1);this._fragment="#"+this._fragment.replace("#","%23");}this._query=s;s=s.substring(1);if(this._query!=""){var pairs=s.split(/\;|\&/);var parts,name,value;for(i=0;i<pairs.length;i++){parts=pairs[i].split("=");try{name=decodeURIComponent(parts[0]);}catch(e){name=parts[0];}if(parts.length==2){try{value=decodeURIComponent(parts[1]);}catch(e){value=parts[1];}}else value=null;if(name in this._params)this._params[name].push(value);else this._params[name]=[value];}}};_p._setRelative=function(s){this._hrefCache=null;s=String(s);var isAbsolute=BiUri.regExps.absUri.test(s);if(isAbsolute){this.setHref(s);return;}var dirPath=this._dirPath;this._path="";this._dirPath="";this._query="";this._fragment="";this._params={};if(s.charAt(0)=="/"){this._parsePathAndRest(s);}else this._parsePathAndRest(dirPath+s);};_p.getHref=function(){if(this._hrefCache!=null)return this._hrefCache;var s=this._scheme+(this._generic?"://":":")+this._userInfo+(this._userInfo==""?"":"@")+this._host+(this._port!=null?":"+this._port:"")+this._path;return this._hrefCache=s+this.getQuery()+this._fragment;};_p.getParam=function(sName){if(sName in this._params)return this._params[sName][this._params[sName].length-1];return undefined;};_p.setParam=function(sName,sValue){this._hrefCache=null;return this._params[sName]=[String(sValue)];};_p.removeParam=function(sName){this._hrefCache=null;delete this._params[sName];};_p.hasParam=function(sName){return sName in this._params;};_p.getParams=function(sName){if(sName in this._params)return this._params[sName].concat();return [];};_p.addParam=function(sName,sValue){this._hrefCache=null;var v=sValue==null?null:String(sValue);if(sName in this._params)this._params[sName].push(v);else this._params[sName]=[v];};_p.getQuery=function(){var sb=[];var sb2,sb3,v;for(var name in this._params){sb2=[];for(var i=0;i<this._params[name].length;i++){sb3=[];v=this._params[name][i];if(v==null)sb2.push(encodeURIComponent(name));else {sb3.push(encodeURIComponent(name),"=",encodeURIComponent(v));sb2.push(sb3.join(""));}}sb.push(sb2.join("&"));}return sb.length>0?"?"+sb.join("&"):"";};function BiEvent(sType){if(_biInPrototype)return;BiObject.call(this);this._type=sType;}_p=_biExtend(BiEvent,BiObject,"BiEvent");_p._bubbles=false;_p._propagationStopped=true;_p._defaultPrevented=false;BiEvent.addProperty("type",Function.READ);BiEvent.addProperty("target",Function.READ);BiEvent.addProperty("currentTarget",Function.READ);BiEvent.addProperty("bubbles",Function.READ);_p.stopPropagation=function(){this._propagationStopped=true;};BiEvent.addProperty("propagationStopped",Function.READ);_p.preventDefault=function(){this._defaultPrevented=true;};BiEvent.addProperty("defaultPrevented",Function.READ);_p.dispose=function(){BiObject.prototype.dispose.call(this);delete this._target;delete this._currentTarget;delete this._bubbles;delete this._propagationStopped;delete this._defaultPrevented;};_p.getDefaultPrevented=function(){return this._defaultPrevented;};function BiMouseEvent(){}function BiKeyboardEvent(){}function BiEventTarget(){if(_biInPrototype)return;BiObject.call(this);this._listeners={};this._listenersCount=0;}_p=_biExtend(BiEventTarget,BiObject,"BiEventTarget");_p.addEventListener=function(sType,fHandler,oObject){if(typeof fHandler!=BiObject.TYPE_FUNCTION)throw new Error(this+" addEventListener: "+fHandler+" is not a function");var ls=this._listeners[sType];if(!ls)ls=this._listeners[sType]={};var key=BiObject.toHashCode(fHandler)+(oObject?BiObject.toHashCode(oObject):String.EMPTY);if(!(key in ls)){this._listenersCount++;}ls[key]={handler:fHandler,object:oObject||this};};_p.removeEventListener=function(sType,fHandler,oObject){if(this._disposed||!(sType in this._listeners))return;var key=BiObject.toHashCode(fHandler)+(oObject?BiObject.toHashCode(oObject):String.EMPTY);if(key in this._listeners[sType]){ --this._listenersCount;}delete this._listeners[sType][key];if(Object.isEmpty(this._listeners[sType])){delete this._listeners[sType];}};_p.dispatchEvent=function(e){if(this._disposed)return;if(typeof e==BiObject.TYPE_STRING){e=new BiEvent(e);}e._target=this;this._dispatchEvent(e);delete e._target;return !e._defaultPrevented;};_p._dispatchEvent=function(e){e._currentTarget=this;if(this._listenersCount>0&&(!(e instanceof BiMouseEvent)&&!(e instanceof BiKeyboardEvent)||this.getIsEnabled())){var fs=this._listeners[e.getType()];if(fs){for(var hc in fs){var ho=fs[hc];ho.handler.call(ho.object,e);}}}if(e._bubbles&&!e._propagationStopped&&this._parent&&!this._parent._disposed){this._parent._dispatchEvent(e);}delete e._currentTarget;};_p.setAttribute=function(sName,sValue,oParser){if(sName.substring(0,2)=="on"){var type=sName.substring(2);this.addEventListener(type,new Function("event",sValue),oParser);}else BiObject.prototype.setAttribute.call(this,sName,sValue,oParser);};_p.dispose=function(){if(this._disposed)return;BiObject.prototype.dispose.call(this);for(var t in this._listeners)delete this._listeners[t];delete this._listeners;delete this._listenersCount;};_p.hasListeners=function(sType){return this._listenersCount>0&&(sType==null||sType in this._listeners);};function BiXmlHttp(){if(_biInPrototype)return;if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest();}throw new Error("Your browser does not support XML HTTP Requests");}BiXmlHttp.prototype=new Object();BiXmlHttp.create=function(){return new BiXmlHttp();};function BiXmlDocument(){if(_biInPrototype)return;if(document.implementation&&document.implementation.createDocument){var doc=document.implementation.createDocument("","",null);doc.addEventListener("load",function(e){this.readyState=4;},false);doc.readyState=4;return doc;}else if(window.ActiveXObject){return new ActiveXObject(BiXmlDocument._getActiveXName());}throw new Error("Your browser does not support creating DOM documents at runtime");}BiXmlDocument.prototype=new Object();BiXmlDocument.create=function(){return new BiXmlDocument();};BiXmlDocument.getNamespaces=function(oNode){if(oNode.nodeType!=9){oNode=oNode.ownerDocument;}var res={};if(BiBrowserCheck.ie){var s=oNode.getProperty("SelectionNamespaces");s.replace(/(^|\s+)xmlns\:([^=]+)=(\"[^\"]*\")|(\'[^\']*\')($|\s+)/g,function(a0,a1,a2,a3,a4){var urn=a3||a4;urn=urn.substring(1,urn.length-1);res[a2]=urn;});}return res;};BiXmlDocument.setNamespaces=function(oNode,oNamespaces){if(oNode.nodeType!=9){oNode=oNode.ownerDocument;}var sb=[];for(i in oNamespaces)sb.push("xmlns:",i,'="',oNamespaces[i],'" ');oNode.setProperty("SelectionNamespaces",sb.join(""));};BiXmlDocument.addNamespaces=function(oNode,oNamespaces){var current=BiXmlDocument.getNamespaces(oNode);for(var i in oNamespaces)current[i]=oNamespaces[i];BiXmlDocument.setNamespaces(oNode,current);};BiXmlDocument.removeNamespaces=function(oNode,oNamespaces){var current=BiXmlDocument.getNamespaces(oNode);for(var i in oNamespaces)delete current[i];BiXmlDocument.setNamespaces(oNamespaces,current);};(function(){function f(type){var prefix=["MSXML2.","Microsoft.","MSXML."];var suffix=[".6.0",".4.0",".3.0",""];var o;for(var i=0;i<prefix.length;i++)for(var j=0;j<suffix.length;j++){try{o=new ActiveXObject(prefix[i]+type+suffix[j]);return prefix[i]+type+suffix[j];}catch(ex){}}throw new Error("Could not find an installed XML parser");}BiXmlDocument._getActiveXName=function(){var s=f("DOMDocument");this._getActiveXName=function(){return s;};return s;};BiXmlHttp._getActiveXName=function(){var s=f("XMLHTTP");this._getActiveXName=function(){return s;};return s;};})();if(typeof ActiveXObject=="undefined"&&typeof XMLHttpRequest!="undefined"&&!XMLHttpRequest.____ALREADY_LOADED____){(function(){var _xmlDocPrototype=XMLDocument.prototype;_xmlDocPrototype.__proto__={__proto__:_xmlDocPrototype.__proto__};var _p=_xmlDocPrototype.__proto__;_p.createNode=function(aType,aName,aNamespace){switch(aType){case 1:if(aNamespace&&aNamespace!="")return this.createElementNS(aNamespace,aName);else return this.createElement(aName);case 2:if(aNamespace&&aNamespace!="")return this.createAttributeNS(aNamespace,aName);else return this.createAttribute(aName);case 3:default:return this.createTextNode("");}};_p.__realLoad=_xmlDocPrototype.load;_p.load=function(sUri){this.readyState=0;this.__realLoad(sUri);};_p.loadXML=function(s){var doc2=new DOMParser().parseFromString(s,"text/xml");for(;this.hasChildNodes();)this.removeChild(this.lastChild);var cs=doc2.childNodes;var l=cs.length;for(var i=0;i<l;i++)this.appendChild(this.importNode(cs[i],true));};_p.setProperty=function(sName,sValue){if(sName=="SelectionNamespaces"){this._selectionNamespaces={};var parts=sValue.split(/\s+/);var re=/^xmlns\:([^=]+)\=((\"([^\"]*)\")|(\'([^\']*)\'))$/;for(var i=0;i<parts.length;i++){re.test(parts[i]);this._selectionNamespaces[RegExp.$1]=RegExp.$4||RegExp.$6;}}};_p.__defineSetter__("onreadystatechange",function(f){if(this._onreadystatechange)this.removeEventListener("load",this._onreadystatechange,false);this._onreadystatechange=f;if(f)this.addEventListener("load",f,false);return f;});_p.__defineGetter__("onreadystatechange",function(){return this._onreadystatechange;});BiXmlDocument._mozHasParseError=function(oDoc){return !oDoc.documentElement||oDoc.documentElement.localName=="parsererror"&&oDoc.documentElement.getAttribute("xmlns")=="http://www.mozilla.org/newlayout/xml/parsererror.xml";};_p.__defineGetter__("parseError",function(){var hasError=BiXmlDocument._mozHasParseError(this);var res={errorCode:0,filepos:0,line:0,linepos:0,reason:"",srcText:"",url:""};if(hasError){res.errorCode=-1;try{res.srcText=this.getElementsByTagName("sourcetext")[0].firstChild.data;res.srcText=res.srcText.replace(/\n\-\^$/,"");}catch(ex){res.srcText="";}try{var s=this.documentElement.firstChild.data;var re=/XML Parsing Error\: (.+)\nLocation\: (.+)\nLine Number (\d+)\, Column (\d+)/;var a=re.exec(s);res.reason=a[1];res.url=a[2];res.line=a[3];res.linepos=a[4];}catch(ex){res.reason="Unknown";}}return res;});var _nodePrototype=Node.prototype;_nodePrototype.__proto__={__proto__:_nodePrototype.__proto__};_p=_nodePrototype.__proto__;_p.__defineGetter__("xml",function(){return new XMLSerializer().serializeToString(this);});_p.__defineGetter__("baseName",function(){var lParts=this.nodeName.split(":");return lParts[lParts.length-1];});_p.__defineGetter__("text",function(){var cs=this.childNodes;var l=cs.length;var sb=new Array(l);for(var i=0;i<l;i++)sb[i]=cs[i].text;return sb.join("");});_p.selectNodes=function(sExpr){var doc=this.nodeType==9?this:this.ownerDocument;var nsRes=doc.createNSResolver(this.nodeType==9?this.documentElement:this);var nsRes2;if(doc._selectionNamespaces){nsRes2=function(s){if(s in doc._selectionNamespaces)return doc._selectionNamespaces[s];return nsRes.lookupNamespaceURI(s);};}else {nsRes2=nsRes;}var xpRes=doc.evaluate(sExpr,this,nsRes2,5,null);var res=[];var item;for(;item=xpRes.iterateNext();)res.push(item);return res;};_p.selectSingleNode=function(sExpr){var doc=this.nodeType==9?this:this.ownerDocument;var nsRes;try{nsRes=doc.createNSResolver(this.nodeType==9?this.documentElement:this);}catch(e){nsRes=null;}var nsRes2;if(doc._selectionNamespaces){nsRes2=function(s){if(s in doc._selectionNamespaces)return doc._selectionNamespaces[s];return nsRes.lookupNamespaceURI(s);};}else {nsRes2=nsRes;}var xpRes=doc.evaluate(sExpr,this,nsRes2,9,null);return xpRes.singleNodeValue;};_p.transformNode=function(oXsltNode){var doc=this.nodeType==9?this:this.ownerDocument;var processor=new XSLTProcessor();processor.importStylesheet(oXsltNode);var df=processor.transformToFragment(this,doc);return df.xml;};_p.transformNodeToObject=function(oXsltNode,oOutputDocument){var doc=this.nodeType==9?this:this.ownerDocument;var outDoc=oOutputDocument.nodeType==9?oOutputDocument:oOutputDocument.ownerDocument;var processor=new XSLTProcessor();processor.importStylesheet(oXsltNode);var df=processor.transformToFragment(this,doc);for(;oOutputDocument.hasChildNodes();)oOutputDocument.removeChild(oOutputDocument.lastChild);var cs=df.childNodes;var l=cs.length;for(var i=0;i<l;i++)oOutputDocument.appendChild(outDoc.importNode(cs[i],true));};var _attrPrototype=Attr.prototype;_attrPrototype.__proto__={__proto__:_attrPrototype.__proto__};_p=_attrPrototype.__proto__;_p.__defineGetter__("xml",function(){var nv=new XMLSerializer().serializeToString(this);return this.nodeName+'="'+nv.replace(/\"/g,"&quot;")+'"';});var _textPrototype=Text.prototype;_textPrototype.__proto__={__proto__:_textPrototype.__proto__};_p=_textPrototype.__proto__;_p.__defineGetter__("text",function(){return this.nodeValue;});})();}if(typeof ActiveXObject!="undefined"){if(window.XMLHttpRequest);else {XMLHttpRequest=function(){return new ActiveXObject(BiXmlHttp._getActiveXName());};XMLHttpRequest.____ALREADY_LOADED____=true;}if(!window.DOMParser){DOMParser=function(){};DOMParser.prototype.parseFromString=function(s,mime){var doc=new BiXmlDocument();doc.loadXML(s);return doc;};}if(!window.XMLSerializer){XMLSerializer=function(){};XMLSerializer.prototype.serializeToString=function(n){return n.xml;};}}function BiLauncher(sRootPath){if(_biInPrototype)return;if(sRootPath)this.setRootPath(sRootPath);this._arguments=[];}_p=_biExtend(BiLauncher,Object,"BiLauncher");_p._reuseWindow=true;_p._newWindow=true;_p._errorMessage="";_p._accessibilityMode=false;_p._focusOnLoad=true;BiLauncher.MISSING_ADF_ARGUMENT="Missing ADF argument";BiLauncher.ADF_ARGUMENT_PARSE_ERROR="The ADF argument cannot be parsed";BiLauncher.IE_ERROR_PLATFORM="Bindows requires Internet Explorer for Windows";BiLauncher.IE_ERROR_VERSION="Bindows requires Internet Explorer 5.5 or later";BiLauncher.GECKO_ERROR_VERSION="Bindows requires Mozilla (Gecko) 1.4 or later";BiLauncher.NOT_SUPPORTED_ERROR="Bindows requires Internet Explorer 5.5+ or Mozilla 1.4+";BiLauncher.FILE_NOT_FOUND="File not found";BiLauncher.POPUP_BLOCKER_QUESTION="Failed to open window. Are you using a popup blocker?";_p.getReuseWindow=function(){return this._reuseWindow;};_p.setReuseWindow=function(b){this._reuseWindow=b;};_p.getNewWindow=function(){return this._newWindow;};_p.setNewWindow=function(b){this._newWindow=b;};_p.getWindow=function(){return this._window||null;};_p.getRootPath=function(){return this._rootPath;};_p.setRootPath=function(s){s=String(s);if(s.charAt(s.length-1)!="/")s=s+"/";this._rootPath=s;};_p.getAdfPath=function(){return this._adfPath;};_p.setAdfPath=function(s){if(s==null||s==""){this._errorMessage=BiLauncher.MISSING_ADF_ARGUMENT;return;}s=String(s);var re=/([\w ]+)(?:\.[\w ]+)?(?:$|\?)/;if(re.test(s)){this._adfName=RegExp.$1;this._adfPath=s;}else {this._errorMessage=BiLauncher.ADF_ARGUMENT_PARSE_ERROR;}};_p.getAdfName=function(){return this._adfName;};_p.setAdfName=function(s){this._adfName=s;};_p.getArguments=function(){return this._arguments;};_p.setArguments=function(a){this._arguments=[];for(var i=0;i<a.length;i++)this._arguments.push(String(a[i]));};_p.getTarget=function(){return this._target;};_p.setTarget=function(s){this._target=s;};_p.setAccessibilityMode=function(b){this._accessibilityMode=b;};_p.getAccessibilityMode=function(){return this._accessibilityMode;};_p.getFocusOnLoad=function(){return this._focusOnLoad;};_p.setFocusOnLoad=function(b){this._focusOnLoad=b;};_p.getSupported=function(){var p;if(BiBrowserCheck.ie){p=String(BiBrowserCheck.platform).toLowerCase();if(p!="win32"&&p!="win64"){this._errorMessage=BiLauncher.IE_ERROR_PLATFORM;return false;}if(BiBrowserCheck.versionNumber<5.5){this._errorMessage=BiLauncher.IE_ERROR_VERSION;return false;}return true;}else if(BiBrowserCheck.moz){if(BiBrowserCheck.versionNumber<1.4){this._errorMessage=BiLauncher.GECKO_ERROR_VERSION;return false;}return true;}this._errorMessage=BiLauncher.NOT_SUPPORTED_ERROR;return false;};_p.getErrorMessage=function(){return this._errorMessage;};_p.getHasError=function(){return this._errorMessage!="";};_p.launch=function(sAdfPath,oArgs){var left,right,top,bottom,width,height,centered,resizable,fullScreen;var adfPath,adfName,args;if(!this.getSupported())return false;if(sAdfPath)this.setAdfPath(sAdfPath);if(this.getHasError())return false;var bUseCurrentWindow=!this.getNewWindow();var sRootPath=this.getRootPath();var sAdfRelPath=this.getAdfPath();if(arguments.length>1){args=[];for(var i=1;i<arguments.length;i++)args.push(arguments[i]);this.setArguments(args);}adfName=this.getAdfName();args=this.getArguments();if(/(^http\:)|(^https\:)|(^file\:)|(^\/)/.test(sAdfRelPath)){adfPath=sAdfRelPath;}else {var curPath=document.location.href;var slashIndex=curPath.lastIndexOf("/");curPath=curPath.substring(0,slashIndex);adfPath=curPath+"/"+sAdfRelPath;}var uri=sRootPath+"bimain.html?Adf="+encodeURIComponent(adfPath)+";AdfName="+adfName+(this._accessibilityMode?";accessibilityMode=true":"")+";Params="+args.length;for(i=0;i<args.length;i++)uri=uri+(";Param"+i+"="+encodeURIComponent(args[i]));var xmlHttp=new BiXmlHttp();xmlHttp.open("GET",adfPath,false);try{xmlHttp.send(null);}catch(ex){this._errorMessage=BiLauncher.FILE_NOT_FOUND;return false;}var fs=/^file\:/.test(adfPath);if(fs){var s=String(xmlHttp.responseText).replace(/<\?xml[^\?]*\?>/,"");xmlHttp.responseXML.loadXML(s);}else if(xmlHttp.status!=200){this._errorMessage=xmlHttp.status+": "+xmlHttp.statusText;return false;}if(xmlHttp.responseXML.parseError.errorCode!=0){this._errorMessage=xmlHttp.responseXML.parseError.reason;return false;}var doc=xmlHttp.responseXML;var n=doc.selectSingleNode("/application/window | /Application/Window");left=BiLauncher._getAttr(n,"left","","x");right=BiLauncher._getAttr(n,"right","","x");top=BiLauncher._getAttr(n,"top","","y");bottom=BiLauncher._getAttr(n,"bottom","","y");width=BiLauncher._getAttr(n,"width","","x");height=BiLauncher._getAttr(n,"height","","y");centered=BiLauncher._getAttr(n,"centered","false")=="true";resizable=BiLauncher._getAttr(n,"resizable","true")!="false";fullScreen=BiLauncher._getAttr(n,"fullScreen","false")=="true";var sw=screen.width;var sh=screen.height;if(right!=""&&width!="")left=sw-width-right;else if(left!=""&&right!="")width=sw-left-right;if(bottom!=""&&height!="")top=sh-height-bottom;else if(top!=""&&bottom!="")height=sh-top-bottom;if(left==""&&right==""&&centered)left=(sw-width)/2;if(top==""&&bottom==""&&centered)top=(sh-height)/2;n=doc.selectSingleNode("/application/@focusOnLoad | /Application/@focusOnLoad");if(n)this._focusOnLoad=n.text!="false";if(!bUseCurrentWindow){var windowName=this.getReuseWindow()?this._target||adfName:"";var w=window.open(BiBrowserCheck.moz?sRootPath+"blank.html":uri,windowName,"menubar=0,location=0,status=0,toolbar=0,scrollbars=1"+(left?",left="+left:"")+(top?",top="+top:"")+(width?",width="+(width-8):"")+(height?",height="+(height-32):"")+(fullScreen?",fullscreen=1":"")+(resizable?",resizable=1":""),false);if(!w){this._errorMessage=BiLauncher.POPUP_BLOCKER_QUESTION;return false;}if(this._focusOnLoad)w.focus();this._window=w;if(BiBrowserCheck.moz)setTimeout(function(){w.document.location.href=uri;});}else {document.location.href=uri;if(this._focusOnLoad)window.focus();this._window=window;}return true;};BiLauncher._toPixel=function(s,sAxis){if(String(s).indexOf("%")!=-1){var n=Number(s.replace(/\%/g,""));return n/100*(sAxis=="x"?screen.availWidth:screen.availHeight);}return s;};BiLauncher._getAttr=function(el,name,def,tp){var res;if(!el||!el.getAttribute(name))res=def;else res=el.getAttribute(name);if(tp)return BiLauncher._toPixel(res,tp);return res;};function biExec(sRootPath,sAdfRelPath,bUseCurrentWindow){var args=[sAdfRelPath];for(var i=3;i<arguments.length;i++)args.push(arguments[i]);var l=new BiLauncher(sRootPath);l.setAdfPath(sAdfRelPath);l.setNewWindow(!bUseCurrentWindow);var ok=l.launch.apply(l,args);if(!ok)alert(l.getErrorMessage());return ok;}function BiAbstractLoader(){if(_biInPrototype)return;BiEventTarget.call(this);}_p=_biExtend(BiAbstractLoader,BiEventTarget,"BiAbstractLoader");_p._async=true;_p._supportsSync=false;_p._loading=false;_p._loaded=false;_p._error=false;BiAbstractLoader.addProperty("async",Function.READ_WRITE);BiAbstractLoader.addProperty("supportsSync",Function.READ_WRITE);_p.load=function(){throw new Error("load not implemented");};_p.abort=function(){throw new Error("abort not implemented");};_p.getLoaded=function(){throw new Error("getLoaded not implemented");};_p.getLoading=function(){throw new Error("getLoaded not implemented");};_p.getError=function(){throw new Error("getError not implemented");};_p.dispose=function(){if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);};function BiTextLoader(){if(_biInPrototype)return;BiAbstractLoader.call(this);this._xmlHttp=new BiXmlHttp();var oThis=this;this.__onreadystatechange=function(){oThis._onreadystatechange();};}_p=_biExtend(BiTextLoader,BiAbstractLoader,"BiTextLoader");_p._method="GET";_p._async=true;_p._uri=null;_p._user="";_p._password="";_p._loadCount=0;BiTextLoader.load=function(oUri){var tl=new BiTextLoader();tl.setAsync(false);tl.load(oUri);var s=tl.getText();tl.dispose();return s;};BiTextLoader.addProperty("method",Function.READ_WRITE);BiTextLoader.addProperty("uri",Function.READ);_p.setUri=function(oUri){if(oUri instanceof BiUri){this._uri=oUri;}else {this._uri=new BiUri(application.getAdfPath(),oUri);}};BiTextLoader.addProperty("user",Function.READ_WRITE);BiTextLoader.addProperty("password",Function.READ_WRITE);_p.load=function(oUri){this.open("GET",oUri||this._uri,this._async);this.send();};_p.post=function(oUri,oXmlDocument){this.open("POST",oUri||this._uri,this._async);this.send(oXmlDocument);};_p.open=function(sMethod,oUri,bAsync,sUser,sPassword){this._method=sMethod;this.setUri(oUri);this._async=bAsync!=null?bAsync:true;this._user=sUser;this._password=sPassword;this._xmlHttp.abort();this._xmlHttp.onreadystatechange=this.__onreadystatechange;this._xmlHttp.open(this._method,String(this._uri),this._async,this._user,this._password);};_p.send=function(oObject){this._loadCount=0;this._aborted=false;this._xmlHttp.setRequestHeader("Accept-Encoding","gzip, deflate");this._xmlHttp.send(oObject);if(!this._async&&BiBrowserCheck.moz){this._onload();}};_p.abort=function(){this._aborted=true;this._xmlHttp.abort();};_p.getLoaded=function(){return this._xmlHttp.readyState==4;};_p.getLoading=function(){return this._xmlHttp.readyState>0&&this._xmlHttp.readyState<4;};_p.getText=function(){return String(this._xmlHttp.responseText);};_p.getXmlHttp=function(){return this._xmlHttp;};_p.getError=function(){if(!this.getLoaded())return false;var s=this.getUri().getScheme();if(s=="http"||s=="https"){return this._xmlHttp.status!=200;}return this._xmlHttp.status!=0;};_p.dispose=function(){if(this._disposed)return;BiAbstractLoader.prototype.dispose.call(this);delete this.__onreadystatechange;delete this._xmlHttp.onreadystatechange;delete this._xmlHttp;this.disposeFields("_uri");};_p._onreadystatechange=function(){if(this._xmlHttp&&this._xmlHttp.readyState==4){if(this._loadCount==0){this._loadCount++;this._onload();}}};_p._onload=function(){if(!this._aborted)this.dispatchEvent("load");};function BiXmlLoader(){if(_biInPrototype)return;BiTextLoader.call(this);}_p=_biExtend(BiXmlLoader,BiTextLoader,"BiXmlLoader");BiXmlLoader.load=function(oUri){var xl=new BiXmlLoader();xl.setAsync(false);xl.load(oUri);var doc=xl.getDocument();xl.dispose();return doc;};_p.getDocument=function(){return this.getXmlHttp().responseXML;};_p.getError=function(){return this.getLoaded()&&(BiTextLoader.prototype.getError.call(this)||this.getDocument().parseError.errorCode!=0);};_p._onload=function(){if(BiBrowserCheck.ie&&this.getUri().getScheme()=="file"&&!this.getError()){var s=this.getText();s=s.replace(/<\?xml[^\?]*\?>/,"");var d=this.getXmlHttp().responseXML;d.loadXML(s);}BiTextLoader.prototype._onload.call(this);};function BiL10nLoader(sLanguage,sDefaultLanguage,oUri,sPrefix){if(_biInPrototype)return;BiXmlLoader.call(this);this._async=true;this._language=application.getStringBundle().getLanguage();this._defaultLanguage=sDefaultLanguage||"en";this._prefix=sPrefix||application._uriParams.getParam("AdfName");this._uri=oUri;this.addEventListener("load",this._interpret);}_p=_biExtend(BiL10nLoader,BiXmlLoader,"BiL10nLoader");_p._disposed=false;_p.__loaded=false;BiL10nLoader.addProperty("language",Function.READ_WRITE);BiL10nLoader.addProperty("defaultLanguage",Function.READ_WRITE);BiL10nLoader.addProperty("prefix",Function.READ_WRITE);_p._load=function(sLanguage){var lang;var stop=false;for(;!stop;){if(!lang)lang=sLanguage;else if(lang.length>2)lang=lang.substring(0,2);else {lang=this._defaultLanguage;stop=true;}var name=this._prefix+"_"+lang+".xml";var uri;if(!this._uri)uri=new BiUri(application.getAdfPath(),name);else uri=new BiUri(this._uri,name);try{BiXmlLoader.prototype.load.call(this,uri);stop=true;this._language=lang;}catch(err){if(stop)this.__loaded=true;}}};_p.load=function(sLanguage){this._load(sLanguage||this._language);};_p.getLoaded=function(){return this.__loaded;};_p._readL10nDoc=function(oDocument){BiXmlDocument.setNamespaces(oDocument,{l10n:"http://www.bindows.net/xmlns/l10n"});var nl=oDocument.selectNodes("l10n:L10n");if(nl){for(var i=0;i<nl.length;i++){var n=nl[i];var lang=n.getAttribute("language")||this._language;if(lang){var templates=application.getStringBundle().getBundle(lang);var tl=n.selectNodes("l10n:Template");if(tl){for(var j=0;j<tl.length;j++){var t=tl[j];templates[t.getAttribute("name")]=t.getAttribute("text");}application.getStringBundle().addBundle(lang,templates);}}}}};_p._interpret=function(){var doc=this.getDocument();if(doc&&doc.documentElement){this._readL10nDoc(doc);this.__loaded=true;}};function BiHashTable(){if(_biInPrototype)return;BiObject.call(this);this._hash={};this._count=0;this._addCount=0;}_p=_biExtend(BiHashTable,BiObject,"BiHashTable");_p.add=function(key,val){if(!this.hasKey(key)){this._hash[key]=val;this._count++;this._addCount++;}};_p.remove=function(key){if(this.hasKey(key)){delete this._hash[key]; --this._count;if(BiBrowserCheck.ie&&this._addCount>this._count*4){this._recreate();}}};_p.clear=function(){this._hash={};this._count=0;this._addCount=0;};_p.item=function(key){if(this.hasKey(key)){return this._hash[key];}return undefined;};_p.hasKey=function(key){return this._hash.hasOwnProperty(key);};_p.getKeys=function(){var res=[];for(var k in this._hash)if(this._hash.hasOwnProperty(k)){res.push(k);}return res;};_p.getValues=function(){var res=[];for(var k in this._hash)if(this._hash.hasOwnProperty(k)){res.push(this._hash[k]);}return res;};_p.isEmpty=function(){return this._count==0;};_p._recreate=function(){var tmp={};for(var k in this._hash)if(this._hash.hasOwnProperty(k)){tmp[k]=this._hash[k];}this._hash=tmp;this._addCount=this._count;};BiHashTable.addProperty("count",Function.READ);_p.dispose=function(){if(this._disposed)return;BiObject.prototype.dispose.call(this);delete this._hash;};function BiScriptLoaderQueue(){if(_biInPrototype)return;BiEventTarget.call(this);this._items=[];this._uris={};}_p=_biExtend(BiScriptLoaderQueue,BiEventTarget,"BiScriptLoaderQueue");_p._async=true;BiScriptLoaderQueue.addProperty("async",Function.READ_WRITE);_p._allExecuted=true;_p.add=function(oUri){var sUri=String(oUri);if(sUri in this._uris)return;this._allExecuted=false;var tl=new BiTextLoader();tl.setUri(oUri);tl.addEventListener("load",this._onProgress,this);this._uris[sUri]=true;this._items.push({src:oUri,textLoader:tl});};_p.addInline=function(sText){this._allExecuted=false;this._items.push({text:sText});};_p.load=function(){if(this._getAllLoaded()){this._onAllLoaded();}else {for(var i=0;i<this._items.length;i++)if(this._items[i].textLoader){this._items[i].textLoader.setAsync(this._async);this._items[i].textLoader.load();}if(this._getAllLoaded())this._onAllLoaded();}};_p.abort=function(){for(var i=0;i<this._items.length;i++)if(this._items[i].textLoader)this._items[i].textLoader.abort();};_p.getLoaded=function(){if(this._allExecuted)return true;return this._allExecuted&&this._getAllLoaded();};_p._getAllLoaded=function(){var items=this._items;var tl;for(var i=0;i<items.length;i++){tl=items[i].textLoader;if(tl&&!tl.getLoaded())return false;}return true;};_p.getLoadedCount=function(){if(this.getLoaded())return this.getScriptCount();var n=0;var items=this._items;var tl;for(var i=0;i<items.length;i++){tl=items[i].textLoader;if(!tl||tl.getLoaded())n++;}return n;};_p.getScriptCount=function(){return this._items.length;};_p._onProgress=function(e){if(e.getTarget().getError()){throw new Error('Error loading file "'+e.getTarget().getUri()+'"');}if(this._getAllLoaded())this._onAllLoaded();else this.dispatchEvent("progress");};_p._onAllLoaded=function(){if(this._allExecuted||this._errorLoading)return;this.dispatchEvent("progress");var items=this._items;for(var i=0;i<items.length;i++)if(!items[i].executed){if(items[i].textLoader){try{this.execScript(items[i].textLoader.getText());items[i].executed=true;}catch(ex){this._errorLoading=true;throw ex;}}else {try{this.execScript(items[i].text);items[i].executed=true;}catch(ex){this._errorLoading=true;ex.text=items[i].text;throw ex;}}}this._allExecuted=true;this.dispatchEvent("load");this._uris={};};_p.dispose=function(){if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);if(this._items){for(var i=0;i<this._items.length;i++){if(this._items[i].textLoader)this._items[i].textLoader.dispose();this._items[i].textLoader=null;this._items[i].text=null;this._items[i].src=null;this._items[i]=null;}delete this._items;}};_p.execScript=function(s){if(!s||s.length==0)return;if(window.execScript){window.execScript(s);}else {window.eval(s);}};function BiXmlResourceParser(){if(_biInPrototype)return;BiXmlLoader.call(this);this._componentsById=new BiHashTable();}_p=_biExtend(BiXmlResourceParser,BiXmlLoader,"BiXmlResourceParser");_p._disposed=false;_p._autoNameMapping=false;BiXmlResourceParser.addProperty("autoNameMapping",Function.READ_WRITE);_p._rootNode=null;BiXmlResourceParser.getClassFromUri=function(oUri){return BiXmlResourceParser.getClassFromDocument(BiXmlLoader.load(oUri));};BiXmlResourceParser.getClassFromDocument=function(oDoc){return BiXmlResourceParser.getClassFromNode(oDoc.documentElement);};BiXmlResourceParser.getClassFromNode=function(oNode){if(oNode==null||oNode.nodeType!=1)return null;var tagName=oNode.localName||oNode.baseName;var constr=window["Bi"+tagName]||window[tagName];if(typeof constr=="function"){_biInPrototype=true;var p=new constr();_biInPrototype=false;var newConstr=function(){if(_biInPrototype)return;constr.apply(this,arguments);this._xmlResourceParser=new BiXmlResourceParser();this._xmlResourceParser.setRootNode(oNode);this._xmlResourceParser.processAttributes(this,oNode);this._xmlResourceParser.processChildNodes(this,oNode);if(typeof p.initialize=="function")p.initialize.apply(this,arguments);};newConstr.prototype=p;p.dispose();p._disposed=false;p.dispose=function(){if(this.getDisposed())return;constr.prototype.dispose.call(this);this._xmlResourceParser.dispose();delete this._xmlResourceParser;};p.getComponentById=function(sId){return this._xmlResourceParser.getComponentById(sId);};p.getXmlResourceParser=function(){return this._xmlResourceParser;};p.initialize=p.initialize||Function.EMPTY;application.addEventListener("dispose",function(){newConstr=null;oNode=null;});return newConstr;}throw new Error('BiXmlResourceParser getClassFromNode. Cannot create object from "'+oNode.tagName+'"');};BiXmlResourceParser.addProperty("rootNode",Function.WRITE);_p.getRootNode=function(){if(this._rootNode){return this._rootNode;}else {if(this.getLoaded())return this.getDocument();return null;}};_p.fromNode=function(oNode){if(oNode==null||oNode.nodeType!=1)return null;var id=oNode.getAttribute("id");var c;if(id&&(c=this._componentsById.item(id))){if(c.getDisposed()){this._removeObject(c);}else {return c;}}var tagName=oNode.localName||oNode.baseName;var o;var constr=window["Bi"+tagName]||window[tagName];if(typeof constr=="function"){o=new constr();this.processAttributes(o,oNode);this.processChildNodes(o,oNode);return o;}throw new Error('BiXmlResourceParser fromNode. Cannot create object from "'+oNode.tagName+'"');};_p._removeObject=function(o){var id=o.getId();this._componentsById.remove(id);if(this._autoNameMapping){try{delete window[id];}catch(ex){window[id]=null;}}};_p._addObject=function(o,id){this._componentsById.add(id,o);if(this._autoNameMapping){window[id]=o;}var orgDispose=o.dispose;var oResParser=this;o.dispose=function(){if(oResParser)oResParser._removeObject(this);if(orgDispose)orgDispose.call(this);orgDispose=null;oResParser=null;};};_p.processAttributes=function(o,oNode){var attrs=oNode.attributes;var l=attrs.length;var name,value,parts,className,setterName,constr;for(var i=0;i<l;i++){name=attrs[i].nodeName;value=attrs[i].nodeValue;if(name=="xmlns"||name.indexOf(":")>0)continue ;if(name.indexOf(".")>0){parts=name.split(".");className=parts[0];setterName="set"+parts[1].capitalize();constr=window["Bi"+className]||window[className];if(typeof constr=="function"){if(typeof constr[setterName]=="function"){constr[setterName](o,value);}else throw new Error('No such attached property "'+name+'"');}else throw new Error('No such class: "'+className+'"');}else o.setAttribute(name,value,this);if(name=="id")this._addObject(o,value);}};_p.processChildNodes=function(obj,oNode){var tagName=oNode.localName||oNode.baseName;var re=new RegExp("^"+tagName+"\\.(.+)$");var cs=oNode.childNodes;var l=cs.length;var s;var emptyRe=/^\s*$/;for(var i=0;i<l;i++)if(re.test(cs[i].localName||cs[i].baseName)){var propertyName=RegExp.$1;var cs2=cs[i].childNodes;var l2=cs2.length;for(var j=0;j<l2;j++)if(cs2[j].nodeType==3){s=cs2[j].data;if(emptyRe.test(s))continue ;obj.setAttribute(propertyName,s,this);break;}else if(cs2[j].nodeType==1){obj.setProperty(propertyName,this.fromNode(cs2[j]));break;}}else obj.addXmlNode(cs[i],this);};_p.getComponentById=function(sId){var o=this._componentsById.item(sId);if(o){if(o.getDisposed())this._removeObject(o);else return o;}if(this.getLoaded()){var rn=this.getRootNode();var n=rn.selectSingleNode("//*[@id='"+sId+"']");if(!n)return null;o=this.fromNode(n);if(o)return o;}return null;};_p.getLoaded=function(){return this._rootNode!=null||BiXmlLoader.prototype.getLoaded.call(this);};_p.dispose=function(){if(this.getDisposed())return;BiXmlLoader.prototype.dispose.call(this);var vs=this._componentsById.getValues();for(var i=0;i<vs.length;i++)this._removeObject(vs[i]);this._componentsById.dispose();delete this._componentsById;delete this._rootNode;};function BiResourceLoader(){if(_biInPrototype)return;BiEventTarget.call(this);this._resources=[];this._resourcesById=new BiHashTable();this._duplicateScripts=new BiHashTable();}_p=_biExtend(BiResourceLoader,BiEventTarget,"BiResourceLoader");_p._lastLoaded=-1;_p._lastStarted=-1;_p._count=0;_p._loaded=false;_p._autoNameMapping=false;BiResourceLoader.addProperty("autoNameMapping",Function.READ);_p.setAutoNameMapping=function(b){this._autoNameMapping=b;if(this._xmlResourceParser)this._xmlResourceParser.setAutoNameMapping(b);};_p.getResourceById=function(sId){if(this._resourcesById.hasKey(sId))return this._resourcesById.item(sId).object;return null;};_p.addResource=function(sType,oData,sId){var lastRes=this._resources[this._resources.length-1];if((sType=="script"||sType=="inlinescript")&&!(lastRes instanceof BiScriptLoaderQueue)){lastRes=new BiScriptLoaderQueue();lastRes.addEventListener("load",this.load,this);lastRes.addEventListener("progress",this._onprogress,this);lastRes.addEventListener("error",this._onerror,this);this._resources.push(lastRes);}if(sType=="script"){if(!this._duplicateScripts.hasKey(oData)){lastRes.add(oData);this._duplicateScripts.add(oData,true);this._count++;}}else if(sType=="inlinescript"){lastRes.addInline(oData);this._count++;}else {var item={name:sType,node:oData,id:sId};this._resources.push(item);if(sId)this._resourcesById.add(sId,item);this._count++;}};_p._createGeneralObject=function(oItem){var node=oItem.node;if(!this._xmlResourceParser){this._xmlResourceParser=new BiXmlResourceParser();this._xmlResourceParser.setRootNode(node.parentNode);this._xmlResourceParser.setAutoNameMapping(this._autoNameMapping);}var o=this._xmlResourceParser.fromNode(node);oItem.object=o;oItem.node=null;if(o instanceof BiEventTarget){o.addEventListener("load",this.load,this);o.addEventListener("error",this._onerror,this);}if(typeof o.load=="function")o.load();};_p.load=function(){if(this._loaded)return;var allLoaded=true;if(this._lastStarted==-1){allLoaded=false;this._lastStarted=0;this._startLoad(this._resources[0]);}else {for(var i=this._lastStarted;i<this._resources.length;i++){var obj=this._resources[i];if(this._isLoaded(obj)){this._lastLoaded=i;this._removeListeners(obj);this._onprogress();continue ;}else {if(i==this._lastStarted){allLoaded=false;break;}this._lastStarted=i;this._startLoad(obj);if(!this._isLoaded(obj)){allLoaded=false;break;}else {this._lastLoaded=i;this._removeListeners(obj);this._onprogress();}}}}if(allLoaded)this._onAllLoaded();};_p._startLoad=function(obj){if(obj instanceof BiScriptLoaderQueue)obj.load();else this._createGeneralObject(obj);};_p._isLoaded=function(obj){if(obj instanceof BiScriptLoaderQueue)return obj.getLoaded();else if(obj.object==null)return false;else if(typeof obj.object.getLoaded=="function")return obj.object.getLoaded();else return true;};_p._removeListeners=function(obj){if(obj instanceof BiScriptLoaderQueue){obj.removeEventListener("load",this.load,this);obj.removeEventListener("progress",this._onprogress,this);obj.removeEventListener("error",this._onerror,this);}else if(obj.object!=null&&obj.object instanceof BiEventTarget){obj.object.removeEventListener("load",this.load,this);obj.object.removeEventListener("error",this._onerror,this);}};_p.abort=function(){var items=this._resources;var l=items.length;for(var i=0;i<l;i++)if(items[i] instanceof BiScriptLoaderQueue)items[i].abort();else if(items[i].object&&typeof items[i].object.abort=="function")items[i].object.abort();};_p.getLoaded=function(){return this._lastLoaded==this._resources.length-1;};_p.getLoadedCount=function(){var n=0;var items=this._resources;var l=items.length;for(var i=0;i<l;i++)if(items[i] instanceof BiScriptLoaderQueue)n=n+items[i].getLoadedCount();else if(this._isLoaded(items[i]))n++;return n;};BiResourceLoader.addProperty("count",Function.READ);_p.dispose=function(){if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);var item;for(var i=this._resources.length-1;i>=0; --i){item=this._resources[i];if(item instanceof BiScriptLoaderQueue)item.dispose();else if(item.object&&typeof item.object.dispose=="function")item.object.dispose();item.object=null;item.uri=null;item.constr=null;}this._resourcesById.dispose();if(this._duplicateScripts)this._duplicateScripts.dispose();delete this._resources;delete this._resourcesId;delete this._duplicateScripts;};_p._onprogress=function(){if(this._loaded)return;this.dispatchEvent("progress");};_p._onerror=function(e){var t=e.getTarget();throw new Error("Error loading "+t+"\nURI: "+t.getUri());};_p._onAllLoaded=function(){if(this._loaded)return;this._loaded=true;this._onprogress();this.dispatchEvent("load");if(this._duplicateScripts)this._duplicateScripts.clear();};function BiStringBundle(){if(_biInPrototype)return;BiEventTarget.call(this);this._bundles={};this._language=this._lastUserLang=this.getUserLanguage();this._majorLanguage=this.getMajorLanguage();}_p=_biExtend(BiStringBundle,BiEventTarget,"BiStringBundle");BiStringBundle.formatString=function(sPattern,args){var _args=arguments;return sPattern.replace(/\%(\d+)/g,function(s,n){return _args[n];});};_p.setLanguage=function(s){if(s!=this._language){this._language=s;this._majorLanguage=null;this.dispatchEvent("change");}};_p.getLanguage=function(){return this._language;};_p.getLanguages=function(){var res=[];for(var s in this._bundles)res.push(s);return res;};_p.getStringKeys=function(sLanguage){var b=this.getBundleForLanguage(sLanguage);var res=[];for(var key in b)res.push(key);return res;};_p.getMajorLanguage=function(){if(this._majorLanguage!=null)return this._majorLanguage;return this._majorLanguage=this._language.split("-")[0];};_p.getString=function(sStringId,sLanguage){return this._getString(sLanguage,sStringId);};_p.getFormattedString=function(sStringId,args){var _args=[];_args[0]=this._getString(null,sStringId);for(var i=1;i<arguments.length;i++)_args[i]=arguments[i];return BiStringBundle.formatString.apply(BiStringBundle,_args);};_p.addBundle=function(sLanguage,oStringMap){this._bundles[sLanguage]=oStringMap;if(sLanguage==this._language)this.dispatchEvent("change");};_p.appendBundle=function(sLanguage,oStringMap){if(sLanguage in this._bundles){var o=this._bundles[sLanguage];for(var key in oStringMap)o[key]=oStringMap[key];}else {this._bundles[sLanguage]=oStringMap;}};_p.removeBundle=function(sLanguage){delete this._bundles[sLanguage];};_p.getUserLanguage=function(){return navigator.userLanguage||navigator.language;};_p.getBundleForLanguage=function(sLanguage){if(sLanguage){if(sLanguage in this._bundles)return this._bundles[sLanguage];var p0=sLanguage.split("-")[0];if(p0 in this._bundles)return this._bundles[p0];}if(this.getLanguage() in this._bundles)return this._bundles[this.getLanguage()];if(this.getMajorLanguage() in this._bundles)return this._bundles[this.getMajorLanguage()];if("en" in this._bundles)return this._bundles.en;return {};};_p.getBundle=function(sLanguage){if(!sLanguage)sLanguage=this._language;if(sLanguage){if(sLanguage in this._bundles)return this._bundles[sLanguage];}return {};};_p._getString=function(sLang,sKey){var bs=this._bundles;if(sLang){if(sLang in bs&&sKey in bs[sLang])return bs[sLang][sKey];var p0=sLang.split("-")[0];if(p0 in bs&&sKey in bs[p0])return bs[p0][sKey];}var l;if((l=this.getLanguage()) in bs&&sKey in bs[l])return bs[l][sKey];if((l=this.getMajorLanguage()) in bs&&sKey in bs[l])return bs[l][sKey];if("en" in bs&&sKey in bs.en)return bs.en[sKey];return null;};_p.getBundles=function(){var res=[];for(var s in this._bundles)res.push(this._bundles[s]);return res;};_p.dispose=function(){if(this.getDisposed())return;this._bundles=null;BiEventTarget.prototype.dispose.call(this);};BiStringBundle._stringBundleMacro=function(p,fOnChange){if(fOnChange){p.setStringBundle=function(sb){if(this._stringBundle!=sb){if(sb&&!this._stringBundle)application.getStringBundle().removeEventListener("change",fOnChange,this);if(this._stringBundle)this._stringBundle.removeEventListener("change",fOnChange,this);this._stringBundle=sb;if(this._stringBundle)this._stringBundle.addEventListener("change",fOnChange,this);fOnChange.call(this);}};}else {p.setStringBundle=function(sb){this._stringBundle=sb;};}p._getString=function(s){var sb=this._stringBundle||application.getStringBundle();return sb.getFormattedString.apply(sb,arguments);};};function LoadingStatus(){this._element=document.createElement("DIV");this._element.className="bi-loading-status";this._htmlElement=document.createElement("DIV");this._htmlElement.className="bi-loading-status-html";this._element.appendChild(this._htmlElement);this._textElement=document.createElement("DIV");this._textElement.className="bi-loading-status-text";this._element.appendChild(this._textElement);this._pbElement=document.createElement("DIV");this._pbElement.className="bi-loading-status-progress-bar";this._element.appendChild(this._pbElement);this._fillElement=document.createElement("DIV");this._pbElement.appendChild(this._fillElement);document.body.appendChild(this._element);var oThis=this;this._onresize=function(){oThis.fixSize();};if(BiBrowserCheck.ie)window.attachEvent("onresize",this._onresize);else window.addEventListener("resize",this._onresize,false);this.fixSize();this.setHtmlText(LoadingStatus._defaultHtml);}_p=LoadingStatus.prototype;_p.dispose=function(nValue){if(this._disposed)return;if(BiBrowserCheck.ie)window.detachEvent("onresize",this._onresize);else window.removeEventListener("resize",this._onresize,false);this._element.style.filter="none";if(document.body&&!(application&&application._disposed))document.body.removeChild(this._element);this._element=this._htmlElement=this._pbElement=this._textElement=this._fillElement=this._onresize=null;this._disposed=true;};_p.setValue=function(nValue){this._fillElement.style.width=(nValue==null?"10":nValue)+"%";};_p.setText=function(s){for(;this._textElement.hasChildNodes();)this._textElement.removeChild(this._textElement.lastChild);this._textElement.appendChild(document.createTextNode(s));};_p.fixSize=function(){this._element.style.left=Math.max(0,(document.body.clientWidth-this._element.offsetWidth)/2)+"px";this._element.style.top=Math.max(0,(document.body.clientHeight-this._element.offsetHeight)/2)+"px";};_p.setHtmlText=function(sHtml,sStyle){if(typeof application!="undefined"){sHtml=sHtml.replace("%VERSION%",application.getVersion());}this._htmlElement.innerHTML=sHtml;if(sStyle)this._htmlElement.style.cssText=sStyle;};_p.setStyle=function(sStyle){if(!/visibility/i.test(sStyle)&&this._element.style.visibility!=""){sStyle="visibility:"+this._element.style.visibility+";"+sStyle;}this._element.style.cssText=sStyle;this.fixSize();};_p.setStatusTextStyle=function(sStyle){if(sStyle)this._textElement.style.cssText=sStyle;};_p.setProgressBarStyle=function(sStyle){if(sStyle)this._pbElement.style.cssText=sStyle;};_p.setVisible=function(b){this._element.style.visibility=b?"visible":"hidden";};LoadingStatus._defaultHtml='<div style="position:absolute;top: 5px;left:10px;width:280px;"><h1 style="font-size:350%;margin:0;">Bindows&#8482;<span style="position:relative;left:-2.7em;color:blue;font-size:28%;font-weight:bold;white-space:nowrap;">for BarracudaDrive</span></h1><p style="font-size:80%;margin:5px 0;">Bindows&#8482; belongs to MB Technologies (Georgia, USA). All rights reserved. See the BarracudaDrive About page for licensing information.</p></div><div style="position:absolute;bottom:5px;left:10px">Version %VERSION%</div><div style="position:absolute;bottom:5px;right:10px">&#x00A9; 2003-2007 MB Technologies Inc.</div>';function BiSet(){if(_biInPrototype)return;this._items=new BiHashTable();}_p=_biExtend(BiSet,BiObject,"BiSet");_p.add=function(o){this._items.add(BiObject.toHashCode(o),o);};_p.remove=function(o){this._items.remove(BiObject.toHashCode(o));};_p.contains=function(o){return o&&this._items.hasKey(BiObject.toHashCode(o));};_p.clear=function(){this._items.clear();};_p.toArray=function(){return this._items.getValues();};_p.getValues=function(){return this._items.getValues();};_p.dispose=function(){if(this._disposed)return;BiObject.prototype.dispose.call(this);this._items.dispose();delete this._items;};function BiThemeManager(){if(_biInPrototype)return;if(BiThemeManager._singleton)return BiThemeManager._singleton;BiEventTarget.call(this);this._allSet=new BiSet();this._hoverSet=new BiSet();this._activeSet=new BiSet();this._stateHash=new BiHashTable();this._themes=new BiHashTable();return BiThemeManager._singleton=this;}_p=_biExtend(BiThemeManager,BiEventTarget,"BiThemeManager");_p.setClassAppearance=function(fClass,sName,bManual){this.setAppearance(fClass.prototype,sName,bManual);};_p.setAppearance=function(oComp,sName,bManual){var t=this.getDefaultTheme();if(bManual!=null)oComp._themeManualInteractivity=Boolean(bManual);};_p.addAppearanceListeners=function(oComp){var app=oComp.getAppearance();var states=this.getAppearanceStates(app);this._addAppearanceListeners(oComp,states);};_p._addAppearanceListeners=function(oComp,oStates){if(Object.isEmpty(oStates)||oComp._themeManualInteractivity)return;var win=application.getWindow();if(!win)return;var hash=oStates;if("hover" in hash){oComp.addEventListener("mouseover",this._handleMouseOver,this);oComp.addEventListener("mouseout",this._handleMouseOut,this);}if("active" in hash){oComp.addEventListener("mousedown",this._handleMouseDown,this);}if("focus" in hash){oComp.addEventListener("focusin",this._handleFocusIn,this);oComp.addEventListener("focusout",this._handleFocusOut,this);}if("checked" in hash){oComp.addEventListener("change",this._handleChange,this);}if("disabled" in hash){oComp.addEventListener("enabledchanged",this._handleEnabledChanged,this);}};_p.removeAppearanceListeners=function(oComp){var app=oComp.getAppearance();var states=this.getAppearanceStates(app);this._removeAppearanceListeners(oComp,states);};_p._removeAppearanceListeners=function(oComp,oStates){if(Object.isEmpty(oStates)||oComp._themeManualInteractivity)return;var win=application.getWindow();if(!win)return;var hash=oStates;if("hover" in hash){oComp.removeEventListener("mouseover",this._handleMouseOver,this);oComp.removeEventListener("mouseout",this._handleMouseOut,this);}if("active" in hash){oComp.removeEventListener("mousedown",this._handleMouseDown,this);if(this._addedMouseUpListeners){win.removeEventListener("mouseup",this._handleMouseUp,this);this._addedMouseUpListeners=false;}}if("focus" in hash){oComp.removeEventListener("focusin",this._handleFocusIn,this);oComp.removeEventListener("focusout",this._handleFocusOut,this);}if("checked" in hash){oComp.removeEventListener("change",this._handleChange,this);}if("disabled" in hash){oComp.removeEventListener("enabledchanged",this._handleEnabledChanged,this);}};_p.addAppearance=function(oComp){this.applyAppearance(oComp);this.addAppearanceListeners(oComp);var app=oComp.getAppearance();var states=this.getAppearanceStates(app);if(Object.isEmpty(states))return;var hash=states;var changed=false;if("focus" in hash&&(oComp.getFocused()||oComp.getContainsFocus())){this.addState(oComp,"focus");changed=true;}if("selected" in hash&&oComp.getSelected()){this.addState(oComp,"selected");changed=true;}if("checked" in hash&&oComp.getChecked&&oComp.getChecked()){this.addState(oComp,"checked");changed=true;}if("disabled" in hash&&!oComp.getEnabled()){this.addState(oComp,"disabled");changed=true;}if(changed)this.applyAppearance(oComp);};_p.getAppearanceStates=function(sName){var t=this.getDefaultTheme();return t.getAppearanceStates(sName);};_p.getThemeStates=function(oComp){return oComp._themeStates;};_p.getCurrentState=function(oComp){return this._stateHash.item(oComp.toHashCode());};_p.getHasInteractiveTheme=function(oComp){return Object.isEmpty(oComp._themeStates);};_p.getAppearanceTag=function(oComp){var app=oComp.getAppearance();var state=this._stateHash.item(oComp.toHashCode());if(app)return this._getAppearanceTag(app,state);return "";};_p._getAppearanceTag=function(sName,oStates){var s=" "+sName;for(var pseudo in oStates)s=s+(" "+sName+"-"+pseudo);return s;};_p.applyAppearance=function(oComp){if(!oComp.getDisposed()){oComp.setHtmlProperty("className",oComp._cssClassName+this.getAppearanceTag(oComp));}};_p.addState=function(oComp,sPseudo){var hc=oComp.toHashCode();if(!this._stateHash.hasKey(hc))this._stateHash.add(hc,{});this._stateHash.item(hc)[sPseudo]=true;};_p.removeState=function(oComp,sPseudo){var hc=oComp.toHashCode();if(this._stateHash.hasKey(hc))delete this._stateHash.item(hc)[sPseudo];};_p.setStateValue=function(oComp,sPseudo,bAdd){if(bAdd)this.addState(oComp,sPseudo);else this.removeState(oComp,sPseudo);};_p.addTheme=function(oTheme){var n=oTheme.getName();if(!this._themes.hasKey(n)){this._themes.add(n,oTheme);oTheme._create();if(oTheme.getName()==this._defaultThemeName){this._defaultThemeName="";this.setDefaultTheme(oTheme);}}else if(this._themes.item(n)!=oTheme){throw new Error("Cannot add another theme with the same name: "+n);}};_p.removeTheme=function(oTheme){if(oTheme.getDefault())oTheme.setDefault(false);this._themes.remove(oTheme.getName());};_p.getThemes=function(){return this._themes.getValues();};_p.getDefaultTheme=function(){if(this._defaultTheme)return this._defaultTheme;return this._defaultTheme=this._themes.item(this._defaultThemeName);};_p.setDefaultTheme=function(oTheme){if(oTheme!=this._defaultTheme){this._setDefaultThemeByName(oTheme.getName());this.dispatchEvent("themechanged");}};_p._setDefaultThemeByName=function(sName){if(this._defaultThemeName!=sName){this._defaultThemeName=sName;if(this._themes.hasKey(sName)){var t=this._themes.item(sName);this._defaultTheme=t;var ts=this._themes.getValues();for(var i=0;i<ts.length;i++)ts[i].setDefault(t==ts[i]);if(window.BiComponent&&BiComponent.invalidateAll)BiComponent.invalidateAll();if(window.BiMenu&&BiMenu.invalidateAll)BiMenu.invalidateAll();}}};_p.addCssRule=function(sSelector,sStyle){if(!sSelector||!sStyle){return;}if(!this._sharedStyleSheet){this._sharedStyleSheet=BiThemeManager._createStyleElement();this._sharedStyleSheet.id="bi-theme-shared-style-sheet";}var ss;if(BiBrowserCheck.ie){ss=document.styleSheets["bi-theme-shared-style-sheet"];ss.addRule(sSelector,sStyle);}else {ss=this._sharedStyleSheet.sheet;ss.insertRule(sSelector+"{"+sStyle+"}",ss.cssRules.length);}};_p.removeCssRule=function(sSelector){if(sSelector==null||!this._sharedStyleSheet){return;}var ss,rules,l,i;if(BiBrowserCheck.ie){ss=document.styleSheets["bi-theme-shared-style-sheet"];rules=ss.rules;l=rules.length;for(i=rules.length-1;i>=0; --i)if(rules[i].selectorText==sSelector){ss.removeRule(i);}}else {ss=this._sharedStyleSheet.sheet;rules=ss.cssRules;l=rules.length;for(i=rules.length-1;i>=0; --i)if(rules[i].selectorText==sSelector){ss.deleteRule(i);}}};BiThemeManager._createStyleElement=function(sCssText,sClassName){var el;if(BiBrowserCheck.ie){var ss=document.createStyleSheet();if(sCssText)ss.cssText=sCssText;el=ss.owningElement;}else {el=document.createElement("STYLE");el.type="text/css";el.appendChild(document.createTextNode(sCssText));var h=document.getElementsByTagName("HEAD")[0];h.appendChild(el);}if(sClassName)el.className=sClassName;return el;};BiThemeManager._createLinkElement=function(sName,oUri,sClassName){var uri=String(oUri);var el=document.createElement("link");el.type="text/css";el.rel="stylesheet";el.href=uri;var h=document.getElementsByTagName("HEAD")[0];h.appendChild(el);el.className=sClassName||"bi-theme-link";el.title=sName;el.disabled=false;return el;};_p._handleMouseDown=function(e){var c=e.getCurrentTarget();this._activeSet.add(c);this.addState(c,"active");this.applyAppearance(c);};_p._handleMouseUp=function(e){var changed=new BiSet();var active=this._activeSet.toArray();var c,i;for(i=0;i<active.length;i++){c=active[i];changed.add(c);this.removeState(c,"active");}this._activeSet.clear();var changed2=changed.toArray();for(i=0;i<changed2.length;i++)if(!changed2[i]._disposed){this.applyAppearance(changed2[i]);}changed.dispose();};_p._handleMouseOver=function(e){var c=e.getCurrentTarget();this._hoverSet.add(c);this.addState(c,"hover");if(this._activeSet.contains(c)){this.addState(c,"active");}this.applyAppearance(c);};_p._handleMouseOut=function(e){var c=e.getCurrentTarget();this._hoverSet.remove(c);this.removeState(c,"active");this.removeState(c,"hover");this.applyAppearance(c);};_p._handleFocusIn=function(e){var c=e.getCurrentTarget();this.addState(c,"focus");this.applyAppearance(c);};_p._handleFocusOut=function(e){var c=e.getCurrentTarget();this.removeState(c,"focus");this.applyAppearance(c);};_p._handleChange=function(e){var c=e.getCurrentTarget();if(c.getChecked&&c.getChecked())this.addState(c,"checked");else this.removeState(c,"checked");this.applyAppearance(c);};_p._handleEnabledChanged=function(e){var c=e.getCurrentTarget();if(c.getEnabled())this.removeState(c,"disabled");else this.addState(c,"disabled");this.applyAppearance(c);};_p.dispose=function(){if(this.getDisposed())return;BiObject.prototype.dispose.call(this);var vs=this._themes.getValues();for(var i=0;i<vs.length;i++)vs[i].dispose();this.disposeFields("_allSet","_hoverSet","_activeSet","_stateHash","_themes");this._sharedStyleSheet=null;delete BiThemeManager._singleton;};function BiTheme(sName){if(_biInPrototype)return;BiObject.call(this);this._appearances={};this._appearanceProperties={};if(sName)this._name=sName;}_p=_biExtend(BiTheme,BiObject,"BiTheme");_p._name="";_p._default=false;BiTheme.addProperty("name",Function.READ);BiTheme.addProperty("default",Function.READ);_p.setDefault=function(b){if(b!=this._default){this._default=b;if(this._created){if(BiBrowserCheck.ie){this._menuStyleEl.disabled=!b;if(b&&window.Menu&&window.Menu.prototype){Menu.prototype.cssText=this.getMenuCss();}}this._linkEl.disabled=!b;}if(b)application.getThemeManager().setDefaultTheme(this);}};_p.addAppearance=function(sAppearanceName,oStates){var hash={};for(var i=0;i<oStates.length;i++)hash[oStates[i]]=true;this._appearances[sAppearanceName]=hash;};_p.removeAppearance=function(sAppearanceName){delete this._appearances[sAppearanceName];};_p.getAppearanceStates=function(sName){return this._appearances[sName]||{};};_p.getAppearanceProperty=function(sName,sPropertyName){if(sName in this._appearanceProperties)return this._appearanceProperties[sName][sPropertyName];return null;};_p.setAppearanceProperty=function(sName,sPropertyName,oValue){if(!(sName in this._appearanceProperties))this._appearanceProperties[sName]={};this._appearanceProperties[sName][sPropertyName]=oValue;};_p._create=function(){if(this._created)return;this._linkEl=application.getAdf()._findLinkElement(this.getName());if(this._linkEl){this._linkEl.disabled=!this.getDefault();}if(BiBrowserCheck.ie){this._menuStyleEl=BiThemeManager._createStyleElement(this.getMenuCss());this._menuStyleEl.disabled=!this.getDefault();}this._created=true;};_p.dispose=function(){if(this.getDisposed())return;BiObject.prototype.dispose.call(this);if(this._linkEl){if(!BiBrowserCheck.moz){this._linkEl.disabled=true;}this._linkEl.onload=null;}this._linkEl=null;if(this._menuStyleEl)this._menuStyleEl.disabled=true;this._menuStyleEl=null;};BiTheme.addProperty("menuCss",Function.READ_WRITE);function BiAdf(){if(_biInPrototype)return;BiXmlLoader.call(this);this._async=true;this._caption="";this._scripts=[];this._linkEls={};this._xmlResourceParser=new BiXmlResourceParser();}_p=_biExtend(BiAdf,BiXmlLoader,"BiAdf");_p._disposed=false;BiAdf.addProperty("caption",Function.READ_WRITE);BiAdf.addProperty("xmlResourceParser",Function.READ);_p.setAutoNameMapping=function(b){if(this._autoNameMapping!=b){this._autoNameMapping=b;if(this._xmlResourceParser)this._xmlResourceParser.setAutoNameMapping(b);var rl=application.getResourceLoader();if(rl)rl.setAutoNameMapping(b);application.setAutoNameMapping(b);}};_p.getAutoNameMapping=function(){return application.getAutoNameMapping();};_p._getChildByName=function(sName,oParent){if(oParent==null)oParent=this.getDocument();if(sName.charAt(0)=="@")return oParent.getAttribute(sName.substring(1));var camelName=sName.charAt(0).toLowerCase()+sName.substring(1);var pascalName=sName.charAt(0).toUpperCase()+sName.substring(1);for(var node=oParent.firstChild;node!=null;node=node.nextSibling)if(node.tagName==camelName||node.tagName==pascalName)return node;return null;};_p._getChildrenByName=function(sName,oParent){if(oParent==null)oParent=this.getDocument();if(sName.charAt(0)=="@")return [oParent.getAttribute(sName.substring(1))];var camelName=sName.charAt(0).toLowerCase()+sName.substring(1);var pascalName=sName.charAt(0).toUpperCase()+sName.substring(1);var children=[];for(var node=oParent.firstChild;node!=null;node=node.nextSibling)if(node.tagName==camelName||node.tagName==pascalName)children.push(node);return children;};_p._selectSingleNode=function(sPath){var node=this.getDocument();var pathParts=sPath.split("/");for(var i=0;i<pathParts.length&&node!=null;i++){var part=pathParts[i];if(part=="")continue ;node=this._getChildByName(part,node);}return node;};_p._interpret=function(){var doc=this.getDocument();this._caption=this._selectSingleNode("/Application/Window/@caption");if(this._caption)document.title=this._caption;var appEl=doc.documentElement;this._xmlResourceParser.processAttributes(application,appEl);this._insertThemeCss();this._createSplashScreen();};_p._addResources=function(){var rl=application.getResourceLoader();rl.setAutoNameMapping(this._autoNameMapping);var n=this._selectSingleNode("/Application/Resources");if(n){var nl=n.childNodes;var l=nl.length;var uri;var systemRootPath=application.getPath();for(var i=0;i<l;i++){if(nl[i].nodeType!=1)continue ;uri=nl[i].getAttribute("uri")||nl[i].getAttribute("src");switch(nl[i].tagName){case "package":case "Package":{if(uri)rl.addResource("script",new BiUri(systemRootPath,uri));else if(nl[i].getAttribute("name")){var uris=application.getPackage(nl[i].getAttribute("name"));for(var j=0;j<uris.length;j++)rl.addResource("script",new BiUri(systemRootPath,uris[j]));}break;}case "script":case "Script":{application._addAccessibilityPackage();if(uri)rl.addResource("script",uri);else if(nl[i].text!=""){rl.addResource("inlinescript",nl[i].text);}break;}default:rl.addResource(nl[i].tagName,nl[i],nl[i].getAttribute("id"));}}}};_p._createSplashScreen=function(){application._loadStatus.setVisible(true);};_p.parseXmlResources=function(){this._xmlResourceParser.setAutoNameMapping(this._autoNameMapping);var windowEl=this._selectSingleNode("/Application/Window");if(!windowEl)return;this._xmlResourceParser.setRootNode(windowEl);var win=application.getWindow();var adfAttrs=["left","right","top","bottom","width","height","centered","resizable","fullScreen"];var temp={};for(var i=0;i<adfAttrs.length;i++)if(windowEl.getAttributeNode(adfAttrs[i])!=null){temp[adfAttrs[i]]=windowEl.getAttribute(adfAttrs[i]);windowEl.removeAttribute(adfAttrs[i]);}this._xmlResourceParser.processAttributes(win,windowEl);this._xmlResourceParser.processChildNodes(win,windowEl);for(var attr in temp){windowEl.setAttribute(attr,temp[attr]);temp[attr]=null;}};_p._insertThemeCss=function(){this._loadTheme("Default",true,new BiUri(application.getPath(),"themes/Default/theme.css"),new BiUri(application.getPath(),"themes/Default/theme.js"));if(application.getAccessibilityMode()){this._loadTheme("AlmostClassic",true,new BiUri(application.getPath(),"themes/AlmostClassic/theme.css"),new BiUri(application.getPath(),"themes/AlmostClassic/theme.js"));}var themes=this._getChildrenByName("Theme",this._selectSingleNode("/Application"));for(var i=0;i<themes.length;i++)this._loadTheme(themes[i].getAttribute("name"),themes[i].getAttribute("default")=="true",themes[i].getAttribute("cssUri"),themes[i].getAttribute("jsUri"));};_p._loadTheme=function(sName,bDefault,sCssUri,sJsUri){var rl=application.getResourceLoader();if(!sCssUri)sCssUri=new BiUri(application.getPath(),"themes/"+sName+"/theme.css");else sCssUri=new BiUri(application.getAdfPath(),sCssUri);if(!sJsUri)sJsUri=new BiUri(application.getPath(),"themes/"+sName+"/theme.js");else sJsUri=new BiUri(application.getAdfPath(),sJsUri);var linkEl=BiThemeManager._createLinkElement(sName,sCssUri);linkEl.disabled=!bDefault;this._linkEls[sName]=linkEl;rl.addResource("script",sJsUri);if(bDefault)application.getThemeManager()._setDefaultThemeByName(sName);};_p._findLinkElement=function(sName){return this._linkEls[sName];};_p.dispose=function(){if(this._disposed)return;BiXmlLoader.prototype.dispose.call(this);for(var n in this._linkEls)delete this._linkEls[n];this.disposeFields("_linkEls","_scripts","_xmlResourceParser");};function BiTimerManager(){if(_biInPrototype)return;if(BiTimerManager._singleton)return BiTimerManager._singleton;BiObject.call(this);this._timers=new BiSet();BiTimerManager._singleton=this;application.addEventListener("dispose",this.dispose,this);}_p=_biExtend(BiTimerManager,BiObject,"BiTimerManager");_p.add=function(oTimer){this._timers.add(oTimer);};_p.remove=function(oTimer){this._timers.remove(oTimer);};_p.dispose=function(){if(this._disposed)return;BiObject.prototype.dispose.call(this);var vs=this._timers.getValues();for(var i=0;i<vs.length;i++)vs[i].dispose();this._timers.dispose();delete this._timers;application.removeEventListener("dispose",this.dispose,this);delete BiTimerManager._singleton;};function BiTimer(nInterval){if(_biInPrototype)return;BiEventTarget.call(this);new BiTimerManager().add(this);if(nInterval>=0)this._interval=nInterval;var oThis=this;this.__ontick=function(){if(!oThis)return;if(oThis._disposed)oThis=null;else oThis._ontick();};}_p=_biExtend(BiTimer,BiEventTarget,"BiTimer");_p._enabled=false;_p._interval=1000;_p._intervalHandle=null;BiTimer.addProperty("enabled",Function.READ_WRITE);BiTimer.addProperty("interval",Function.READ);_p.setInterval=function(nInterval){if(this._enabled)this.stop();this._interval=nInterval;};_p.start=function(){if(this._enabled)this.stop();this._enabled=true;this._intervalHandle=window.setInterval(this.__ontick,this._interval);};_p.stop=function(){this._enabled=false;window.clearInterval(this._intervalHandle);delete this._intervalHandle;};_p._ontick=function(){if(this._enabled){var e=new BiEvent("tick");this.dispatchEvent(e);e.dispose();application.flushLayoutQueue();}};_p.getIsStarted=function(){if(this._intervalHandle==null)return false;else return true;};_p.dispose=function(){if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);this.stop();new BiTimerManager().remove(this);this.__ontick();delete this.__ontick;delete this._interval;};BiTimer.callOnce=function(fun,time,obj){var t=new BiTimer(time!=null?time:1);t.addEventListener("tick",function(e){t.dispose();t=null;fun.call(obj,e);obj=fun=null;},obj);t.start();return t;};if(typeof BiIframe=="function"){BiIframe.prototype.getDescription=function(){return "Floating frame. To enter content window press control + F 6 followed by tab";};}function BiApplication(){if(_biInPrototype)return;if(typeof application=="object")return application;application=this;BiEventTarget.call(this);this._progressStatus="";this._adf=new BiAdf();}var application;_p=_biExtend(BiApplication,BiEventTarget,"BiApplication");_p._version="3.0";BiApplication.prototype.getVersion=function(){return this._version;};_p.start=function(sRootPath,sAdfPath,oArgs){if(!BiBrowserCheck.supported){alert("Bindows is not supported for your Browser.");return;}this.addEventListener("progressstatus",this._onprogressstatus);this._loadStatus=new LoadingStatus();this._loadStatus.setValue(2);if(arguments.length!=0)this._buildArgumentsMapFromArguments(arguments);this._loadAdf();if(BiBrowserCheck.ie)window.attachEvent("onunload",this._onunload);else window.addEventListener("unload",this._onunload,false);};_p._findRootPath=function(){var els=document.getElementsByTagName("script");var l=els.length;var p,src;var re=/(^|\/)js\/application\.js$/;for(var i=0;i<l;i++){src=els[i].src;if(re.test(src)){p=RegExp.leftContext;if(p.charAt(p.length-1)!="/"){p=p+"/";}return new BiUri(this._uri,p);}}return null;};_p._onunload=function(){application.dispose();};_p._uri=new BiUri(window.location.href);_p._uriParams=new BiUri(window.location.href);_p._systemRootPath=new BiUri(window.location.href,"./");_p.getPath=function(){return this._systemRootPath;};_p.getAdfPath=function(){if(this._adfPath)return this._adfPath;var p=this._uriParams.getParam("Adf");return this._adfPath=new BiUri(p,"./");};BiApplication.prototype.getProgressStatus=function(){return this._progressStatus;};BiApplication.prototype.setProgressStatus=function(v){this._progressStatus=v;};BiApplication.prototype.getWindow=function(){return this._window;};BiApplication.prototype.getAdf=function(){return this._adf;};BiApplication.prototype.getUri=function(){return this._uri;};_p._accessibilityMode=false;BiApplication.prototype.getAccessibilityMode=function(){return this._accessibilityMode;};BiApplication.prototype.setAccessibilityMode=function(b){var doneStartup=Boolean(this._window);if(b&&doneStartup&&!this._accessibilityMode){this._accessibilityMode=true;this._addAccessibilityPackage();BiTimer.callOnce(function(){this._initAccessibilityForAll(this._window);},0,this);}else this._accessibilityMode=b||this._accessibilityMode&&doneStartup;};_p.setAccessibilityMode=function(b){var doneStartup=Boolean(this._window);if(b&&doneStartup&&!this._accessibilityMode){this._accessibilityMode=true;this._addAccessibilityPackage();BiTimer.callOnce(function(){this._initAccessibilityForAll(this._window);},0,this);}else this._accessibilityMode=b||this._accessibilityMode&&doneStartup;};_p._accessibilityDescription=null;_p._initAccessibilityForAll=function(c){c.initAccessibility();var children=c.getChildren();for(var i=0;i<children.length;i++)this._initAccessibilityForAll(children[i]);};BiApplication.prototype.getAccessibilityDescription=function(){return this._accessibilityDescription;};BiApplication.prototype.setAccessibilityDescription=function(v){this._accessibilityDescription=v;};_p._autoNameMapping=false;BiApplication.prototype.getAutoNameMapping=function(){return this._autoNameMapping;};_p.setAutoNameMapping=function(b){if(this._autoNameMapping!=b){this._autoNameMapping=b;this._adf.setAutoNameMapping(b);}};_p._focusOnLoad=true;_p.getFocusOnLoad=function(){return this._focusOnLoad;};_p.setFocusOnLoad=function(b){this._focusOnLoad=b;};_p._buildArgumentsMapFromArguments=function(oArguments){var adfName="";var adfPath;var a0=oArguments[0];if(a0.charAt(a0.length-1)!="/")a0=a0+"/";this._systemRootPath=String(new BiUri(this._uri,a0));var re=/([\w ]+)(?:\.[\w ]+)?(?:$|\?)/;var ok=re.test(oArguments[1]);if(ok)adfName=RegExp.$1;else this._reportError(this._getString("ApplicationIncorrectAdfArgument"));adfPath=String(new BiUri(this._uri,oArguments[1]));var uri=this._uriParams;uri.setParam("AdfName",adfName);uri.setParam("Adf",adfPath);uri.setParam("Params",oArguments.length-1);for(var i=2;i<oArguments.length;i++)uri.setParam("Param"+(i-2),oArguments[i]);};_p._loadAdf=function(){this._progressStatus=this._getString("ApplicationLoadingAdf");this.dispatchEvent("progressstatus");this._resourceLoader=new BiResourceLoader();this._adf.addEventListener("load",this._onAdfLoaded,this);var adf=this._uriParams.getParam("Adf");if(this._uriParams.getParam("accessibilityMode")=="true")this.setAccessibilityMode(true);if(adf!=null)this._adf.load(adf);else this._reportError(this._getString("ApplicationNoAdf"));};_p._onAdfLoaded=function(){this._progressStatus=this._getString("ApplicationAdfLoaded");this.dispatchEvent("progressstatus");if(this._adf.getError()){this._reportError(this._getString("ApplicationAdfLoadError"),this._getString("ApplicationAdfLoadErrorDetails",this._uriParams.getParam("Adf"),this._adf.getXmlHttp().status,this._adf.getXmlHttp().statusText));}else {this._adf._interpret();if(BiBrowserCheck.ie)BiTimer.callOnce(this._loadResources,1,this);else application._loadResources();}};_p.getResourceLoader=function(){return this._resourceLoader;};_p.getResourceById=function(sId){if(this._resourceLoader==null)return null;return this._resourceLoader.getResourceById(sId);};_p.getComponentById=function(sId){if(this._adf&&this._adf.getXmlResourceParser())return this._adf.getXmlResourceParser().getComponentById(sId);return null;};_p._loadResources=function(){var systemRootPath=this.getPath();var files;for(var i=0;i<this._defaultPackages.length;i++){files=this.getPackage(this._defaultPackages[i]);for(var j=0;j<files.length;j++)this._resourceLoader.addResource("script",new BiUri(systemRootPath,files[j]));}this._adf._addResources();this._addAccessibilityPackage();this._resourceLoader.addEventListener("progress",this._onprogressstatus,this);this._resourceLoader.addEventListener("load",this._onResourcesLoaded,this);this._progressStatus="Loading Resources";this._resourceLoader.load();};_p._addAccessibilityPackage=function(){if(this._accessibilityMode&&!this._508Added){var files=this.getPackage("Accessibility");var systemRootPath=this.getPath();for(var j=0;j<files.length;j++)this._resourceLoader.addResource("script",new BiUri(systemRootPath,files[j]));this._508Added=true;}};_p._onprogressstatus=function(e){if(!this._resourceLoader||this._resourceLoader.getCount()==0)this._loadStatus.setValue(5);else {this._loadStatus.setValue(Math.max(5,Math.min(95,this._resourceLoader.getLoadedCount()/this._resourceLoader.getCount()*100)));this._progressStatus=this._getString("ApplicationLoadingResources",this._resourceLoader.getLoadedCount(),this._resourceLoader.getCount());}this._loadStatus.setText(this.getProgressStatus());};_p._onResourcesLoaded=function(e){this._useTimersWorkAround=BiBrowserCheck.moz&&BiBrowserCheck.versionNumber<1.7;this._loadStatus.setText(this._getString("ApplicationLoadingCompleted"));this._loadStatus.setValue(100);this._window=new BiApplicationWindow();this._window._create();if(this._useTimersWorkAround){BiTimer.callOnce(this._onResourcesLoaded2,1,this);}else this._onResourcesLoaded2();};_p._onResourcesLoaded2=function(){this._adf.parseXmlResources();this.dispatchEvent("resourcesready");if(this._useTimersWorkAround){BiTimer.callOnce(this._onResourcesLoaded3,1,this);}else this._onResourcesLoaded3();};_p._onResourcesLoaded3=function(){this.flushLayoutQueue();if(application._loadStatus){application._loadStatus.dispose();delete application._loadStatus;}if(this._focusOnLoad){try{window.focus();}catch(ex){}}if(this._useTimersWorkAround){BiTimer.callOnce(this._onResourcesLoaded4,1,this);}else {application._onResourcesLoaded4();}};_p._onResourcesLoaded4=function(){var appClassName=this._uriParams.getParam("AdfName");var uri=this._uriParams;var argc=Number(uri.getParam("Params"));var argv=new Array(argc);for(var i=0;i<argc;i++)argv[i]=uri.getParam("Param"+i);if(window[appClassName]&&typeof window[appClassName].main=="function"){window[appClassName].main.apply(window[appClassName],argv);this.flushLayoutQueue();}this.dispatchEvent("load");this.flushLayoutQueue();};_p._reportError=function(s,s2){if(this._loadStatus)this._loadStatus.setText(s);throw new Error(s2||s);};_p.dispose=function(){if(this._disposed)return;this.dispatchEvent("dispose");if(BiBrowserCheck.ie)window.detachEvent("onunload",this._onunload);else window.removeEventListener("unload",this._onunload,false);this.disposeFields("_adfPath","_systemRootPath","_themeManager","_window","_loadStatus","_resourceLoader","_adf","_inactivityTimeout","_uri","_uriParams");BiEventTarget.prototype.dispose.call(this);application=null;};_p.setAttribute=function(sName,sValue,oParser){switch(sName){case "defaultPackages":{this.setProperty(sName,sValue.split(/\s*,\s*/));break;}default:BiEventTarget.prototype.setAttribute.apply(this,arguments);}};_p.flushLayoutQueue=function(){if(typeof BiComponent==BiObject.TYPE_FUNCTION){BiComponent.flushLayoutQueue();}};_p.getThemeManager=function(){if(!this._themeManager){this._themeManager=new BiThemeManager();}return this._themeManager;};_p.getTheme=function(){return this.getThemeManager().getDefaultTheme();};BiApplication.prototype.getInactivityTimeout=function(){return this._inactivityTimeout;};BiApplication.prototype.setInactivityTimeout=function(n){n=Number(n)||0;if(this._inactivityTimeout!=n){this._inactivityTimeout=n;if(!this._inactivityTimer){this._inactivityTimer=new BiTimer();this._inactivityTimer.addEventListener("tick",function(e){this._inactivityTimer.stop();this.dispatchEvent("inactive");},this);}this._inactivityTimer.setInterval(60000*n);if(n>0)this._inactivityTimer.start();else this._inactivityTimer.stop();}};BiApplication.prototype.restartInactivityTimer=function(){if(this._inactivityTimer&&this._inactivityTimeout>0){this._inactivityTimer.start();}};_p._defaultPackages=["Core","Gui","Layout","DateTime","XmlRpc","Grid","TreeView"];_p.getPackage=function(sName){if(sName in this._packages)return this._packages[sName];return [];};_p.getPackages=function(){var res=[];for(var n in this._packages)res.push(n);return res;};_p.addPackage=function(sName,oFiles){this._packages[sName]=oFiles;};BiApplication.prototype.getDefaultPackages=function(){return this._defaultPackages;};BiApplication.prototype.setDefaultPackages=function(v){this._defaultPackages=v;};BiApplication.prototype.getStringBundle=function(){return this._stringBundle;};BiApplication.prototype.setStringBundle=function(v){this._stringBundle=v;};_p._getString=function(s){var o=this._stringBundle;return o.getFormattedString.apply(o,arguments);};_p._stringBundle=new BiStringBundle();_p._stringBundle.addBundle("en",{ApplicationIncorrectAdfArgument:"The ADF argument is incorrect",ApplicationLoadingAdf:"Loading Application Description File",ApplicationNoAdf:"No ADF specified",ApplicationAdfLoaded:"Application Description File Loaded",ApplicationAdfLoadError:"Error loading ADF",ApplicationAdfLoadErrorDetails:"Error loading ADF\nURI: %1\nStatus: %2, %3",ApplicationLoadingResources:"Loading resources (%1/%2)",ApplicationLoadingCompleted:"Loading completed"});application=new BiApplication();application._packages_ie={Core:["js/core.ie.js"],XmlRpc:["js/xmlrpc.js"],Gui:["js/gui1.js","js/gui2.ie.js","js/gui3.js"],Grid:["js/grids.js"],TreeView:["js/treeview.js"],Charting:["js/charting.ie.js"],WebService2:["js/webservice2.js"],OlapGrid:["js/olapgrid.js"],Loaders:["js/loaders.js"],Gauge2:["js/gauge2.ie.js"],Animation:["js/animation.js"],Accessibility:["js/accessibility.js"]};application._packages_moz={Core:["js/core.moz.js"],XmlRpc:["js/xmlrpc.js"],Gui:["js/gui1.js","js/gui2.moz.js","js/gui3.js"],Grid:["js/grids.js"],TreeView:["js/treeview.js"],Charting:["js/charting.moz.js"],WebService2:["js/webservice2.js"],OlapGrid:["js/olapgrid.js"],Loaders:["js/loaders.js"],Gauge2:["js/gauge2.moz.js"],Animation:["js/animation.js"],Accessibility:[null]};application._packages=BiBrowserCheck.ie?application._packages_ie:application._packages_moz;
