From 23b26ddb5ef0abe7889a5073b55787f00c8bdaf1 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 14 Oct 2009 07:44:32 +0000
Subject: [PATCH] www/resources/script.js: Add show and hide functions.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1852 44740490-163a-0410-bde0-09ae8108e29a
---
 www/resources/script.js | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/www/resources/script.js b/www/resources/script.js
index 1d1fa03b4..3adf1b1f8 100644
--- a/www/resources/script.js
+++ b/www/resources/script.js
@@ -9,3 +9,33 @@ function SimpleSAML_focus(id) {
     element.focus();
   }
 }
+
+
+/**
+ * Show the given DOM element.
+ *
+ * @param id  The id of the element which should be shown.
+ */
+function SimpleSAML_show(id) {
+  element = document.getElementById(id);
+  if (element == null) {
+    return;
+  }
+
+  element.style.display = 'block';
+}
+
+
+/**
+ * Hide the given DOM element.
+ *
+ * @param id  The id of the element which should be hidden.
+ */
+function SimpleSAML_hide(id) {
+  element = document.getElementById(id);
+  if (element == null) {
+    return;
+  }
+
+  element.style.display = 'none';
+}
-- 
GitLab