Bw={};Bw.Core={bind:function(el,proto){var p=null;var n=null;try{p=(typeof proto=="string")?eval(proto):proto;}catch(e){}if(p&&p.selfclassName){p.selfclass=eval(p.selfclassName);if(p.superclassName){p.superclass=eval(p.superclassName);Bw.Core.bind(el,p.superclassName);}for(e in p){el[e]=p[e];}el.className=p.selfclassName.replace(/\./g,"");return p;}},bootstrap:function(el,c){var n=c||el.className;if(n&&Bw.Core.bind(el,n)&&!el.initialize()){return;}var e=el.firstChild;while(e!=null){try{Bw.Core.bootstrap(e);}catch(ex){}e=e.nextSibling;}},load:function(parent,url,force){var q=Bw.IO.Query.create();if(force){q.setNoCache();}q.get(url);parent.innerHTML=q.getText();Bw.Core.bootstrap(parent);Bw.Core.evalScript(parent.innerHTML,force);},evalScript:function(html,force){var idx=html.toLowerCase().indexOf("<script");while(idx>-1){var idxEnd=html.toLowerCase().indexOf(">",idx);var balise=html.substring(idx+8,idxEnd);var idxSrc=balise.toLowerCase().indexOf("src=");if(idxSrc==-1){var idxSlashScript=html.toLowerCase().indexOf("<\/script>",idx+8);var script=html.substring(idxEnd+1,idxSlashScript);eval(script);}else{if(balise.charAt(idxSrc+4)=='"'||balise.charAt(idxSrc+4)=="'"){idxSrc++;}var idxSrcEnd=-1;for(var i=idxSrc+4;i<balise.length;i++){if(balise.charAt(i)==" "||balise.charAt(i)=='"'||balise.charAt(i)=="'"){idxSrcEnd=i;}}var source=balise.substring(idxSrc+4,idxSrcEnd);var q=Bw.IO.Query.create();if(force){q.setNoCache();}q.get(source);if(q.getStatus()==200){eval(q.getText());}}idx=html.toLowerCase().indexOf("<script",idx+8);}},check:function(){},start:function(){if(self.dialogArguments){self.opener=self.dialogArguments;}Bw.Core.check();Bw.Core.bootstrap(document.body);}};Bw.instanceOf=function(el,type){return(el&&((el.selfclass&&el.selfclass==type)||(el.className&&el.className==type.selfclassName)));};Bw.inherits=function(el,type){if(!el){return false;}var t=el.selfclass;while(t){if(t==type){return true;}t=t.superclass;}return false;};Bw.getById=function(id){return document.getElementById(id);};Bw.getEvent=function(e){if(!e){e=window.event;e.target=e.srcElement;}return e;};Bw.getGlobalMousePosition=function(e){var p={x:e.clientX,y:e.clientY};var d=document.documentElement;var b=document.body;var w=window;p.x+=(w.scrollX)?w.scrollX:(d.scrollLeft+b.scrollLeft);p.y+=(w.scrollY)?w.scrollY:(d.scrollTop+b.scrollTop);return p;};Array.prototype.lookup=function(o){var l=this.length;for(var i=0;i<l;i++){if(this[i]==o){return i;}}return -1;};function log(str){var l=Bw.getById("log");if(!l){l=document.createElement("DIV");l.style.font="menu";l.style.clear="both";l.id="log";document.body.appendChild(l);}l.innerHTML+=(str+"<br>");}window.onload=function(){Bw.Core.start();};Bw.IO={};Bw.IO.Query={superclassName:null,selfclassName:"Bw.IO.Query",create:function(){var obj=new Object();Bw.Core.bootstrap(obj,this);return obj;},initialize:function(){this.asyncCallback=null;this.headers={};this.impl=Bw.Xml.Helpers.createHttpRequest();},get:function(url,callback){this.transmit("GET",url,null,callback);},post:function(url,obj,callback){if(obj&&obj.selfclass&&obj.selfclass==Bw.IO.Message){obj=obj.dom;}this.transmit("POST",url,obj,callback);},transmit:function(method,url,obj,callback){var async=(typeof callback!="undefined");if(async){this.asyncCallback=callback;}this.impl.open(method,this.buildUrl(url),async);for(h in this.headers){this.impl.setRequestHeader(h,this.headers[h]);}if(async){var self=this;this.impl.onreadystatechange=function(){self.readyStateChanged();};}this.impl.send(obj);window.status="";},readyStateChanged:function(){if(this.impl.readyState==4){window.status="";this.asyncCallback();}},setNoCache:function(){this.headers["If-Modified-Since"]="Sat, 1 Jan 2005 00:00:00 GMT";},setHeader:function(name,value){this.headers[name]=value;},getText:function(){return this.impl.responseText;},getMessage:function(){return Bw.IO.Message.createFromXml(this.impl.responseXML);},getXml:function(){return this.impl.responseXML;},getStatus:function(){return this.impl.status;},getStatusText:function(){return this.impl.statusText;},buildUrl:function(url){var l=document.location;if(url.indexOf("/")==0){var p=l.port;var h=l.host;var u=l.protocol+"//"+h;if(p!=null&&p!=""&&h.indexOf(p)<0){u+=(":"+p);}return(u+url);}else{var l=l.toString();var p=l.lastIndexOf("/");var u=l.substr(0,p);return(u+"/"+url);}},PostData:function(){this.properties={};this.toString=function(){var s="";for(name in this.properties){if(s!=""){s+="&";}var value=this.properties[name];value=""+value;if(typeof value!="string"){continue;}value=value.replace(/%/g,"%25");value=value.replace(/&/g,"%26");s+=(name+"="+value);}return s;};}};Bw.IO.Message={superclassName:null,selfclassName:"Bw.IO.Message",create:function(name){var obj=new Object();obj.name=(name)?name:"message";Bw.Core.bootstrap(obj,this);return obj;},createFromXml:function(xml){var obj=new Object();obj.dom=xml;Bw.Core.bootstrap(obj,this);return obj;},initialize:function(){if(!this.dom){var d=Bw.Xml.Helpers.createDocument();d.appendChild(d.createElement(this.name));this.dom=d;}this.root=this.dom;if(!this.name){this.name=this.root.nodeName;}},changeRoot:function(path){var n=Bw.Xml.Path.navigate(path,this.root,false);this.root=(node==null)?this.dom:node;},put:function(path,value,from){var f=(from)?from:this.root;var n=Bw.Xml.Path.navigate(path,f,true);if(n){Bw.Xml.Helpers.setNodeValue(n,value);}return n;},get:function(path,from){var f=(from)?from:this.root;var n=Bw.Xml.Path.navigate(path,f,false);return(!n)?null:Bw.Xml.Helpers.getNodeValue(n);},getNodes:function(path,from){var f=(from)?from:this.root;return Bw.Xml.Helpers.getNodes(f,path);},getNode:function(path,from){var f=(from)?from:this.root;return Bw.Xml.Helpers.getNode(f,path,false);},count:function(path){var n=Bw.Xml.Path.navigate(path,this.root,false);return(!n)?-1:Bw.Xml.Helpers.countHomonymNodes(n);},remove:function(path){var n=Bw.Xml.Path.navigate(path,this.root,false);return(!n)?null:Bw.Xml.Path.removeNode(n);}};Bw.Xml={};Bw.Xml.Path={cache:{},compile:function(path){var code="var n=r;";var start=0;var end=false;while(!end){var stop=path.indexOf("/",start);if(stop==-1){stop=path.length;end=true;}var e=path.substring(start,stop);var a=null;var p=e.indexOf("@");if(p!=-1){a=e.substring(p+1,e.length);e=e.substring(0,p);}var i=0;var bo=e.indexOf("[");if(bo!=-1){var bc=e.indexOf("]",bo);if(bc!=-1){i=e.substring(bo+1,bc);e=e.substring(0,bo);}}if(e!=""||i!=0){code=code+("n=Bw.Xml.Path._el(n,'"+e+"',"+i+",c);");}if(a!=null&&end){code=code+("n=Bw.Xml.Path._at(n,'"+a+"',c);");}start=stop+1;}return new Function("r","c",code+"return n;");},navigate:function(path,root,create){var c=Bw.Xml.Path.cache[path];if(!c||c==null){c=Bw.Xml.Path.compile(path);Bw.Xml.Path.cache[path]=c;}return c(root,create);},_el:function(node,name,index,create){if(node==null){return null;}if(name=="."||name==""){return node;}function arr(parent,name){var n=[];var i=0;var c=parent.firstChild;while(c!=null){if(c.nodeType==1&&c.nodeName==name){n[i++]=c;}c=c.nextSibling;}return n;}var nodes=arr(node,name);var l=nodes.length;if(index<l){return nodes[index];}if(!create){return null;}var gap=index-l+1;var doc=node.ownerDocument;var n=null;for(var j=0;j<gap;j++){n=doc.createElement(name);node.appendChild(n);}return n;},_at:function(node,name,create){if(node==null){return null;}var a=node.getAttributeNode(name);if(a!=null||(a==null&&!create)){return a;}node.setAttribute(name,"");return node.getAttributeNode(name);}};Bw.Xml.Helpers={getNodes:function(node,path){var a=[];var n=Bw.Xml.Path.navigate(path,node,false);var c=n;while(c!=null){if(c.nodeName==n.nodeName){a.push(c);}c=c.nextSibling;}return a;},getNode:function(node,path,create){var tmp=Bw.Xml.Path.navigate(path,node,create);return tmp;},getNodeValue:function(node){var c=node.childNodes;var l=c.length;var v="";for(var i=0;i<l;i++){var n=c[i];var t=n.nodeType;if(t==3||t==4){v+=n.nodeValue;}}return v;},setNodeValue:function(node,value){if(!value){return;}if(node.nodeType==2){node.value=value;return;}var c=node.childNodes;var l=c.length;for(var i=0;i<l;i++){var n=c[i];if(n.nodeType==3){if(value!=null){n.data=value;}else{node.removeChild(n);}return;}}if(value!=null){var f=node.firstChild;var t=node.ownerDocument.createTextNode(value);if(f==null){node.appendChild(t);}else{node.insertBefore(t,f);}}},removeNode:function(node){var n=node;if(n.nodeType==2){n.ownerElement.removeAttributeNode(n);}else{n.parentNode.removeChild(n);}return n;},importNode:function(dom,node,deep){var n;if(node.nodeType==1){n=dom.createElement(node.nodeName);for(var i=0;i<node.attributes.length;i++){var attr=node.attributes[i];if(attr.nodeValue!=null&&attr.nodeValue!=""){n.setAttribute(attr.name,attr.nodeValue);}}}else{if(node.nodeType==3){n=dom.createTextNode(node.nodeValue);}}if(deep&&node.hasChildNodes()){for(var i=0;i<node.childNodes.length;i++){n.appendChild(Bw.Xml.Helpers.importNode(dom,node.childNodes[i],true));}}return n;},createDocument:function(){var i=document.implementation;var d=(i.createDocument)?i.createDocument("","",null):new ActiveXObject("MSXML.DOMDocument");return d;},createHttpRequest:function(){return(typeof ActiveXObject!="undefined")?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();}};