Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/csshover.htc
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/csshover.htc	(revision 2711)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/resources/csshover.htc	(revision 2712)
@@ -1,142 +1,120 @@
 <attach event="ondocumentready" handler="parseStylesheets" />
-<script language="JScript">
+<script>
 /**
- *    HOVER - V1.11.040203 - whatever:hover in IE
- *    ---------------------------------------------
- *    Peterned - http://www.xs4all.nl/~peterned/
- *    (c) 2004 - Peter Nederlof
+ *	Whatever:hover - V1.42.060206 - hover & active
+ *	------------------------------------------------------------
+ *	(c) 2005 - Peter Nederlof
+ *	Peterned - http://www.xs4all.nl/~peterned/
+ *	License  - http://creativecommons.org/licenses/LGPL/2.1/
  *
- *    Credits  - Arnoud Berendsen 
- *        for finding some really -sick- bugs
+ *	Whatever:hover is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation; either
+ *	version 2.1 of the License, or (at your option) any later version.
  *
- *    howto: body { behavior:url("csshover.htc"); }
- *    ---------------------------------------------
+ *	Whatever:hover is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *	Lesser General Public License for more details.
+ *
+ *	Credits and thanks to:
+ *	Arnoud Berendsen, Martin Reurings, Robert Hanson
+ *
+ *	howto: body { behavior:url("csshover.htc"); }
+ *	------------------------------------------------------------
  */
-var currentSheet, doc = window.document;
-var csshover_nodes = getElementsByClassName("csshover", doc);
-var csshover_rules = [], hoverStyleSheets = "", addRules = true;
-var IE5 = (doc.getElementsByTagName('*').length == 0) ? true : false, configlet = doc.getElementById('csshovering');
-var DEBUG = false, styles = "", parseCSSRulecounter = 0, timer, timerTable = "", d=true;
+
+var csshoverReg = /(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i,
+currentSheet, doc = window.document, hoverEvents = [], activators = {
+	onhover:{on:'onmouseover', off:'onmouseout'},
+	onactive:{on:'onmousedown', off:'onmouseup'}
+}
 
 function parseStylesheets() {
-    var sheets = doc.styleSheets, l = sheets.length;
-    for(var i=0; i<l; i++){
-        parseStylesheet(sheets[i]);
-    };
-    if (configlet) {configlet.innerText = hoverStyleSheets;};
-    if(DEBUG) {
-      alert(styles);
-      alert(timerTable);
-    };
-};
+	if(!/MSIE (5|6)/.test(navigator.userAgent)) return;
+	window.attachEvent('onunload', unhookHoverEvents);
+	var sheets = doc.styleSheets, l = sheets.length;
+	for(var i=0; i<l; i++) 
+		parseStylesheet(sheets[i]);
+}
+	function parseStylesheet(sheet) {
+		if(sheet.imports) {
+			try {
+				var imports = sheet.imports, l = imports.length;
+				for(var i=0; i<l; i++) parseStylesheet(sheet.imports[i]);
+			} catch(securityException){}
+		}
 
-function parseStylesheet(sheet) {
-    if(DEBUG) window.status += '|';
-//    if(sheet.href && sheet.href.indexOf('/ploneCustom.css') == -1) return;
-    var l, rules, imports;
-    if(sheet.imports) {
-        imports = sheet.imports, l = imports.length;
-        for(var i=0; i<l; i++)
-            parseStylesheet(sheet.imports[i]);
-    };
-    rules = (currentSheet = sheet).rules, l = rules.length;
-    for(var j=0; j<l; j++){parseCSSRule(rules[j]);};
-};
+		try {
+			var rules = (currentSheet = sheet).rules, l = rules.length;
+			for(var j=0; j<l; j++) parseCSSRule(rules[j]);
+		} catch(securityException){}
+	}
 
-function parseCSSRule(rule) {
-    if(DEBUG) {
-        if((parseCSSRulecounter++)%15 == 0) window.status += '.';
-        startTimer();
-    };
-    var select = rule.selectorText, style = rule.style.cssText;
-    if (addRules && (/\.cssHoverCSSExists/i).test(select)) {addRules = false;};
-    if(!(/\.csshover/i).test(select)) return;
-    if(style.replace(/ /, "") == "") return;
-    if(!(/(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):hover/i).test(select)) return;
+	function parseCSSRule(rule) {
+		var select = rule.selectorText, style = rule.style.cssText;
+		if(!csshoverReg.test(select) || !style) return;
 
-    var newSelect = select.replace(/(\.([a-z0-9_-]+):hover)|(:hover)/g, '.$2onHover');
-    if (addRules) {currentSheet.addRule(newSelect, style);};
-    if (configlet) {hoverStyleSheets += newSelect + ' \{\n  ' + style.replace('; ', '\;\n  ') + ';\n\}\n';};
+		var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1');
+		var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo);
+		var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1];
+		var affected = select.replace(/:(hover|active).*$/, '');
+		var elements = getElementsBySelect(affected);
+		if(elements.length == 0) return;
 
