clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [26/51] [partial] clerezza git commit: CLEREZZA-1012: reduced clerezza to core components, the rest stays in legacy-branch
Date Mon, 03 Oct 2016 15:49:52 GMT
http://git-wip-us.apache.org/repos/asf/clerezza/blob/14575ea3/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js
deleted file mode 100644
index fa5bf1c..0000000
--- a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js
+++ /dev/null
@@ -1,1368 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* ***** BEGIN LICENSE BLOCK *****
- * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
- * Full Terms at http://mozile.mozdev.org/0.8/LICENSE
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is James A. Overton's code (james@overton.ca).
- *
- * The Initial Developer of the Original Code is James A. Overton.
- * Portions created by the Initial Developer are Copyright (C) 2005-2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *	James A. Overton <james@overton.ca>
- *
- * ***** END LICENSE BLOCK ***** */
-
-/*
- * Comments and white space have been removed from this file to reduce its size.
- * For full source code see http://mozile.mozdev.org
- */
-
-/*
- * This file includes the following Mozile modules: 
- * core.js, dom.js, xml.js, xpath.js, util.js, dom/TreeWalker.js, dom/InternetExplorerRange.js, dom/InternetExplorerSelection.js, rng.js, edit.js, edit/InsertionPoint.js, edit/rich.js, event.js, save.js, save/tidy.js, save/extract.js, gui.js, gui/htmlToolbar.js
- */
-
-var mozile={window:window,document:document,filesep:"/",linesep:"\n",root:""}
-mozile.version={major:"0",minor:"8",micro:"0",flag:"a1",toString:function(){return this.major+"."+this.minor+"."+this.micro+this.flag;}}
-mozile.about="Mozile is a WYSIWYG inline edtior for XHTML and XML+CSS files.";mozile.copyright="Copyright 2006, The Mozile Team";mozile.license="MPL 1.1/GPL 2.0/LGPL 2.1, http://mozile.mozdev.org/0.8/LICENSE";mozile.homepage="http://mozile.mozdev.org";mozile.credits="James A. Overton, Conor Dowling, Max d'Ayala, Christian Stocker, Paul Everitt, David Palm, Richard Prescott, Lars Kiilerich, Kingsley Kerse, Tobias Minich, Andreas Schamberger, and others...";mozile.acknowledgements="Icons created by Mark James <http://www.famfamfam.com/lab/icons/silk/>";mozile.precompiled=true;mozile.deferRequirements=true;mozile.help=["doc","html","index.html"].join(mozile.filesep);mozile.useDesignMode=false;mozile.defaultNS=null;mozile.emptyToken="\u00A0";mozile.alternateSpace=null;mozile.updateInterval=500;mozile.load=function(uri){var XHR;try{if(window.XMLHttpRequest){XHR=new XMLHttpRequest();XHR.open("GET",uri,false);XHR.send(null);}
-else if(window.ActiveXObject){XHR=new ActiveXObject('Microsoft.XMLHTTP');XHR.open("GET",uri,false);XHR.send();}}catch(e){if(mozile.debug)mozile.debug.inform("mozile.load","File load failed loading '"+uri+"' with error message:\n"+e);return null;}
-if(XHR){if(XHR.status==0||XHR.status==200)return XHR.responseText;else{if(mozile.debug)mozile.debug.inform("mozile.load","File load failed with status '"+XHR.status+"' and message:\n"+XHR.responseText);return null;}}
-if(mozile.debug)mozile.debug.inform("mozile.load","No XMLHttpRequest available when trying to load '"+uri+"'.");return null;}
-mozile.findRoot=function(){var scripts=document.getElementsByTagName("script");var matches=["mozile.js","mozile-src.js"];var src,index,i,j;for(i=0;i<scripts.length;i++){src=scripts[i].getAttribute("src");if(!src)continue;for(j=0;j<matches.length;j++){index=src.indexOf(matches[j]);if(index>-1)return src.substring(0,index);}}
-return"";}
-mozile.root=mozile.findRoot();mozile.findModule=function(moduleName){var levels=moduleName.split(".");var current=mozile.window;for(var i=0;i<levels.length;i++){if(!current[levels[i]])return null;current=current[levels[i]];}
-return current;}
-mozile.loadModule=function(moduleName){if(!moduleName)return false;var filename=mozile.root+mozile.filesep;var levels=moduleName.split(".");for(var i=0;i<levels.length;i++){if(levels[i]=="*")levels=levels.splice(i,1);}
-if(levels[0]&&levels[0]=="mozile"){levels.shift();if(levels[0]&&levels[0]=="test"){levels.shift();filename+="tests"+mozile.filesep;}
-else filename+="src"+mozile.filesep;}
-else return false;if(levels.length==0)return false;while(levels.length>1){filename+=levels.shift()+mozile.filesep;}
-filename+=levels.pop()+".js";var file=mozile.load(filename);if(!file&&mozile.test&&mozile.test.root){filename=filename.replace(mozile.root,mozile.test.root);file=mozile.load(filename);}
-if(!file){var parent=moduleName.substring(0,moduleName.lastIndexOf("."));return mozile.loadModule(parent);}
-try{eval(file);return true;}catch(e){mozile.debug.inform("mozile.loadModule","Error evaluating module '"+moduleName+"' in file '"+filename+"'.\n"+mozile.dumpError(e));return false;}}
-mozile.deferrals=new Array();mozile.require=function(moduleName){if(!mozile.findModule(moduleName)){if(mozile.deferRequirements){mozile.deferrals.push(moduleName);return false;}
-return mozile.loadModule(moduleName);}
-else return false;}
-mozile.loadDeferred=function(){while(mozile.deferrals.length){mozile.require(mozile.deferrals.shift());}}
-mozile.provide=function(){}
-mozile.Module=function(){};mozile.isPathAbsolute=function(path){if(!path)return false;path=path.toString();if(path.indexOf(":")==-1)return false;var protocol=path.substring(0,path.indexOf(":"));switch(protocol){case"http":case"https":case"file":return true;}
-return false;}
-mozile.getPath=function(url){if(!url)return"";url=url.toString();if(url.indexOf("?")>-1)url=url.substring(0,url.indexOf("?"));return url;}
-mozile.getDirectory=function(path){if(!path)return"";path=path.toString();path=mozile.getPath(path);var partial;if(path.indexOf(mozile.filesep)>-1){if(path.indexOf(":///")>-1){partial=path.substring(path.indexOf(":///")+4);if(partial.indexOf(mozile.filesep)==-1)return path;}
-else if(path.indexOf("://")>-1){partial=path.substring(path.indexOf("://")+3);if(partial.indexOf(mozile.filesep)==-1)return path;}
-return path.substring(0,path.lastIndexOf(mozile.filesep)+1);}
-return path;}
-mozile.getAbsolutePath=function(path,root){if(!path)return"";path=path.toString();if(mozile.isPathAbsolute(path))return path;if(!root)root=location;root=mozile.getDirectory(root);root=mozile.getAbsolutePath(root);return mozile.joinPaths(root,path);}
-mozile.joinPaths=function(){var path="";var part;for(var i=0;i<arguments.length;i++){part=arguments[i];if(typeof(part)!="string")continue;if(path){if(path.charAt(path.length-1)==mozile.filesep){if(part.charAt(0)==mozile.filesep)
-part=part.substring(1);}
-else{if(part.charAt(0)!=mozile.filesep)
-part=mozile.filesep+part;}}
-path+=part;}
-return path;}
-mozile.debug=new Object();mozile.debug.prototype=new mozile.Module;mozile.debug.alertLevel="suppress";mozile.debug.logLevel="inform";mozile.debug.messages=new Array();mozile.debug.window=null;mozile.debug.isSelected=function(type,level){if(typeof(type)!="string")return false;type=type.toLowerCase();var checkLevel;if(type=="alert")checkLevel=mozile.debug.alertLevel;else if(type=="log")checkLevel=mozile.debug.logLevel;else return false;checkLevel=checkLevel.toLowerCase();if(typeof(level)!="string")return false;level=level.toLowerCase();if(checkLevel=="suppress")return false;if(checkLevel=="warn"){if(level=="warn")return true;else return false;}
-if(checkLevel=="inform"){if(level=="warn"||level=="inform")return true;else return false;}
-if(checkLevel=="debug")return true;return false;}
-mozile.debug.warn=function(caller,message){var level="warn";var msg="Mozile Warning ["+caller+"] "+message;if(mozile.debug.isSelected("alert",level)){if(window.warn)warn(msg);else mozile.alert(msg);}
-if(mozile.debug.isSelected("log",level)){mozile.debug.log(caller,level,message);}}
-mozile.debug.inform=function(caller,message){var level="inform";var msg="Mozile Information ["+caller+"] "+message;if(mozile.debug.isSelected("alert",level)){if(window.inform)inform(msg);else mozile.alert(msg);}
-if(mozile.debug.isSelected("log",level)){mozile.debug.log(caller,level,message);}}
-mozile.debug.debug=function(caller,message){var level="debug";var msg="Mozile Debugging ["+caller+"] "+message;if(mozile.debug.isSelected("alert",level)){if(window.debug)debug(msg);else mozile.alert(msg);}
-if(mozile.debug.isSelected("log",level)){mozile.debug.log(caller,level,message);}}
-mozile.debug.log=function(caller,level,message){var date=new Date();var msg={caller:caller,level:level,message:message,date:date.toLocaleString(),toString:function(){return this.level.toUpperCase()+" ("+this.date+") ["+this.caller+"] "+this.message;}};mozile.debug.messages.push(msg);if(mozile.debug.window&&mozile.debug.window.document){mozile.debug.window.document.write(msg+"<br/>\n");mozile.debug.window.scroll(0,document.body.clientHeight);}}
-mozile.debug.show=function(){if(!mozile.debug.window||!mozile.debug.window.document){mozile.debug.window=window.open("","MozileDebugging","");mozile.debug.window.document.write("<h3>Mozile Debugging Messages</h3>");mozile.debug.window.document.write(mozile.debug.messages.join("<br/>\n")+"<br/>\n");}
-else mozile.debug.window=window.open("","MozileDebugging","");}
-mozile.alert=function(message){alert(message);}
-mozile.dumpError=function(object){if(typeof(object)=="string")return object;if(!mozile.browser.isIE)return object.toString();var fields;if(object&&object.description){fields=["Name: "+object.name,"Number: "+object.number,"Message: "+object.message,"Description: "+object.description,];return fields.join("\n");}
-if(!object)object=document;if(!object.parseError)object=document;if(!object.parseError)object=window;if(!object.parseError)return"[No error to parse]";fields=["Error Code: "+object.parseError.errorCode,"File Position: "+object.parseError.filepos,"Line: "+object.parseError.line,"Line Position: "+object.parseError.linepos,"Reason: "+object.parseError.reason,"Source Text: "+object.parseError.srcText,"Url: "+object.parseError.url];return fields.join("\n");}
-mozile.editElement=function(elementOrId){var element;if(typeof(elementOrId)=="string"){if(document.documentElement.nodeName.toLowerCase()=="html"){element=document.getElementById(elementOrId);}
-else{mozile.require("mozile.dom");var results=mozile.dom.getElements("id",elementOrId,null,true);if(results.length)element=results[0];else return false;}}
-else if(elementOrId.nodeType&&elementOrId.nodeType==mozile.dom.ELEMENT_NODE){element=elementOrId;}
-if(element)return mozile._markEditable(element,true);return false;}
-mozile.editElements=function(listOrValue,name){var list;if(typeof(listOrValue)=="string"){mozile.require("mozile.dom");list=mozile.dom.getElements(name,listOrValue);}
-else if(listOrValue.length){list=listOrValue;}
-if(list.length){for(var i=0;i<list.length;i++){if(list[i]&&list[i].nodeType&&list[i].nodeType==mozile.dom.ELEMENT_NODE){mozile.editElement(list[i]);}}}
-return undefined;}
-mozile.editDocument=function(doc){if(!doc)doc=document;mozile.editElement(doc.documentElement);}
-mozile.protectElement=function(elementOrId){var element;if(typeof(elementOrId)=="string"){if(document.documentElement.nodeName.toLowerCase()=="html"){element=document.getElementById(elementOrId);}
-else{mozile.require("mozile.dom");var results=mozile.dom.getElements("id",elementOrId,null,true);if(results.length)element=results[0];else return false;}}
-else if(elementOrId.nodeType&&elementOrId.nodeType==mozile.dom.ELEMENT_NODE){element=elementOrId;}
-if(element)return mozile._markEditable(element,false);return false;}
-mozile.protectElements=function(listOrValue,name){var list;if(typeof(listOrValue)=="string"){mozile.require("mozile.dom");list=mozile.dom.getElements(name,listOrValue);}
-else if(listOrValue.length){list=listOrValue;}
-if(list.length){for(var i=0;i<list.length;i++){if(list[i]&&list[i].nodeType&&list[i].nodeType==mozile.dom.ELEMENT_NODE){mozile.protectElement(list[i]);}}}
-return undefined;}
-mozile._markEditable=function(element,value){if(!element)return null;mozile.require("mozile.edit");if(value===true&&mozile.edit.setMark(element,"editable")===false&&mozile.edit.getContainer(element.parentNode)){mozile.edit.setMark(element,"editable",undefined);if(mozile.edit.getMark(element,"contentEditable")==undefined){element.removeAttribute("contentEditable");}
-return value;}
-mozile.edit.setMark(element,"editable",value);if(mozile.edit.getMark(element,"contentEditable")==undefined){switch(element.getAttribute("contentEditable")){case"true":mozile.edit.setMark(element,"contentEditable",true);break;case"false":mozile.edit.setMark(element,"contentEditable",false);break;}}
-element.setAttribute("contentEditable",String(value));return value;}
-mozile.enableEditing=function(rich){mozile.require("mozile.edit");mozile.edit.defaults.addCommand(mozile.edit.navigateLeftRight);mozile.edit.defaults.addCommand(mozile.edit.insertText);mozile.edit.defaults.addCommand(mozile.edit.removeText);if(rich){mozile.require("mozile.edit.rich");mozile.edit.defaults.addCommand(mozile.edit.remove);var splitBlocks=new mozile.edit.Split("splitBlocks");splitBlocks.accel="Return Enter";mozile.edit.defaults.addCommand(splitBlocks);}}
-mozile.useSchema=function(target){try{mozile.require("mozile.rng");mozile.require("mozile.edit");mozile.require("mozile.edit.rich");mozile.edit.extendRNG();mozile.schema=new mozile.rng.Schema();var validation=mozile.schema.parse(target);if(validation.isValid){mozile.edit.generateCommands(mozile.schema);return true;}
-else{mozile.debug.inform("mozile.useSchema","Schema validation failed.\n"+validation.report(true));return false;}}catch(e){mozile.debug.inform("mozile.useSchema","Could not create schema for target '"+target+"' because of an error:\n"+mozile.dumpError(e));return false;}}
-mozile.os=new Object();mozile.os.prototype=new mozile.Module;mozile.os.isMac=false;if(navigator.userAgent.match(/Macintosh/))mozile.os.isMac=true;mozile.browser=new Object();mozile.browser.prototype=new mozile.Module;mozile.browser.isMozilla=false;mozile.browser.mozillaVersion=0;mozile.browser.mozillaVersion=navigator.userAgent.match(/rv\:(\d+\.\d+)/);if(mozile.browser.mozillaVersion&&Number(mozile.browser.mozillaVersion[1])){mozile.browser.isMozilla=true;mozile.browser.mozillaVersion=Number(mozile.browser.mozillaVersion[1]);}
-mozile.browser.isIE=false;if(navigator.userAgent.match(/MSIE/))mozile.browser.isIE=true;mozile.browser.isSafari=false;if(navigator.userAgent.match(/Safari/))mozile.browser.isSafari=true;mozile.browser.safariVersion=0;mozile.browser.safariVersion=navigator.userAgent.match(/AppleWebKit\/(\d+)/);if(mozile.browser.safariVersion&&Number(mozile.browser.safariVersion[1])){mozile.browser.safariVersion=Number(mozile.browser.safariVersion[1]);}
-mozile.browser.isOpera=false;if(navigator.userAgent.match(/Opera/))mozile.browser.isOpera=true;if(mozile.browser.isMozilla){if(document.contentType&&document.contentType=="text/html"){mozile.defaultNS=null;}
-else{mozile.defaultNS="http://www.w3.org/1999/xhtml";}}
-mozile.dom=new Object();mozile.dom.prototype=new mozile.Module;mozile.dom.ELEMENT_NODE=1;mozile.dom.ATTRIBUTE_NODE=2;mozile.dom.TEXT_NODE=3;mozile.dom.CDATA_SECTION_NODE=4;mozile.dom.ENTITY_REFERENCE_NODE=5;mozile.dom.ENTITY_NODE=6;mozile.dom.PROCESSING_INSTRUCTION_NODE=7;mozile.dom.COMMENT_NODE=8;mozile.dom.DOCUMENT_NODE=9;mozile.dom.DOCUMENT_TYPE_NODE=10;mozile.dom.DOCUMENT_FRAGMENT_NODE=11;mozile.dom.NOTATION_NODE=12;mozile.dom.links=new Array();mozile.dom.getBody=function(node){var doc=document;if(node)doc=node.ownerDocument;var elements=doc.getElementsByTagName("body");if(elements&&elements[0])return elements[0];else return doc.documentElement;}
-mozile.dom.getHead=function(node){var doc=document;if(node)doc=node.ownerDocument;var elements=doc.getElementsByTagName("head");if(elements&&elements[0])return elements[0];else return doc.documentElement;}
-mozile.dom.getFirstChildElement=function(parent){for(var i=0;i<parent.childNodes.length;i++){if(parent.childNodes[i].nodeType==mozile.dom.ELEMENT_NODE)
-return parent.childNodes[i];}
-return null;}
-mozile.dom.getChildElements=function(parent){var children=new Array();for(var i=0;i<parent.childNodes.length;i++){if(parent.childNodes[i].nodeType==mozile.dom.ELEMENT_NODE)
-children.push(parent.childNodes[i]);}
-return children;}
-mozile.dom.getNextSiblingElement=function(node){var sibling=node.nextSibling;while(sibling){if(sibling.nodeType==mozile.dom.ELEMENT_NODE)return sibling;sibling=sibling.nextSibling;}
-return null;}
-mozile.dom.getElements=function(attr,value,root,single){var list=new Array();if(!attr)attr="class";if(!root)root=document.documentElement;if(document.createTreeWalker){var treeWalker=document.createTreeWalker(root,mozile.dom.NodeFilter.SHOW_ELEMENT,null,false);var node=treeWalker.currentNode;while(node){if(attr=="class"&&mozile.dom.hasClass(node,value))
-list.push(node);else if(attr!="local name"&&node.getAttribute(attr)){if(!value)list.push(node);else if(node.getAttribute(attr)==value)list.push(node);}
-else if(attr=="local name"&&mozile.dom&&mozile.dom.getLocalName(node).toLowerCase()==value){list.push(node);}
-if(single&&list.length>0)break;node=treeWalker.nextNode();}}
-return list;}
-mozile.dom.getText=function(node){if(!node)return"";if(node.nodeType==mozile.dom.TEXT_NODE&&!mozile.dom.isWhitespace(node)){return node.data;}
-else if(node.nodeType==mozile.dom.ATTRIBUTE_NODE){return node.nodeValue;}
-else if(node.nodeType==mozile.dom.ELEMENT_NODE){var text="";for(var i=0;i<node.childNodes.length;i++){text+=mozile.dom.getText(node.childNodes[i]);}
-return text;}
-return"";}
-mozile.dom.insertAfter=function(newNode,refNode){if(!newNode)throw("Error [mozile.dom.insertAfter]: No newNode. newNode: "+newNode+" refNode: "+refNode);if(!refNode)throw("Error [mozile.dom.insertAfter]: No refNode. newNode: "+newNode+" refNode: "+refNode);var parentNode=refNode.parentNode;if(!parentNode)return null;if(refNode.nextSibling)return parentNode.insertBefore(newNode,refNode.nextSibling);else return parentNode.appendChild(newNode);}
-mozile.dom.prependChild=function(newNode,parentNode){if(parentNode.firstChild)return parentNode.insertBefore(newNode,parentNode.firstChild);else return parentNode.appendChild(newNode);}
-mozile.dom.isAncestorOf=function(ancestorNode,descendantNode,limitNode){var checkNode=descendantNode;while(checkNode){if(checkNode==ancestorNode)return true;else if(checkNode==limitNode)return false;else checkNode=checkNode.parentNode;}
-return false;}
-mozile.dom.getCommonAncestor=function(firstNode,secondNode){var ancestor=firstNode;while(ancestor){if(mozile.dom.isAncestorOf(ancestor,secondNode))return ancestor;else ancestor=ancestor.parentNode;}
-return null;}
-mozile.dom._matchNonWhitespace=/\S/m;mozile.dom.isWhitespace=function(node){if(!node||!node.nodeValue)return false;if(node.nodeValue.match(mozile.dom._matchNonWhitespace))return false;return true;}
-mozile.dom.isVisible=function(node){var visibility;while(node){if(node==document)return true;if(node.nodeType==mozile.dom.ELEMENT_NODE){if(mozile.dom.getStyle(node,"display")=="none")return false;visibility=mozile.dom.getStyle(node,"visibility");if(visibility=="hidden"||visibility=="collapse")return false;}
-node=node.parentNode;}
-return false;}
-mozile.dom.isHTML=function(node){if(!node)node=document;var doc=node;if(node.ownerDocument)doc=node.ownerDocument;if(!doc.documentElement)return false;var name=doc.documentElement.nodeName;if(doc.documentElement.nodeName)name=doc.documentElement.nodeName;if(name.toLowerCase()=="html")return true;else return false;}
-mozile.dom.isIgnored=function(node){if(node.nodeType==mozile.dom.ATTRIBUTE_NODE){if(node.nodeName.indexOf("xmlns")==0)return true;if(mozile.browser.isOpera&&node.nodeName.toLowerCase()=="shape")return true;}
-return false;}
-mozile.dom.getLocalName=function(node){if(!node)return null;if(node.localName)return node.localName;else if(node.nodeName&&node.nodeName.indexOf(":")>-1)
-return node.nodeName.substring(node.nodeName.indexOf(":")+1);else return node.nodeName;}
-mozile.dom.getPrefix=function(node){if(!node)return null;if(node.prefix)return node.prefix;else if(node.nodeName.indexOf(":")>-1)
-return node.nodeName.substring(0,node.nodeName.indexOf(":"));else return null;}
-mozile.dom.getIndex=function(node){if(!node.parentNode)return null;for(var c=0;c<node.parentNode.childNodes.length;c++){if(node.parentNode.childNodes[c]==node)return c;}
-return c;}
-mozile.dom.getPosition=function(node){if(!node.parentNode)return null;var s=1;for(var c=0;c<node.parentNode.childNodes.length;c++){if(node.parentNode.childNodes[c]==node)break;else if(node.nodeType==mozile.dom.ELEMENT_NODE){if(node.parentNode.childNodes[c].nodeName==node.nodeName)s++;}
-else if(node.parentNode.childNodes[c].nodeType==node.nodeType)s++;}
-return s;}
-mozile.dom.removeChildNodes=function(node){if(node.childNodes.length==0)return;while(node.firstChild){node.removeChild(node.firstChild);}}
-mozile.dom.getNamespaceURI=function(node){if(!node)return null;if(node.namespaceURI)return node.namespaceURI;else if(node.nodeName.indexOf(":")>-1){var prefix=node.nodeName.substring(0,node.nodeName.indexOf(":"));return mozile.dom.lookupNamespaceURI(node,prefix);}
-return mozile.dom.getDefaultNamespaceURI(node);}
-mozile.dom.getDefaultNamespaceURI=function(node){var namespaceURI=null;while(node){if(node.nodeType==mozile.dom.ELEMENT_NODE&&node.getAttribute("xmlns"))
-return node.getAttribute("xmlns");node=node.parentNode;}
-return namespaceURI;}
-mozile.dom.lookupNamespaceURI=function(node,prefix){if(!prefix)prefix=mozile.dom.getPrefix(node);var attr="xmlns";if(prefix&&node.lookupNamespaceURI){while(node){var ns=node.lookupNamespaceURI(prefix);if(ns)return ns;else node=node.parentNode;}
-return null;}
-if(prefix&&mozile.browser.isSafari){while(node&&node.getAttributeNS){if(node.getAttributeNS(attr,prefix))return node.getAttributeNS(attr,prefix);else node=node.parentNode;}
-return null;}
-if(prefix)attr="xmlns:"+prefix;while(node){if(node.getAttribute(attr))return node.getAttribute(attr);else node=node.parentNode;}
-return null;}
-mozile.dom.lookupPrefix=function(node,namespaceURI){if(!namespaceURI)namespaceURI=node.namespaceURI;if(!namespaceURI)return null;while(node&&node.attributes){for(var i=0;i<node.attributes.length;i++){if(node.attributes[i].nodeName.indexOf("xmlns:")==0&&node.attributes[i].nodeValue==namespaceURI){return node.attributes[i].nodeName.substring(6);}}
-node=node.parentNode;}
-return null;}
-mozile.dom.convertStyleName=function(styleName){if(!styleName||typeof(styleName)!="string")return null;return styleName.replace(/\-(\w)/g,function(strMatch,p1){return p1.toUpperCase();});}
-mozile.dom.getStyle=function(node,cssRule){var value="";if(!node)return value;if(node.nodeType!=mozile.dom.ELEMENT_NODE)node=node.parentNode;if(!node||node.nodeType!=mozile.dom.ELEMENT_NODE)return value;if(document.defaultView&&document.defaultView.getComputedStyle){value=document.defaultView.getComputedStyle(node,"").getPropertyValue(cssRule);}
-else if(node.currentStyle){cssRule=mozile.dom.convertStyleName(cssRule);value=node.currentStyle[cssRule];}
-return value;}
-mozile.dom.setStyle=function(element,rule,value){if(!element)return;if(!rule||typeof(rule)!="string")return;rule=mozile.dom.convertStyleName(rule);if(element.style)element.style[rule]=value;else mozile.debug.debug("mozile.dom.setStyle","Element does not have a 'style' attribute.");}
-mozile.dom.addStyleSheet=function(href,type){var link;if(mozile.defaultNS!=null){mozile.require("mozile.xml");link=mozile.dom.createElementNS(mozile.xml.ns.xhtml,"link");}
-else link=mozile.dom.createElement("link");link.setAttribute("class","mozileLink");link.setAttribute("href",href);link.setAttribute("rel","stylesheet");if(!type)type="text/css";link.setAttribute("type",type);mozile.dom.getHead().appendChild(link);mozile.dom.links.push(link);return link;}
-mozile.dom.getStyleSheet=function(element){if(!element)return null;if(element.styleSheet!=undefined)return element.styleSheet;else if(element.sheet!=undefined)return element.sheet;return null;}
-mozile.dom.getClass=function(element){if(!element||element.nodeType!=mozile.dom.ELEMENT_NODE)return"";var value;if(element.className!=undefined)value=element.className;else value=element.getAttribute("class");if(value)return value;else return"";}
-mozile.dom.setClass=function(element,value){if(!element||element.nodeType!=mozile.dom.ELEMENT_NODE)return null;if(!value||typeof(value)!="string")return null;if(element.className!=undefined)element.className=value;else element.setAttribute("class",value);return value;}
-mozile.dom.hasClass=function(element,className){if(!element)return false;var attr=mozile.dom.getClass(element);if(!attr)return false;if(!className)return true;attr=attr.split(/\s+/);for(var i=0;i<attr.length;i++){if(attr[i]==className)return true;}
-return false;}
-mozile.dom.getX=function(node,container){if(!node)return 0;if(node.nodeType!=mozile.dom.ELEMENT_NODE)node=node.parentNode;if(!node)return 0;var x=0;if(node.offsetParent){while(node.offsetParent){x+=node.offsetLeft;node=node.offsetParent;if(node==container)break;}}
-else if(node.x)x+=node.x;return x;}
-mozile.dom.getY=function(node,container){if(!node)return 0;if(node.nodeType!=mozile.dom.ELEMENT_NODE)node=node.parentNode;if(!node)return 0;var y=0;if(node.offsetParent){while(node.offsetParent){y+=node.offsetTop;node=node.offsetParent;if(node==container)break;}}
-else if(node.y)y+=node.y;return y;}
-mozile.dom.getAttributeNS=function(element,namespaceURI,name){if(!element)return null;if(element.getAttributeNS)return element.getAttributeNS(namespaceURI,name);else{prefix=mozile.dom.lookupPrefix(element,namespaceURI);if(prefix)return element.getAttribute(prefix+":"+name);}
-return null;}
-mozile.dom.createElement=function(name){if(mozile.defaultNS){return mozile.dom.createElementNS(mozile.defaultNS,name);}else{return document.createElement(name);}}
-mozile.dom.createElementNS=function(namespaceURI,name){if(document.createElementNS&&!mozile.browser.isSafari)return document.createElementNS(namespaceURI,name);else{mozile.require("mozile.xml");return mozile.xml.parseElement('<'+name+' xmlns="'+namespaceURI+'"/>');}
-return null;}
-mozile.dom.importNode=function(node,deep){if(!node||!node.nodeType)return null;var clone;var i=0;switch(node.nodeType){case mozile.dom.ELEMENT_NODE:clone=mozile.dom.createElement(node.nodeName);for(i=node.attributes.length-1;i>=0;i--){clone.setAttribute(node.attributes[i].nodeName,node.attributes[i].nodeValue);}
-break;case mozile.dom.TEXT_NODE:clone=document.createTextNode(node.data);break;case mozile.dom.COMMENT_NODE:clone=document.createComment(node.data);break;default:return null;}
-if(deep){var child;for(i=0;i<node.childNodes.length;i++){child=mozile.dom.importNode(node.childNodes[i],true);if(child)clone.appendChild(child);}}
-return clone;}
-mozile.dom.Range=function(selectRange){var range;if(document.createRange){if(selectRange)range=selectRange.cloneRange();else range=document.createRange();for(var field in mozile.dom.Range.prototype)
-range[field]=mozile.dom.Range.prototype[field];return range;}else{if(selectRange&&selectRange._range){range=new mozile.dom.InternetExplorerRange(selectRange._range.duplicate());range._init();return range;}
-else return new mozile.dom.InternetExplorerRange();}}
-mozile.dom.Range.prototype.store=function(){var state=new Object();if(false&&this._range){state.format="IE";state.bookmark=this._range.getBookmark();}
-else{mozile.require("mozile.xpath");state.type="Range";state.format="W3C";state.startContainer=mozile.xpath.getXPath(this.startContainer);state.startOffset=this.startOffset;if(this.startContainer==this.endContainer)
-state.endContainer=state.startContainer;else state.endContainer=mozile.xpath.getXPath(this.endContainer);state.endContainer=mozile.xpath.getXPath(this.endContainer);state.endOffset=this.endOffset;}
-return state;}
-mozile.dom.Range.prototype.restore=function(state){try{if(false&&this._range){this._range.moveToBookmark(state.bookmark);this._init();}
-else{mozile.require("mozile.xpath");var startContainer,endContainer;startContainer=mozile.xpath.getNode(state.startContainer);this.setStart(startContainer,state.startOffset);if(state.endContainer==state.startContainer)
-endContainer=startContainer;else endContainer=mozile.xpath.getNode(state.endContainer);this.setEnd(endContainer,state.endOffset);}}catch(e){alert("Error [mozile.dom.Range.restore]:\n"+mozile.dumpError(e))}}
-mozile.dom.selection=new Object();mozile.dom.selection.prototype=new mozile.Module;mozile.dom.selection.xPadding=50;mozile.dom.selection.yPadding=100;mozile.dom.selection.get=function(){if(!mozile.dom._selection)mozile.dom._selection=new mozile.dom.Selection();else if(mozile.browser.isIE)mozile.dom._selection._init();return mozile.dom._selection;}
-mozile.dom.Selection=function(){if(window.getSelection){var selection=window.getSelection();for(var field in mozile.dom.Selection.prototype)
-selection[field]=mozile.dom.Selection.prototype[field];return selection;}else{return new mozile.dom.InternetExplorerSelection();}}
-mozile.dom.Selection.prototype.store=function(oldState,newOffset){var state=new Object();if(oldState){for(var i in oldState)state[i]=oldState[i];state.anchorOffset=newOffset;state.focusOffset=newOffset;return state;}
-else if(this.rangeCount>0){mozile.require("mozile.xpath");state.type="Selection";state.format="W3C";state.anchorNode=mozile.xpath.getXPath(this.anchorNode);state.anchorOffset=this.anchorOffset;if(this.focusNode==this.anchorNode)state.focusNode=state.anchorNode;else state.focusNode=mozile.xpath.getXPath(this.focusNode);state.focusOffset=this.focusOffset;state.isCollapsed=this.isCollapsed;return state;}
-return null;}
-mozile.dom.Selection.prototype.restore=function(state){if(state){if(state.type=="Selection"){mozile.require("mozile.xpath");var anchorNode,focusNode;anchorNode=mozile.xpath.getNode(state.anchorNode);this.collapse(anchorNode,state.anchorOffset);if(state.focusNode!=state.anchorNode||state.focusOffset!=state.anchorOffset){if(state.focusNode==state.anchorNode)focusNode=anchorNode;else focusNode=mozile.xpath.getNode(state.focusNode);try{this.extend(focusNode,state.focusOffset);}catch(e){mozile.debug.debug("mozile.dom.Selection.restore","Error extending selection to '"+state.focusNode+" "+state.focusOffset+"'.\n"+mozile.dumpError(e));}}}
-else if(state.type=="Range"){var range=new mozile.dom.Range();range.restore(state);this.removeAllRanges();this.addRange(range);}}
-else if(mozile.dom.selection.last){this.collapse(mozile.dom.selection.last.anchorNode,mozile.dom.selection.last.anchorOffset);if(!mozile.dom.selection.last.isCollapsed){this.extend(mozile.dom.selection.last.focusNode,mozile.dom.selection.last.focusOffset);}}}
-mozile.dom.Selection.prototype.scroll=function(){if(!this.focusNode);var x=mozile.dom.getX(this.focusNode);var y=mozile.dom.getY(this.focusNode);var pX=window.pageXOffset;var pY=window.pageYOffset;if(x<pX||x>(pX+window.innerWidth)||y<pY||y>(pY+window.innerHeight)){window.scroll(x-mozile.dom.selection.xPadding,y-mozile.dom.selection.yPadding);}}
-mozile.dom.Selection.getSelection=function(){if(window.getSelection){return window.getSelection();}else if(document.getSelection){return document.getSelection();}else if(document.selection){return new mozile.dom.Selection();}
-return null;}
-if(mozile.browser.isIE){mozile.require("mozile.dom.TreeWalker");mozile.require("mozile.dom.InternetExplorerRange");mozile.require("mozile.dom.InternetExplorerSelection");}
-else{mozile.dom.NodeFilter=NodeFilter;mozile.dom.TreeWalker=TreeWalker;}
-mozile.xml=new Object();mozile.xml.prototype=new mozile.Module;mozile.xml.ns={AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/",atom:"http://www.w3.org/2005/Atom",cml:"http://www.xml-cml.org",dc:"http://purl.org/dc/elements/1.1/",dcq:"http://purl.org/dc/qualifiers/1.0",dt:"http://www.w3.org/2001/XMLSchema-datatypes",fo:"http://www.w3.org/1999/XSL/Format",mes:"http://mozile.mozdev.org/ns/mes/1.0",mml:"http://www.w3.org/1998/Math/MathML",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rng:"http://relaxng.org/ns/structure/1.0",saxon:"http://icl.com/saxon","soap-env":"http://schemas.xmlsoap.org/soap/envelope/",smil:"http://www.w3.org/2001/SMIL20/",svg:"http://www.w3.org/2000/svg",wsdl:"http://schemas.xmlsoap.org/wsdl/",xalan:"http://xml.apache.org/xslt",xbl:"http://www.mozilla.org/xbl",xforms:"http://www.w3.org/2002/01/xforms",xhtml:"http://www.w3.org/1999/xhtml",xi:"http://www.w3.org/2001/XInclude",xlink:"http://www.w3.or
 g/1999/xlink",xsd:"http://www.w3.org/2001/XMLSchema",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsl:"http://www.w3.org/1999/XSL/Transform",xslt:"http://www.w3.org/1999/XSL/Transform",xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"};mozile.xml._IE_DOM=null;mozile.xml._IE_THREADEDDOM=null;mozile.xml._IE_XSLTEMPLATE=null;mozile.xml._IE_XMLWRITER=null;mozile.xml.lookupPrefix=function(namespaceURI){for(var prefix in mozile.xml.ns){if(mozile.xml.ns[prefix]==namespaceURI)return prefix;}
-return null;}
-mozile.xml.load=function(filepath){if(typeof(filepath)!="string")return null;var uri;if(filepath.indexOf(":")>0)uri=filepath;else{var loc=location.toString();loc=loc.substring(0,loc.lastIndexOf("?"));loc=loc.substring(0,loc.lastIndexOf("/")+1);uri=loc+filepath;}
-if(mozile.browser.isSafari)uri=uri.replace("file://","file:///");try{var XHR=new XMLHttpRequest();XHR.overrideMimeType("text/xml");XHR.open("GET",uri,false);try{XHR.send(null);return XHR.responseXML;}catch(e){mozile.debug.inform("mozile.xml.load","Error loading document: "+e);return null;}}
-catch(e){try{mozile.xml._getDomProgID();var xmlDoc=new ActiveXObject(mozile.xml._IE_DOM);xmlDoc.async=false;try{var loaded=xmlDoc.load(uri);if(loaded)return xmlDoc;else{mozile.debug.inform("mozile.xml.load","Failed to load document.");}}catch(e){mozile.debug.inform("mozile.xml.load","Error loading document: "+mozile.dumpError(e));}}
-catch(e){mozile.debug.inform("mozile.xml.load","No XML loading technique avaliable in this browser.");}}
-return null;}
-mozile.xml.parse=function(string){if(window.ActiveXObject){mozile.xml._getDomProgID();var xmlDoc=new ActiveXObject(mozile.xml._IE_DOM);xmlDoc.async="false";xmlDoc.loadXML(string);return xmlDoc;}
-else if(window.DOMParser){var parser=new DOMParser();return parser.parseFromString(string,"text/xml");}
-else{mozile.debug.inform("mozile.xml.serialize","No XML parsing technique avaliable in this browser.");return null;}}
-mozile.xml.parseElement=function(string){var doc=mozile.xml.parse(string);if(doc&&doc.documentElement)return doc.documentElement;else return null;}
-mozile.xml.serialize=function(node){if(!node)return null;if(node.xml)return node.xml;else if(window.XMLSerializer){var serializer=new XMLSerializer()
-return serializer.serializeToString(node);}
-else if(node.outerHTML)return node.outerHTML;else if(node.innerHTML){var container=document.createElement("container");container.appendChild(node.cloneNode(true));return container.innerHTML;}
-else{mozile.debug.inform("mozile.xml.serialize","No XML serialization technique avaliable in this browser.");return null;}}
-mozile.xml.transformToDocument=function(target,stylesheet,parameters){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;if(window.ActiveXObject){var method=mozile.xml._getMethod(stylesheet);var result=mozile.xml._IETransform(target,stylesheet,parameters);if(method=="text")result="<result>"+result+"</result>";return mozile.xml.parse(result);}
-if(window.XSLTProcessor!=undefined){var processor=new XSLTProcessor();processor.importStylesheet(stylesheet);mozile.xml._setParameters(processor,parameters);return processor.transformToDocument(target);}
-else{mozile.debug.inform("mozile.xml.transformToDocument","No XSLT technique avaliable in this browser.");return null;}}
-mozile.xml.transformToFragment=function(target,stylesheet,parameters,ownerDoc){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;if(!ownerDoc)ownerDoc=document;if(window.ActiveXObject){var method=mozile.xml._getMethod(stylesheet);var result=mozile.xml._IETransform(target,stylesheet,parameters);var fragment=ownerDoc.createDocumentFragment();if(method=="text")fragment.appendChild(ownerDoc.createTextNode(result));else if(method=="html"&&ownerDoc.body&&ownerDoc.body.innerHTML){var container=ownerDoc.createElement("div");container.innerHTML=result;while(container.childNodes.length)
-fragment.appendChild(container.firstChild);}
-else{fragment.appendChild(mozile.xml.parseElement(result));}
-return fragment;}
-if(window.XSLTProcessor!=undefined){var processor=new XSLTProcessor();processor.importStylesheet(stylesheet);mozile.xml._setParameters(processor,parameters);return processor.transformToFragment(target,ownerDoc);}
-else{mozile.debug.inform("mozile.xml.transformToFragment","No XSLT technique avaliable in this browser.");return null;}}
-mozile.xml.transformToString=function(target,stylesheet,parameters){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;if(window.ActiveXObject){return mozile.xml._IETransform(target,stylesheet,parameters);}
-if(window.XSLTProcessor!=undefined){var processor=new XSLTProcessor();processor.importStylesheet(stylesheet);mozile.xml._setParameters(processor,parameters);var result=processor.transformToDocument(target);var source=mozile.xml.serialize(result.documentElement);if(result.documentElement.nodeName=="transformiix:result")
-source=source.substring(78,source.length-22);return source;}
-else{mozile.debug.inform("mozile.xml.transformToString","No XSLT technique avaliable in this browser.");return null;}}
-mozile.xml._getMethod=function(stylesheet){var method="html";if(!stylesheet)return method;var result;if(window.ActiveXObject){stylesheet.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");result=stylesheet.selectSingleNode("//xsl:output");}
-else if(window.XSLTProcessor!=undefined){mozile.require("mozile.xpath");var results=mozile.xpath.evaluate("//xsl:output",stylesheet);if(results[0])result=results[0];}
-else return method;if(result)method=result.getAttribute("method");return method;}
-mozile.xml._setParameters=function(processor,parameters){if(!processor)return;if(!parameters)return;var param;for(var i=0;i<parameters.length;i++){param=parameters[i];if(!param.name||!param.value)continue;if(processor.setParameter){processor.setParameter(param.namespace,param.name,param.value);}
-else{if(param.namespace)
-processor.addParameter(param.name,param.value,param.namespace);else processor.addParameter(param.name,param.value);}}}
-mozile.xml._nodeToDocument=function(node){if(target.nodeType==mozile.dom.DOCUMENT_NODE)return node;var doc;if(window.ActiveXObject){var source=mozile.xml.serialize(node);return mozile.xml.parse(source);}
-else if(document.implementation){doc=document.implementation.createDocument("","",null);var clone=doc.importNode(target,true);doc.appendChild(clone);return doc;}
-else return null;}
-mozile.xml._IETransform=function(target,stylesheet,parameters){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;var method,processor,result;try{mozile.xml._getDomProgID();mozile.xml._getXMLProgIDs();var newStyle=new ActiveXObject(mozile.xml._IE_THREADEDDOM);newStyle.loadXML(stylesheet.xml);var xslt=new ActiveXObject(mozile.xml._IE_XSLTEMPLATE);xslt.stylesheet=newStyle;processor=xslt.createProcessor();processor.input=target;mozile.xml._setParameters(processor,parameters);processor.transform();return processor.output;}catch(e){return"XSLT ERROR "+mozile.dumpError(e);}}
-mozile.xml._pickRecentProgID=function(idList){var bFound=false;for(var i=0;i<idList.length&&!bFound;i++){try{var oDoc=new ActiveXObject(idList[i]);o2Store=idList[i];bFound=true;}catch(objException){};};if(!bFound){throw"Could not retreive a valid progID of Class: "+idList[idList.length-1]+". (original exception: "+e+")";};idList=null;return o2Store;}
-mozile.xml._getDomProgID=function(){if(!mozile.xml._IE_DOM){mozile.xml._IE_DOM=mozile.xml._pickRecentProgID(["Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]);}}
-mozile.xml._getXMLProgIDs=function(){if(!mozile.xml._IE_XSLTEMPLATE){mozile.xml._IE_XSLTEMPLATE=mozile.xml._pickRecentProgID(["Msxml2.XSLTemplate.5.0","Msxml2.XSLTemplate.4.0","MSXML2.XSLTemplate.3.0"]);mozile.xml._IE_THREADEDDOM=mozile.xml._pickRecentProgID(["Msxml2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.4.0","MSXML2.FreeThreadedDOMDocument.3.0"]);mozile.xml._IE_XMLWRITER=mozile.xml._pickRecentProgID(["Msxml2.MXXMLWriter.5.0","Msxml2.MXXMLWriter.4.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"]);}}
-mozile.xpath=new Object();mozile.xpath.prototype=new mozile.Module;mozile.xpath.getXPath=function(node,root){if(!node||node.nodeType==undefined||!node.nodeType)return"";if(node==root)return"";var parent=node.parentNode;switch(node.nodeType){case mozile.dom.ELEMENT_NODE:var nodeName;if(node.prefix)nodeName=node.nodeName;else nodeName=node.nodeName;if(!nodeName)nodeName=node.nodeName;if(mozile.dom.isHTML(node))nodeName=nodeName.toLowerCase();if(node.ownerDocument&&node.ownerDocument.documentElement==node)
-return"/"+nodeName+"[1]";else return mozile.xpath.getXPath(parent,root)
-+"/"+nodeName+"["+mozile.dom.getPosition(node)+"]";case mozile.dom.ATTRIBUTE_NODE:if(!parent)parent=node.ownerElement;return mozile.xpath.getXPath(parent,root)+"/@"+node.nodeName;case mozile.dom.TEXT_NODE:if(node==this._lastNode&&root==this._lastRoot)
-return this._lastXPath;var xpath=mozile.xpath.getXPath(parent,root)
-+"/text()["+mozile.dom.getPosition(node)+"]";this._lastNode=node;this._lastRoot=root;this._lastXPath=xpath;return xpath;case mozile.dom.COMMENT_NODE:return mozile.xpath.getXPath(parent,root)
-+"/comment()["+mozile.dom.getPosition(node)+"]";default:if(parent)return mozile.xpath.getXPath(parent,root);else return"";}}
-mozile.xpath.getComponents=function(expression){if(typeof(expression)!="string")return[];var components=expression.split("/");for(var c=0;c<components.length;c++){if(!components[c])components.splice(c,1);}
-return components;}
-mozile.xpath.getComponent=function(expression){var result=new Object();var components=mozile.xpath.getComponents(expression);if(components.length==0)return result;var component=components[components.length-1];var match=component.match(/(\S+:)?(\S+)\[(\d+)\]|(\S+:)?(\S+)/);if(match){if(match[1]&&match[2]){result.name=match[1]+match[2];result.localName=match[2];}
-else if(match[2]){result.name=match[2];result.localName=match[2];}
-else if(match[4]&&match[5]){result.name=match[4]+match[5];result.localName=match[5];}
-else if(match[5]){result.name=match[5];result.localName=match[5];}
-if(match[3])result.position=match[3];else result.position=null;}
-return result;}
-mozile.xpath.getNode=function(expression,root){if(!root)root=document;if(!expression)return root;if(expression==this._lastXPath&&root==this._lastRoot)return this._lastNode;var node;if(!node){var components=mozile.xpath.getComponents(expression);node=root;for(var i=0;i<components.length;i++){var component=mozile.xpath.getComponent(components[i]);node=mozile.xpath._getNthChild(node,component.name,component.position);if(!node)return null;}}
-if(node){this._lastNode=node;this._lastRoot=root;this._lastXPath=expression;return node;}
-else return null;}
-mozile.xpath._getNthChild=function(parent,name,position){var c=0;var p=1;if(parent.nodeType==mozile.dom.DOCUMENT_NODE)
-return parent.documentElement;if(name=="text()"){for(c=0;c<parent.childNodes.length;c++){if(parent.childNodes[c].nodeType==mozile.dom.TEXT_NODE){if(p==position)return parent.childNodes[c];p++;}}}
-else if(name=="comment()"){for(c=0;c<parent.childNodes.length;c++){if(parent.childNodes[c].nodeType==mozile.dom.COMMENT_NODE){if(p==position)return parent.childNodes[c];p++;}}}
-if(name.indexOf("@")==0){name=name.substring(1);return parent.getAttributeNode(name);}
-else{if(name.indexOf("xmlns:")>-1)name=name.substring(6);for(c=0;c<parent.childNodes.length;c++){var childName=parent.childNodes[c].nodeName;if(childName==name||childName==name.toUpperCase()){if(p==position)return parent.childNodes[c];p++;}}}
-return null;}
-mozile.xpath.evaluate=function(expression,root){if(!root)root=document;var doc;if(root.ownerDocument)doc=root.ownerDocument;else{doc=root;root=root.documentElement;}
-var nodes=new Array();var results,result;if(window.XPathEvaluator){var XPE=new XPathEvaluator;var NSR=function(prefix){var namespaceURI=mozile.dom.lookupNamespaceURI(root,prefix);if(namespaceURI)return namespaceURI;else if(mozile.xml.ns[prefix])return mozile.xml.ns[prefix];return mozile.defaultNS;}
-try{results=XPE.evaluate(expression,root,NSR,0,null);if(results){result=results.iterateNext();while(result){nodes.push(result);result=results.iterateNext();}}}catch(e){alert(doc.documentElement.getAttribute("xmlns")+"\n"+e);}}
-else if(root.selectNodes){results=root.selectNodes(expression);result=results.nextNode();while(result){nodes.push(result);result=results.nextNode();}}
-return nodes;}
-mozile.util=new Object();mozile.util.prototype=new mozile.Module;mozile.util.dumpKeys=function(obj){var keys=new Array();for(var key in obj)keys.push(key);keys.sort();return keys.join(", ");}
-mozile.util.dumpValues=function(obj){var result=new Array();for(var key in obj){result.push(key+" = "+obj[key]);}
-result.sort();return result.join("\n");}
-mozile.util.capitalize=function(string){if(!string)return string;return string.replace(/\w+/g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();});}
-mozile.util.pad=function(string,length,left){if(!string)string=" ";else string=String(string);if(!this._memory)this._memory=new Object();var id=string+":"+length+":"+left;if(this._memory[id])return this._memory[id];var space="";if(string.length<length){for(var s=0;s<length-string.length;s++)space+=" ";}
-var result;if(left)result=space+string;else result=string+space;this._memory[id]=result;return result;}
-mozile.util.debug=function(details,level,message){if(level>=mozile.getDebugLevel()||details["Status Message"]){var date=new Date();mozile.util.messages.push([date.toLocaleString(),details,level,message]);}
-return true;}
-mozile.util.messages=new Array();mozile.dom.NodeFilter={FILTER_ACCEPT:1,FILTER_REJECT:2,FILTER_SKIP:3,SHOW_ALL:-1,SHOW_ELEMENT:1,SHOW_ATTRIBUTE:2,SHOW_TEXT:4,SHOW_CDATA_SECTION:8,SHOW_ENTITY_REFERENCE:16,SHOW_ENTITY:32,SHOW_PROCESSING_INSTRUCTIONS:64,SHOW_COMMENT:128,SHOW_DOCUMENT:256,SHOW_DOCUMENT_TYPE:512,SHOW_DOCUMENT_FRAGMENT:1024,SHOW_NOTATION:2048}
-mozile.dom.TreeWalker=function(root,whatToShow,filter,expandEntityReferences){this.root=root;this.whatToShow=whatToShow;this.filter=filter;this.expandEntityReferences=expandEntityReferences;this.currentNode=root;}
-mozile.dom.TreeWalker.prototype.parentNode=function(){var testNode=this.currentNode;do{if(testNode!=this.root&&testNode.parentNode!=this.root&&testNode.parentNode!=null){testNode=testNode.parentNode;}
-else return null;}while(this._getFilteredStatus(testNode)!=mozile.dom.NodeFilter.FILTER_ACCEPT);if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype.firstChild=function(){var testNode=this.currentNode.firstChild;while(testNode!=null){if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}
-testNode=testNode.nextSibling;}
-if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype.lastChild=function(){var testNode=this.currentNode.lastChild;while(testNode!=null){if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}
-testNode=testNode.previousSibling;}
-if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype.nextNode=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.childNodes.length!=0)testNode=testNode.firstChild;else if(testNode.nextSibling!=null)testNode=testNode.nextSibling;else{while(testNode!=null){if(testNode.parentNode!=this.root&&testNode.parentNode!=null){if(testNode.parentNode.nextSibling!=null){testNode=testNode.parentNode.nextSibling;break;}
-else testNode=testNode.parentNode;}
-else return null;}}
-if(testNode!=null&&this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
-if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype.previousNode=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.previousSibling!=null){testNode=testNode.previousSibling;while(testNode.lastChild!=null){testNode=testNode.lastChild;}}
-else{if(testNode.parentNode!=this.root&&testNode.parentNode!=null){testNode=testNode.parentNode;}
-else testNode=null;}
-if(testNode!=null&&this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
-if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype.nextSibling=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.nextSibling!=null)testNode=testNode.nextSibling;if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
-if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype.previousSibling=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.previousSibling!=null)testNode=testNode.previousSibling;if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
-if(testNode!=null)this.currentNode=testNode;return testNode;}
-mozile.dom.TreeWalker.prototype._getFilteredStatus=function(node){var mask=null;switch(node.nodeType){case mozile.dom.ELEMENT_NODE:mask=mozile.dom.NodeFilter.SHOW_ELEMENT;break;case mozile.dom.ATTRIBUTE_NODE:mask=mozile.dom.NodeFilter.SHOW_ATTRIBUTE;break;case mozile.dom.TEXT_NODE:mask=mozile.dom.NodeFilter.SHOW_TEXT;break;case mozile.dom.CDATA_SECTION_NODE:mask=mozile.dom.NodeFilter.SHOW_CDATA_SECTION;break;case mozile.dom.ENTITY_REFERENCE_NODE:mask=mozile.dom.NodeFilter.SHOW_ENTITY_REFERENCE;break;case mozile.dom.ENTITY_NODE:mask=mozile.dom.NodeFilter.SHOW_PROCESSING_INSTRUCTION;break;case mozile.dom.PROCESSING_INSTRUCTION_NODE:mask=mozile.dom.NodeFilter.SHOW_PROCESSING_INSTRUCTION;break;case mozile.dom.COMMENT_NODE:mask=mozile.dom.NodeFilter.SHOW_COMMENT;break;case mozile.dom.DOCUMENT_NODE:mask=mozile.dom.NodeFilter.SHOW_DOCUMENT;break;case mozile.dom.DOCUMENT_TYPE_NODE:mask=mozile.dom.NodeFilter.SHOW_DOCUMENT_TYPE;break;case mozile.dom.DOCUMENT_FRAGMENT_NODE:mask=mozile.dom.Node
 Filter.SHOW_DOCUMENT_FRAGMENT;break;case mozile.dom.NOTATION_NODE:mask=mozile.dom.NodeFilter.SHOW_NOTATION;break;}
-if(mask!=null&&(this.whatToShow&mask)==0){return mozile.dom.NodeFilter.FILTER_REJECT;}
-if(this.filter!=null&&this.filter.acceptNode!=null){return this.filter.acceptNode(node);}
-return mozile.dom.NodeFilter.FILTER_ACCEPT;}
-if(mozile.browser.isIE){document.createTreeWalker=function(root,whatToShow,filter,expandEntityReferences){return new mozile.dom.TreeWalker(root,whatToShow,filter,expandEntityReferences);};mozile.dom.NodeFilter=mozile.dom.NodeFilter;mozile.dom.TreeWalker=mozile.dom.TreeWalker;}
-else{mozile.dom.NodeFilter=NodeFilter;mozile.dom.TreeWalker=TreeWalker;}
-mozile.dom.InternetExplorerRange=function(range){this._range=null;if(range)
-this._range=range;else{this._range=document.body.createTextRange();}
-this.collapsed=null;this.commonAncestorContainer=null;this.startContainer=null;this.startOffset=null;this.endContainer=null;this.endOffset=null;}
-mozile.dom.InternetExplorerRange.prototype._init=function(){var beginRange=this._range.duplicate();beginRange.collapse(true);var position=this._getPosition(beginRange);this.startContainer=position.node;this.startOffset=position.offset;var endRange=this._range.duplicate();endRange.collapse(false);position=this._getPosition(endRange);this.endContainer=position.node;this.endOffset=position.offset;this._commonAncestorContainer();this._collapsed();}
-mozile.dom.InternetExplorerRange.prototype._getPosition=function(textRange){var element=textRange.parentElement();var range=document.body.createTextRange();range.moveToElementText(element);range.setEndPoint("EndToStart",textRange);var rangeLength=range.text.length;if(rangeLength<element.innerText.length/2){var direction=1;var node=element.firstChild;}
-else{direction=-1;node=element.lastChild;range.moveToElementText(element);range.setEndPoint("StartToStart",textRange);rangeLength=range.text.length;}
-while(node){switch(node.nodeType){case mozile.dom.TEXT_NODE:nodeLength=node.data.length;if(nodeLength<rangeLength){var difference=rangeLength-nodeLength;if(direction==1)range.moveStart("character",difference);else range.moveEnd("character",-difference);rangeLength=difference;}
-else{if(direction==1)return{node:node,offset:rangeLength};else return{node:node,offset:nodeLength-rangeLength};}
-break;case mozile.dom.ELEMENT_NODE:nodeLength=node.innerText.length;if(direction==1)range.moveStart("character",nodeLength);else range.moveEnd("character",-nodeLength);rangeLength=rangeLength-nodeLength;break;}
-if(direction==1)node=node.nextSibling;else node=node.previousSibling;}
-return{node:element,offset:0};}
-mozile.dom.InternetExplorerRange.prototype._getOffset=function(startNode,startOffset){var node,moveCharacters;if(startNode.nodeType==mozile.dom.TEXT_NODE){moveCharacters=startOffset;node=startNode.previousSibling;}
-else if(startNode.nodeType==mozile.dom.ELEMENT_NODE){moveCharacters=0;if(startOffset>0)node=startNode.childNodes[startOffset-1];else return 0;}
-else{mozile.debug.inform("mozile.dom.InternetExplorerRange.prototype._getOffset","Bad node given: "+mozile.xpath.getXPath(startNode));return 0;}
-while(node){var nodeLength=0;if(node.nodeType==mozile.dom.ELEMENT_NODE){nodeLength=node.innerText.length;if(this._isChildless(node))nodeLength=1;if(this._isBlock(node))nodeLength++;}
-else if(node.nodeType==mozile.dom.TEXT_NODE){nodeLength=node.data.length;}
-moveCharacters+=nodeLength;node=node.previousSibling;}
-return moveCharacters;}
-mozile.dom.InternetExplorerRange.prototype._isBlock=function(node){switch(node.nodeName.toLowerCase()){case'p':case'div':case'h1':case'h2':case'h3':case'h4':case'h5':case'h6':case'pre':return true;}
-return false;}
-mozile.dom.InternetExplorerRange.prototype._isChildless=function(node){switch(node.nodeName.toLowerCase()){case'img':case'br':case'hr':return true;}
-return false;}
-mozile.dom.InternetExplorerRange.prototype.setStart=function(startNode,startOffset){var container=startNode;if(startNode.nodeType==mozile.dom.TEXT_NODE||startNode.nodeType==mozile.dom.COMMENT_NODE||startNode.nodeType==mozile.dom.CDATA_SECTION_NODE){container=container.parentNode;}
-var copyRange=this._range.duplicate();copyRange.moveToElementText(container);copyRange.collapse(true);copyRange.move('Character',this._getOffset(startNode,startOffset));this._range.setEndPoint('StartToStart',copyRange);this.startContainer=startNode;this.startOffset=startOffset;if(this.endContainer==null&&this.endOffset==null){this.endContainer=startNode;this.endOffset=startOffset;}
-this._commonAncestorContainer();this._collapsed();}
-mozile.dom.InternetExplorerRange.prototype.setEnd=function(endNode,endOffset){var copyRange=this._range.duplicate();copyRange.collapse(true);var container=endNode;if(endNode.nodeType==mozile.dom.TEXT_NODE||endNode.nodeType==mozile.dom.COMMENT_NODE||endNode.nodeType==mozile.dom.CDATA_SECTION_NODE){container=container.parentNode;}
-copyRange=this._range.duplicate();copyRange.moveToElementText(container);copyRange.collapse(true);copyRange.move('Character',this._getOffset(endNode,endOffset));this._range.setEndPoint('EndToEnd',copyRange);this.endContainer=endNode;this.endOffset=endOffset;if(this.startContainer==null&&this.startOffset==null){this.startContainer=endNode;this.startOffset=endOffset;}
-this._commonAncestorContainer();this._collapsed();}
-mozile.dom.InternetExplorerRange.prototype.setStartBefore=function(referenceNode){this.setStart(referenceNode.parentNode,mozile.dom.getIndex(referenceNode));};mozile.dom.InternetExplorerRange.prototype.setStartAfter=function(referenceNode){this.setStart(referenceNode.parentNode,mozile.dom.getIndex(referenceNode)+1);};mozile.dom.InternetExplorerRange.prototype.setEndBefore=function(referenceNode){this.setEnd(referenceNode.parentNode,mozile.dom.getIndex(referenceNode));};mozile.dom.InternetExplorerRange.prototype.setEndAfter=function(referenceNode){this.setEnd(referenceNode.parentNode,mozile.dom.getIndex(referenceNode)+1);};mozile.dom.InternetExplorerRange.prototype.selectNode=function(referenceNode){this.setStartBefore(referenceNode);this.setEndAfter(referenceNode);};mozile.dom.InternetExplorerRange.prototype.selectNodeContents=function(referenceNode){this.setStart(referenceNode,0);if(referenceNode.nodeType==mozile.dom.TEXT_NODE)
-this.setEnd(referenceNode,referenceNode.data.length);else
-this.setEnd(referenceNode,referenceNode.childNodes.length);};mozile.dom.InternetExplorerRange.prototype.collapse=function(toStart){this._range.collapse(toStart);if(toStart){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;}
-this._commonAncestorContainer();this._collapsed();};mozile.dom.InternetExplorerRange.prototype.cloneContents=function(){var df=document.createDocumentFragment();var container=this.commonAncestorContainer;if(container.nodeType==mozile.dom.TEXT_NODE){df.appendChild(document.createTextNode(this._range.text));return df;}
-var startNode=this.startContainer;if(this.startContainer.nodeType!=mozile.dom.TEXT_NODE)
-startNode=this.startContainer.childNodes[this.startOffset];var endNode=this.endContainer;if(this.endContainer.nodeType!=mozile.dom.TEXT_NODE)
-endNode=this.endContainer.childNodes[this.endOffset-1];if(startNode==endNode){df.appendChild(startNode.cloneNode(true));return df;}
-var current=container.firstChild;var parent=null;var clone;while(current){if(!parent){if(mozile.dom.isAncestorOf(current,startNode,container)){parent=df;}
-else{current=current.nextSibling;continue;}}
-if(current==startNode&&this.startContainer.nodeType==mozile.dom.TEXT_NODE){content=this.startContainer.data.substring(this.startOffset);parent.appendChild(document.createTextNode(content));}
-else if(current==endNode){if(this.endContainer.nodeType==mozile.dom.TEXT_NODE){content=this.endContainer.data.substring(0,this.endOffset);parent.appendChild(document.createTextNode(content));}
-else parent.appendChild(endNode.cloneNode(false));break;}
-else{clone=current.cloneNode(false);parent.appendChild(clone);}
-if(current.firstChild){parent=clone;current=current.firstChild;}
-else if(current.nextSibling){current=current.nextSibling;}
-else while(current){if(current.parentNode){parent=parent.parentNode;current=current.parentNode;if(current.nextSibling){current=current.nextSibling;break;}}
-else current=null;}}
-return df;};mozile.dom.InternetExplorerRange.prototype.deleteContents=function(){this._range.pasteHTML('');this.endContainer=this.startContainer;this.endOffset=this.startOffset;this._commonAncestorContainer();this._collapsed();};mozile.dom.InternetExplorerRange.prototype.extractContents=function(){var fragment=this.cloneContents();this.deleteContents();return fragment;};mozile.dom.InternetExplorerRange.prototype.insertNode=function(newNode){if(this.startContainer.nodeType==mozile.dom.TEXT_NODE){this.startContainer.splitText(this.startOffset);this.startContainer.parentNode.insertBefore(newNode,this.startContainer.nextSibling);this.setStart(this.startContainer,this.startOffset);return;}else{var parentNode=this.startContainer.parentNode;if(this.startContainer.childNodes.length==this.startOffset){parentNode.appendChild(newNode);}else{this.startContainer.insertBefore(newNode,this.startContainer.childNodes.item(this.startOffset));this.setStart(this.startContainer,this.startOffset+1);retur
 n;}}};mozile.dom.InternetExplorerRange.prototype.surroundContents=function(newNode){newNode.appendChild(this.extractContents());this.insertNode(newNode);};mozile.dom.InternetExplorerRange.prototype.compareBoundaryPoints=function(how,sourceRange){alert('mozile.dom.InternetExplorerRange.compareBoundaryPoints() is not implemented yet');};mozile.dom.InternetExplorerRange.prototype.cloneRange=function(){var r=new mozile.dom.InternetExplorerRange(this._range.duplicate());var properties=["startContainer","startOffset","endContainer","endOffset","commonAncestorContainer","collapsed"];for(var i=0;i<properties.length;i++){r[properties[i]]=this[properties[i]];}
-return r;};mozile.dom.InternetExplorerRange.prototype.detach=function(){};mozile.dom.InternetExplorerRange.prototype.toString=function(){return this._range.text;};mozile.dom.InternetExplorerRange.prototype._commonAncestorContainer=function(){if(this.startContainer==null||this.endContainer==null){this.commonAncestorContainer=null;return;}
-if(this.startContainer==this.endContainer){this.commonAncestorContainer=this.startContainer;}
-else{this.commonAncestorContainer=mozile.dom.getCommonAncestor(this.startContainer,this.endContainer);}}
-mozile.dom.InternetExplorerRange.prototype._collapsed=function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);}
-mozile.dom.InternetExplorerRange.prototype.store=mozile.dom.Range.prototype.store;mozile.dom.InternetExplorerRange.prototype.restore=mozile.dom.Range.prototype.restore;mozile.dom.InternetExplorerSelection=function(){this._selection=document.selection;this.anchorNode=null;this.anchorOffset=null;this.focusNode=null;this.focusOffset=null;this.isCollapsed=null;this.rangeCount=0;this._direction=this._LTR;this._init();}
-mozile.dom.InternetExplorerSelection.prototype._LTR=1;mozile.dom.InternetExplorerSelection.prototype._RTL=-1;mozile.dom.InternetExplorerSelection.prototype._init=function(range){if(!range)range=this.getRangeAt(0);if(!this._direction)this._direction=this._LTR;if(range&&range.startContainer){if(this._direction==this._LTR){this.anchorNode=range.startContainer;this.anchorOffset=range.startOffset;this.focusNode=range.endContainer;this.focusOffset=range.endOffset;}
-else{this.anchorNode=range.endContainer;this.anchorOffset=range.endOffset;this.focusNode=range.startContainer;this.focusOffset=range.startOffset;}
-this.isCollapsed=range.collapsed;}
-else{this.anchorNode=null;this.anchorOffset=null;this.focusNode=null;this.focusOffset=null;this.isCollapsed=true;}
-this.rangeCount=this._selection.createRangeCollection().length;}
-mozile.dom.InternetExplorerSelection.prototype.getRangeAt=function(index){var textRange=this._selection.createRangeCollection().item(index).duplicate();var range;if(this._lastTextRange&&this._lastTextRange.isEqual(textRange)){range=this._lastRange;}
-else{range=new mozile.dom.InternetExplorerRange(textRange);range._init();this._lastTextRange=textRange.duplicate();this._lastRange=range;this._direction=this._LTR;}
-return range.cloneRange();}
-mozile.dom.InternetExplorerSelection.prototype.collapse=function(parentNode,offset){try{var range=this.getRangeAt(0);range.setStart(parentNode,offset);range.setEnd(parentNode,offset);range.collapse(false);this._direction=this._LTR;this._init(range);this._lastTextRange=range._range.duplicate();this._lastRange=range;range._range.select();}catch(e){mozile.debug.debug("mozile.dom.InternetExplorerSelection.collapse","Error: "+mozile.dumpError(e));}}
-mozile.dom.InternetExplorerSelection.prototype.extend=function(parentNode,offset){var range=this.getRangeAt(0);var direction;if(parentNode==range.startContainer&&range.startOffset<=offset){direction=this._LTR;}
-else if(parentNode==range.endContainer&&range.endOffset>=offset){direction=this._RTL;}
-else if(parentNode==range.startContainer.parentNode&&range.startContainer.nodeType==mozile.dom.TEXT_NODE&&mozile.dom.getIndex(range.startContainer)<=offset){direction=this._LTR;}
-else if(parentNode==range.endContainer.parentNode&&range.endContainer.nodeType==mozile.dom.TEXT_NODE&&mozile.dom.getIndex(range.endContainer)>=offset){direction=this._RTL;}
-else{var ancestor=mozile.dom.getCommonAncestor(parentNode,range.commonAncestorContainer)
-var treeWalker=document.createTreeWalker(ancestor,mozile.dom.NodeFilter.SHOW_ALL,null,false);treeWalker.currentNode=this.anchorNode;while(treeWalker.previousNode()){if(treeWalker.currentNode==parentNode){direction=this._RTL;break;}}
-if(!direction)direction=this._LTR;}
-if(direction==this._LTR)range.setEnd(parentNode,offset);else if(direction==this._RTL)range.setStart(parentNode,offset);else return;this._direction=direction;this._init(range);this._lastTextRange=range._range.duplicate();this._lastRange=range;range._range.select();}
-mozile.dom.InternetExplorerSelection.prototype.collapseToStart=function(){var range=this.getRangeAt(0);range.collapse(true);this._init(range);range._range.select();}
-mozile.dom.InternetExplorerSelection.prototype.collapseToEnd=function(){var range=this.getRangeAt(0);range.collapse();this._init(range);range._range.select();}
-mozile.dom.InternetExplorerSelection.prototype.selectAllChildren=function(parentNode){var range=this.getRangeAt(0);range.selectNodeContents(parentNode);this._init(range);range._range.select();}
-mozile.dom.InternetExplorerSelection.prototype.addRange=function(range){this._direction=this._LTR;this._init(range);range._range.select();}
-mozile.dom.InternetExplorerSelection.prototype.removeRange=function(range){range.collapse();this._init(range);}
-mozile.dom.InternetExplorerSelection.prototype.removeAllRanges=function(){this._selection.empty();this._init();}
-mozile.dom.InternetExplorerSelection.prototype.deleteFromDocument=function(){this._selection.clear();this._init();}
-mozile.dom.InternetExplorerSelection.prototype.selectionLanguageChange=function(){}
-mozile.dom.InternetExplorerSelection.prototype.toString=function(){var range=this.getRangeAt(0);return range.toString();}
-mozile.dom.InternetExplorerSelection.prototype.containsNode=function(aNode,aPartlyContained){alert('mozile.dom.InternetExplorerSelection.containsNode() is not implemented yet');}
-mozile.dom.InternetExplorerSelection.prototype.store=mozile.dom.Selection.prototype.store;mozile.dom.InternetExplorerSelection.prototype.restore=mozile.dom.Selection.prototype.restore;mozile.dom.InternetExplorerSelection.prototype.scroll=mozile.dom.Selection.prototype.scroll;mozile.dom.Selection.restoreSelection=function(r){var range=new mozile.Range();try{range.setStart(r.startContainer,r.startOffset);range.setEnd(r.endContainer,r.endOffset);}catch(e){}
-var s=new mozile.dom.Selection();s.removeAllRanges();s.addRange(range);}
-mozile.rng=new Object();mozile.rng.prototype=new mozile.Module;mozile.rng.debug=false;mozile.rng.getName=function(){if(this._name)return this._name;if(this._element.getAttribute("name")){var match=this._element.getAttribute("name").match(/^\s*(.+?)\s*$/);if(match&&match.length==2){this._name=match[1];return this._name;}}
-throw Error("This RNG '"+this.getType()+"' element must have a 'name' attribute.");}
-mozile.rng.getLocalName=function(){if(this._localName)return this._localName;var name=this.getName();if(name.indexOf(":"))this._localName=name.substring(name.indexOf(":")+1,name.length);else this._localName=name;return this._localName;}
-mozile.rng.getPrefix=function(){if(this._prefix)return this._prefix;var name=this.getName();if(name.indexOf(":"))this._prefix=name.substring(0,name.indexOf(":"));else this._prefix=null;return this._prefix;}
-mozile.rng.checkType=function(types,type){if(typeof(types)=="string"&&types==type)return true;if(types.length){for(var i=0;i<types.length;i++){if(types[i]==type)return true;}}
-return false;}
-mozile.rng.validateSequence=function(node,validation){if(!node)throw Error("mozile.rng.validateSequence() requires a node.");if(!validation)throw Error("mozile.rng.validateSequence() requires an mozile.rng.Validation object.");var RNGChildren=this.getChildNodes();if(RNGChildren.length==0)return validation;for(var r=0;r<RNGChildren.length;r++){if(!validation.isValid)break;validation=RNGChildren[r].validate(node,validation);if(node.nodeType==mozile.dom.ELEMENT_NODE&&validation.isEmpty)
-validation.logError(this,node,"The parent element should be empty, but it contains child elements.");if(validation.getCurrentElement()){node=validation.getCurrentElement();if(mozile.dom.getNextSiblingElement(node))node=mozile.dom.getNextSiblingElement(node);}}
-return validation;}
-mozile.rng.validateMany=function(node,validation){if(!node)throw Error("mozile.rng.validateMany() requires a node.");if(!validation)throw Error("mozile.rng.validateMany() requires an mozile.rng.Validation object.");var result;validation.count=0;while(true){result=validation.branch();result=this._validateSequence(node,result);if(result.isValid){validation.count++;validation.merge(result);if(result.getCurrentElement()&&mozile.dom.getNextSiblingElement(result.getCurrentElement())){node=mozile.dom.getNextSiblingElement(result.getCurrentElement());continue;}}
-if(mozile.rng.debug)validation.append(result,true);break;}
-return validation;}
-mozile.rng.validateInterleave=function(node,validation){if(!node)throw Error("mozile.rng.validateInterleave() requires a node.");if(!validation)throw Error("mozile.rng.validateInterleave() requires an mozile.rng.Validation object.");validation.logMessage(this,node,"Validating interleave...");var RNGChildren=new Array();for(var c=0;c<this.getChildNodes().length;c++){RNGChildren.push(this.getChildNodes()[c]);}
-var type;var length=RNGChildren.length;for(var i=0;i<length;i++){for(var r=0;r<RNGChildren.length;r++){var result=validation.branch();result=RNGChildren[r].validate(node,result);if(result.isValid){type=RNGChildren[r].getType();if((RNGChildren[r].getType()=="optional"||RNGChildren[r].getType()=="zeroOrMore")&&!result.count)
-continue;validation.merge(result);if(result.getCurrentElement()&&mozile.dom.getNextSiblingElement(result.getCurrentElement())){node=mozile.dom.getNextSiblingElement(result.getCurrentElement());}
-RNGChildren.splice(r,1);break;}}}
-if(RNGChildren.length>0){for(r=0;r<RNGChildren.length;r++){if(!validation.isValid)break;type=RNGChildren[r].getType();if(type!="optional"&&type!="zeroOrMore")
-validation.logError(this,node,"There were non-optional RNG children which did not match any elements.");}}
-if(validation.isValid)validation.logMessage(this,node,"Interleave is valid.");return validation;}
-mozile.rng.combine=function(target){var combineType;var combineA=this._element.getAttribute("combine");var combineB=target._element.getAttribute("combine");if(combineA&&combineB){if(combineA==combineB)combineType=combineA;else throw Error("In order to combine RNG elements, their 'combine' attributes muct match. '"+combineA+"' != '"+combineB+"'");}
-else{if(combineA)combineType=combineA;else if(combineB)combineType=combineB;else throw Error("In order to combine RNG elements, at least one must have a 'combine' attribute.");}
-if(combineType!="choice"&&combineType!="interleave")
-throw Error("RNG 'define' or 'start' elements can only have 'combine' attribute values of 'choice' or 'interleave', not '"+combineType+"'.");this._element.setAttribute("combine",combineType);var combineObject;if(this.getChildNodes().length==1&&this.getChildNode(0).getType()==combineType){combineObject=this.getChildNode(0);}
-else{var validation=new mozile.rng.Validation();combineObject=this.getSchema().parseElement(mozile.dom.createElementNS(mozile.xml.ns.rng,combineType),validation,true);this.appendChild(combineObject);while(this.getChildNodes().length>1){combineObject.appendChild(this.removeChild(this.getChildNode(0)));}}
-var targetObject=target;if(target.getChildNodes().length==1&&target.getChildNode(0).getType()==combineType){targetObject=target.getChildNode(0);}
-while(targetObject.getChildNodes().length){combineObject.appendChild(targetObject.removeChild(targetObject.getChildNode(0)));}
-return this;}
-mozile.rng.Schema=function(target){this._documents=new Object();this._types=new Object();this._names=new Object();this._root=null;if(target)this.parse(target);}
-mozile.rng.Schema.prototype.constructor=mozile.rng.Schema;mozile.rng.Schema.prototype.toString=function(){return"[object mozile.rng.Schema]"};mozile.rng.Schema.prototype.getType=function(){return"schema";}
-mozile.rng.Schema.prototype.parse=function(target){var element;var filepath;if(typeof(target)=="string"){if(target.indexOf("<")>-1){element=mozile.xml.parse(target).documentElement;filepath=location.toString();}
-else{var doc=this.load(target);if(!doc)throw Error("Could not load schema '"+target+"'.");element=doc.documentElement;filepath=target;}}
-else if(target.nodeType){element=target;filepath=location.toString();}
-else throw Error("Unknown target given in mozile.rng.Schema.parse().");if(!this.filepath)this.filepath=filepath;var validation=new mozile.rng.Validation();validation.logMessage(this,null,"Starting to parse schema");var result=this.parseElement(element,validation);if(!result){validation.logError(this,null,"An invalid result was returned from the parsing operation: "+result);return validation;}
-var root=result;if(root.getType()=="element"||root.getType()=="grammar"){this._root=root;}
-else{validation.logError(this,null,"Schema has no root element.");return validation;}
-var includes=this.getNodes("include");if(!includes)return validation;for(var i=0;i<includes.length;i++){validation=includes[i].include(validation);}
-return validation;}
-mozile.rng.Schema.prototype.parseElement=function(element,validation,omitValidation){var rngNode=this._createRNGNode(element,validation);if(!rngNode){return null;}
-else validation.logMessage(rngNode,element,"Adding RNG '"+rngNode.getType()+"' node.");if(omitValidation!=true){validation=rngNode.selfValidate(validation);if(!validation.isValid)return{node:null,validation:validation};}
-if(element.hasChildNodes()){var child;for(var c=0;c<element.childNodes.length;c++){child=this.parseElement(element.childNodes[c],validation);if(child)rngNode.appendChild(child);}}
-return rngNode;}
-mozile.rng.Schema.prototype._createRNGNode=function(element,validation){if(!element.nodeType||element.nodeType!=mozile.dom.ELEMENT_NODE)return null;if(element.namespaceURI!=mozile.xml.ns.rng)return null;var result;var type=mozile.dom.getLocalName(element);switch(type){case"grammar":result=new mozile.rng.Grammar(element,this);break;case"start":result=new mozile.rng.Start(element,this);break;case"element":result=new mozile.rng.Element(element,this);break;case"attribute":result=new mozile.rng.Attribute(element,this);break;case"empty":result=new mozile.rng.Empty(element,this);break;case"text":result=new mozile.rng.Text(element,this);break;case"group":result=new mozile.rng.Group(element,this);break;case"optional":result=new mozile.rng.Optional(element,this);break;case"oneOrMore":result=new mozile.rng.OneOrMore(element,this);break;case"zeroOrMore":result=new mozile.rng.ZeroOrMore(element,this);break;case"choice":result=new mozile.rng.Choice(element,this);break;case"define":result=new mozi
 le.rng.Define(element,this);break;case"ref":result=new mozile.rng.Ref(element,this);break;case"include":result=new mozile.rng.Include(element,this);break;case"data":result=new mozile.rng.Data(element,this);break;case"param":result=new mozile.rng.Param(element,this);break;case"value":result=new mozile.rng.Value(element,this);break;case"interleave":result=new mozile.rng.Interleave(element,this);break;case"div":result=new mozile.rng.Div(element,this);break;default:validation.logError(this,null,"Method mozile.rng.Schema._createRNGNode() found an unknown element '"+element.nodeName+"' with the RNG namespace.");return null;}
-if(result){this._indexNode(result);return result;}
-else return null;}
-mozile.rng.Schema.prototype._indexNode=function(node){var type=node.getType();if(!this._types[type])this._types[type]=new Array();this._types[type].push(node);if(node.getName){var name=node.getName();if(!this._names[type])this._names[type]=new Object();if(!this._names[type][name])this._names[type][name]=new Array();this._names[type][name].push(node);}}
-mozile.rng.Schema.prototype.getNodes=function(type,name){if(name){if(this._names[type]&&this._names[type][name])
-return this._names[type][name];else return new Array();}
-else{if(this._types[type])return this._types[type];else return new Array();}}
-mozile.rng.Schema.prototype.load=function(filepath,forceLoad){if(!forceLoad&&this._documents[filepath])return this._documents[filepath];var uri=mozile.getPath(filepath);uri=mozile.getAbsolutePath(uri,mozile.root);var xmlDoc=mozile.xml.load(uri);if(xmlDoc)this._documents[filepath]=xmlDoc;return xmlDoc;}
-mozile.rng.Schema.prototype.validate=function(element){if(!element)element=document.documentElement;if(!this._root)return false;var validation=new mozile.rng.Validation();this._root.resetAll();this._root.validate(element,validation);return validation;}
-mozile.rng.Validation=function(){this.isValid=true;this.isEmpty=false;this.allowText=false;this._currentElement=null;this._currentParent=null;this._lastValidElement=null;this._validAttributes=new Array();this._messages=new Array();}
-mozile.rng.Validation.prototype.toString=function(){return"[object mozile.rng.Validation]"};mozile.rng.Validation.prototype.getType=function(){return"validation";}
-mozile.rng.Validation.prototype.getCurrentElement=function(){return this._currentElement;}
-mozile.rng.Validation.prototype.setCurrentElement=function(element){if(element.nodeType==mozile.dom.ELEMENT_NODE){if(element==this._lastValidElement){this.logError(this,element,"An element has been marked as valid twice, which indicated an error");}
-else{this._lastValidElement=this._currentElement;this._currentElement=element;}}
-return element;}
-mozile.rng.Validation.prototype.getCurrentParent=function(){return this._currentParent;}
-mozile.rng.Validation.prototype.setCurrentParent=function(element){this._currentParent=element;return element;}
-mozile.rng.Validation.prototype.addAttribute=function(attr){this._validAttributes.push(attr);return attr;}
-mozile.rng.Validation.prototype.isAttributeValid=function(attr){for(var a=0;a<this._validAttributes.length;a++){if(mozile.browser.isMozilla&&mozile.browser.mozillaVersion<1.8){if(this._validAttributes[a].nodeName==attr.nodeName)return true;}
-if(this._validAttributes[a]==attr)return true;}
-return false;}
-mozile.rng.Validation.prototype.logMessage=function(rngNode,node,message,type){if(!type)type="Message";this._messages.push({"type":type,"rngNode":rngNode,"node":node,"message":message});}
-mozile.rng.Validation.prototype.logError=function(rngNode,node,message){this.logMessage(rngNode,node,message,"Error");this.isValid=false;}
-mozile.rng.Validation.prototype.getFirstError=function(){for(var m=0;m<this._messages.length;m++){if(this._messages[m].type!="Message")return this._messages[m];}
-return null;}
-mozile.rng.Validation.prototype.branch=function(){var validation=new mozile.rng.Validation();validation._currentParent=this._currentParent;return validation;}
-mozile.rng.Validation.prototype.append=function(validation,status){this._messages=this._messages.concat(validation._messages);if(status)this.isValid=status;else if(!validation.isValid)this.isValid=false;}
-mozile.rng.Validation.prototype.merge=function(validation){this.append(validation);this._validAttributes=this._validAttributes.concat(validation._validAttributes);if(validation.isEmpty)this.isEmpty=true;if(validation.allowText)this.allowText=true;if(validation._currentElement)this._currentElement=validation._currentElement;if(validation._lastValidElement)this._lastValidElement=validation._lastValidElement;}
-mozile.rng.Validation.prototype.report=function(errorsOnly){mozile.require("mozile.util");mozile.require("mozile.xpath");var messages=new Array();var maxType=8;var maxName=0;var maxLocation=0;var msg;var location;var rngName
-var lastNode;var lastLocation;for(var m=0;m<this._messages.length;m++){msg=this._messages[m];if(errorsOnly&&msg.type=="Message")continue;rngName="validation";if(msg.rngNode){if(msg.rngNode.getType())rngName=mozile.util.pad(msg.rngNode.getType(),11,true);if(msg.rngNode.getName)rngName=rngName+" "+msg.rngNode.getName();}
-location="";if(msg.node){if(msg.node==lastNode)location=lastLocation;else{location=mozile.xpath.getXPath(msg.node);location=location.replace(/xmlns:/g,"");lastNode=msg.node;lastLocation=location;if(location.length>maxLocation)maxLocation=location.length;}}
-if(rngName.length>maxName)maxName=rngName.length;messages.push([msg.type,rngName,location,msg.message]);}
-var output=new Array();var maxNum=Math.ceil(Math.log(messages.length+1)/Math.log(10))+1;for(m=0;m<messages.length;m++){msg=messages[m];output.push(mozile.util.pad((m+1)+".",maxNum)+" "+mozile.util.pad(msg[0],maxType)+" "+mozile.util.pad(msg[1],maxName)+"  "+mozile.util.pad(msg[2],maxLocation)+"  "+msg[3]);}
-return output.join(mozile.linesep);}
-mozile.rng.Node=function(element,schema){this._element=element;this._schema=schema;}
-mozile.rng.Node.prototype._cached=[this._mustHaveCache,this._mayHaveCache,this._descendantElementsCache,this._type];mozile.rng.Node.prototype.toString=function(){var type=this.getType();type=type.charAt(0).toUpperCase()+type.substring(1);var name="";if(this.getName)name=" '"+this.getName()+"'";return"[object mozile.rng."+type+name+"]";}
-mozile.rng.Node.prototype.getType=function(){if(!this._type)this._type=mozile.dom.getLocalName(this._element);return this._type;}
-mozile.rng.Node.prototype.getSchema=function(){return this._schema;}
-mozile.rng.Node.prototype.getGrammar=function(){var node=this;while(node){if(node.getType()=="grammar")return node;node=node.getParentNode();}
-return null;}
-mozile.rng.Node.prototype.getParentNode=function(){if(this._parentNode)return this._parentNode;return null;}
-mozile.rng.Node.prototype.getParentElement=function(){var parent=this.getParentNode();while(parent){if(parent.getType()=="element")return parent;parent=parent.getParentNode();}
-return null;}
-mozile.rng.Node.prototype.getNextSibling=function(){var parent=this.getParentNode();if(!parent)return null;var siblings=parent.getChildNodes();for(var r=0;r<siblings.length;r++){if(siblings[r]==this){if(siblings[r+1])return siblings[r+1];}}
-return null;}
-mozile.rng.Node.prototype.getChildNodes=function(){if(!this._childNodes)this._childNodes=new Array();return this._childNodes;}
-mozile.rng.Node.prototype.getChildNode=function(index){var children=this.getChildNodes();if(children&&children.length&&children.length>0&&index<children.length)
-return children[index];else return null;}
-mozile.rng.Node.prototype.appendChild=function(child){if(child){this.getChildNodes().push(child);child._parentNode=this;}
-return child;}
-mozile.rng.Node.prototype.removeChild=function(child){var children=new Array();for(var c=0;c<this.getChildNodes().length;c++){if(this.getChildNodes()[c]==child)continue;children.push(this.getChildNodes()[c]);}
-if(children.length==this.getChildNodes().length)
-throw Error("mozile.rng.Node.removeChild(): The given node is not child of this node.");else this._childNodes=children;child._parentNode=null;return child;}
-mozile.rng.Node.prototype.getDescendants=function(types,deep){if(deep!==false)deep=true;var descendants=new Array();if(!deep&&mozile.rng.checkType(types,this.getType())){descendants.push(this);}
-else{var result;for(var c=0;c<this.getChildNodes().length;c++){result=this.getChildNode(c).getDescendants(types,false);descendants=descendants.concat(result);}}
-return descendants;}
-mozile.rng.Node.prototype.mustContain=function(type){if(!this._mustHaveCache)this._mustHaveCache=new Object();if(this._mustHaveCache[type])return this._mustHaveCache[type];var result=false;for(var c=0;c<this.getChildNodes().length;c++){if(this.getChildNodes()[c].mustHave(type)){result=true;break;}}
-this._mustHaveCache[type]=result;return result;}
-mozile.rng.Node.prototype.mayContain=function(type){if(!this._mayHaveCache)this._mayHaveCache=new Object();if(this._mayHaveCache[type])return this._mayHaveCache[type];var result=false;for(var c=0;c<this.getChildNodes().length;c++){if(this.getChildNodes()[c].mayHave(type)){result=true;break;}}
-this._mayHaveCache[type]=result;return result;}
-mozile.rng.Node.prototype.mustHave=function(type){if(this.getType()==type)return true;else return this.mustContain(type);}
-mozile.rng.Node.prototype.mayHave=function(type){if(this.getType()==type)return true;else return this.mayContain(type);}
-mozile.rng.Node.prototype.reset=function(){for(var i=0;i<this._cached.length;i++){this._cached[i]=undefined;}}
-mozile.rng.Node.prototype.resetAll=function(){this.reset();for(var c=0;c<this.getChildNodes().length;c++){this.getChildNodes()[c].reset;}}
-mozile.rng.Node.prototype.selfValidate=function(validation){if(!mozile.dom.getFirstChildElement(this._element))
-validation.logError(this,this._element,"This RNG element must have at least one child element.");return validation;}
-mozile.rng.Node.prototype.selfValidateAll=function(validation){validation=this.selfValidate(validation);validation.logMessage(this,null,"Self validated.");for(var r=0;r<this.getChildNodes().length;r++){if(!validation.isValid)break;validation=this.getChildNodes()[r].selfValidateAll(validation);}
-return validation;}
-mozile.rng.Node.prototype.validate=function(node,validation){validation.logError(this,node,"The validate() method is not defined yet for "+this+".");return validation;}
-mozile.rng.Grammar=function(element,schema){this._element=element;this._schema=schema;this._start=null;this._definitions=new Object;}
-mozile.rng.Grammar.prototype=new mozile.rng.Node;mozile.rng.Grammar.prototype.constructor=mozile.rng.Grammar;mozile.rng.Grammar.prototype.getParentGrammar=function(){var parent=this.getParentNode();while(parent){if(parent.getType()=="grammar")return parent;parent=parent.getParentNode();}
-return null;}
-mozile.rng.Grammar.prototype.appendChild=function(child){if(child&&child.getType){switch(child.getType()){case"start":return this.setStart(child);break;case"define":return this.addDefinition(child);break;case"include":case"div":break;default:throw Error("RNG grammar element cannot have a child of type '"+child.getType()+"'.");break;}
-this.getChildNodes().push(child);child._parentNode=this;}
-return child;}
-mozile.rng.Grammar.prototype.getStart=function(){if(this._start)return this._start;else return null;}
-mozile.rng.Grammar.prototype.setStart=function(start){if(start.getType&&start.getType()=="start"){if(this._start)this._start.combine(start);else{this._start=start;this.getChildNodes().push(start);start._parentNode=this;}
-return start;}
-else return null;}
-mozile.rng.Grammar.prototype.getDefinition=function(name){if(this._definitions[name])return this._definitions[name];else return null;}
-mozile.rng.Grammar.prototype.addDefinition=function(definition){if(this._definitions[definition.getName()]){definition=this._definitions[definition.getName()].combine(definition);}
-else{this._definitions[definition.getName()]=definition;this.getChildNodes().push(definition);definition._parentNode=this;}
-return definition;}
-mozile.rng.Grammar.prototype.mustHave=function(type){if(this.getType()==type)return true;var result=false;var start=this.getStart();if(start)result=start.mustHave(type);else throw Error("mozile.rng.Grammar.mustHave() requires getStart() to return a mozile.rng.Start object.");return result;}
-mozile.rng.Grammar.prototype.mayHave=function(type){if(this.getType()==type)return true;var result=false;var start=this.getStart();if(start)result=start.mayHave(type);else throw Error("mozile.rng.Grammar.mayHave() requires getStart() to return a mozile.rng.Start object.");return result;}
-mozile.rng.Grammar.prototype.validate=function(node,validation){var start=this.getStart();if(start)validation=start.validate(node,validation);else validation.logError(this,node,"RNG grammar element must have a start element in order to validate a node, but it does not.");return validation;}
-mozile.rng.Start=

<TRUNCATED>

Mime
View raw message