pubrules
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Fri, 09 Dec 2011 13:24:47 +0000
changeset 1234 f93a4778325b
parent 1233 12f9be193445
child 1235 9d55bcf4a3d9
pubrules
model/releases/WD-prov-dm-20111215/Overview.html
model/releases/WD-prov-dm-20111215/toggles.js
--- a/model/releases/WD-prov-dm-20111215/Overview.html	Fri Dec 09 11:59:26 2011 +0000
+++ b/model/releases/WD-prov-dm-20111215/Overview.html	Fri Dec 09 13:24:47 2011 +0000
@@ -14,7 +14,7 @@
      </style>
 
      
-    <script src="http://www.w3.org/2007/OWL/toggles.js" type="text/javascript"></script>  
+    <script src="./toggles.js" type="text/javascript"></script>  
 
      
   <style type="text/css">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/model/releases/WD-prov-dm-20111215/toggles.js	Fri Dec 09 13:24:47 2011 +0000
@@ -0,0 +1,52 @@
+/*
+	Written by Jonathan Snook, http://www.snook.ca/jonathan
+	Add-ons by Robert Nyman, http://www.robertnyman.com
+	Author says "The credit comment is all it takes, no license. Go crazy with it!:-)"
+	From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
+*/
+
+function getElementsByClassName(oElm, strTagName, oClassNames){
+	var arrElements = (! (! (strTagName == "*") || ! (oElm.all)))? oElm.all : oElm.getElementsByTagName(strTagName);
+	var arrReturnElements = new Array();
+	var arrRegExpClassNames = new Array();
+	if(typeof oClassNames == "object"){
+		for(var i=0; !(i>=oClassNames.length); i++){ /*>*/
+			arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames[i].replace(/\-/g, "\-") + "(\s|$)"));
+		}
+	}
+	else{
+		arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames.replace(/\-/g, "\-") + "(\s|$)"));
+	}
+	var oElement;
+	var bMatchesAll;
+	for(var j=0; !(j>=arrElements.length); j++){ /*>*/
+		oElement = arrElements[j];
+		bMatchesAll = true;
+		for(var k=0; !(k>=arrRegExpClassNames.length); k++){ /*>*/
+			if(!arrRegExpClassNames[k].test(oElement.className)){
+				bMatchesAll = false;
+				break;
+			}
+		}
+		if(bMatchesAll){
+			arrReturnElements.push(oElement);
+		}
+	}
+	return (arrReturnElements)
+}
+
+function set_display_by_class(el, cls, newValue) {
+   var e = getElementsByClassName(document, el, cls);
+   if (e != null) {
+      for (var i=0; !(i>=e.length); i++) {
+        e[i].style.display = newValue;
+      }
+   }
+}
+
+function set_display_by_id(id, newValue) {
+   var e = document.getElementById(id);
+   if (e != null) {
+     e.style.display = newValue;
+   }
+}
\ No newline at end of file