-    var hasClass = (/(\.([a-z0-9_-]+):hover)/g).exec(select);
-    var className = (hasClass? hasClass[2]:'') + 'onHover';
-    var affected = select.replace(/:hover.*$/g, '');
-    affected = affected.replace(/^.*([ ]|^)(([^ ]*)\.csshover)/i, '$2');
-    if (DEBUG) {timerTable += stopTimer() + '\n';};
-    if(!csshover_rules[className + ',' + affected]) {
-        if (DEBUG) {startTimer();};
-        var elements = getElementsBySelect(affected);
-        if(DEBUG) {
-            window.status += " "+elements.length;
-            styles += "" + elements.length + ": " + affected + '\n';
-        };
-        for(var i=0; i<elements.length; i++)
-            new HoverElement(elements[i], className);
-        csshover_rules[className + ',' + affected] = true;
-    };
-};
+		currentSheet.addRule(newSelect, style);
+		for(var i=0; i<elements.length; i++)
+			new HoverElement(elements[i], className, activators[pseudo]);
+	}
 
-function HoverElement(node, className) {
-    if(!node.hovers) node.hovers = {};
-    if(node.hovers[className]) return;
-    node.hovers[className] = true;
-    node.attachEvent('onmouseover',
-        function() { node.className += ' ' + className; });
-    node.attachEvent('onmouseout',
-        function() { node.className =
-            node.className.replace((new RegExp('\\s+'+className)),''); });
-};
+function HoverElement(node, className, events) {
+	if(!node.hovers) node.hovers = {};
+	if(node.hovers[className]) return;
+	node.hovers[className] = true;
+	hookHoverEvent(node, events.on, function() { node.className += ' ' + className; });
+	hookHoverEvent(node, events.off, function() { node.className = node.className.replace(new RegExp('\\s+'+className, 'g'),''); });
+}
+	function hookHoverEvent(node, type, handler) {
+		node.attachEvent(type, handler);
+		hoverEvents[hoverEvents.length] = { 
+			node:node, type:type, handler:handler 
+		};
+	}
+
+	function unhookHoverEvents() {
+		for(var e,i=0; i<hoverEvents.length; i++) {
+			e = hoverEvents[i]; 
+			e.node.detachEvent(e.type, e.handler);
+		}
+	}
 
 function getElementsBySelect(rule) {
-    var parts, nodes = csshover_nodes;
-    parts = rule.split(' ');
-    for(var i=0; i<parts.length; i++) {
-        nodes = getSelectedNodes(parts[i], nodes, i==0);
-    };
-    return nodes;
-};
-
-function getSelectedNodes(select, elements, includeRoot) {
-    var element, result, node, nodes = [];
-    var classname = (/\.([a-z0-9_-]+)/i).exec(select);
-    if(classname) {classname_re = new RegExp('\\b' + classname[1] + '\\b');};
-    var identify = (/\#([a-z0-9_-]+)/i).exec(select);
-    var tagName = (/^[a-z0-9]+/i).exec(select.toUpperCase()) || '*',
-        ell = elements.length;
-    for(var i=0; i<ell; i++) {
-        element = elements[i]
-        if(includeRoot)
-          if((tagName == '*') || (element.nodeName == tagName)) result = [element]
-          else result = []
-        else
-            if (tagName == '*' && IE5) result = elements[i].all
-            else result = elements[i].getElementsByTagName(tagName)
-        rel = result.length;
-        for(var j=0; j<rel; j++) {
-            node = result[j];
-            if((identify && node.id != identify[1]) || (classname && !(classname_re.exec(node.className))) || arrayHasElement(nodes, node)) continue;
-            nodes[nodes.length] = node;
-        };
-    };
-    return nodes;
-};
-
-function arrayHasElement(a, el) {
-    var l = a.length;
-    for(var i=0; i<l; i++) if(a[i] == el) return true;
-    return false;
-};
-
-function getElementsByClassName(className, parentElement) {
-    var result = new Array(),
-        list = (parentElement || doc.body).getElementsByTagName('*');
-    if(list.length == 0) list = (parentElement || doc.body).all;
-    var class_re = new RegExp('(^|\\s)' + className + '(\\s|$)');
-    for(var i = 0; i < list.length; i++) if(list[i].className.match(class_re)) result[result.length] = list[i];
-    return result;
-};
-
-function startTimer() {timer = new Date().getTime();};
-function stopTimer(message) {return (new Date().getTime()) - timer;};
-
+	var parts, nodes = [doc];
+	parts = rule.split(' ');
+	for(var i=0; i<parts.length; i++) {
+		nodes = getSelectedNodes(parts[i], nodes);
+	}	return nodes;
+}
+	function getSelectedNodes(select, elements) {
+		var result, node, nodes = [];
+		var identify = (/\#([a-z0-9_-]+)/i).exec(select);
+		if(identify) {
+			var element = doc.getElementById(identify[1]);
+			return element? [element]:nodes;
+		}
+		
+		var classname = (/\.([a-z0-9_-]+)/i).exec(select);
+		var tagName = select.replace(/(\.|\#|\:)[a-z0-9_-]+/i, '');
+		var classReg = classname? new RegExp('\\b' + classname[1] + '\\b'):false;
+		for(var i=0; i<elements.length; i++) {
+			result = tagName? elements[i].all.tags(tagName):elements[i].all; 
+			for(var j=0; j<result.length; j++) {
+				node = result[j];
+				if(classReg && !classReg.test(node.className)) continue;
+				nodes[nodes.length] = node;
+			}
+		}	
+		
+		return nodes;
+	}
 </script>
