about summary refs log tree commit diff
path: root/web/javascript/searchtip.js
diff options
context:
space:
mode:
authorroot2012-05-08 18:39:56 -0500
committerroot2012-05-08 18:39:56 -0500
commitea46f42ee640928b92947bfb204c41a482d80937 (patch)
tree9b27a4eb852d12539b543c3efee9d2a47ef470f3 /web/javascript/searchtip.js
parent056b5253fc3857b0444382aa39944f6344dc1ceb (diff)
downloadgenenetwork2-ea46f42ee640928b92947bfb204c41a482d80937.tar.gz
Add all the source codes into the github.
Diffstat (limited to 'web/javascript/searchtip.js')
-rwxr-xr-xweb/javascript/searchtip.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/web/javascript/searchtip.js b/web/javascript/searchtip.js
new file mode 100755
index 00000000..5665bc1d
--- /dev/null
+++ b/web/javascript/searchtip.js
@@ -0,0 +1,64 @@
+// search tips for 'Get Any' and 'Combined' in the main search page http://www.genenetwork.org/
+function searchtip(){
+
+	var tfor     = document.getElementById("tfor");
+	var tfand    = document.getElementById("tfand");
+	var btsearch = document.getElementById("btsearch");
+	var tiptextor  = "Enter list here (APOE, APOA, etc.): logical OR";
+	var tiptextand = "Enter terms to combine (blood pressure): logical AND";
+
+	if(tfor.value == "" || tfor.value == tiptextor) {
+		tfor.className = "searchtip";
+		tfor.value = tiptextor;
+	}
+	
+	tfor.onfocus = function(e) {
+		if(tfor.value == tiptextor) {
+			tfor.value = "";
+		}
+		tfor.className = "";
+	}
+	tfor.onblur = function(e) {
+		if(tfor.value == "") {
+			tfor.className = "searchtip";
+			tfor.value = tiptextor;
+		} else if(tfor.value == tiptextor){
+			tfor.className = "searchtip";
+		} else {
+			tfor.className = "";
+		}
+	}
+
+	if(tfand.value == "" || tfand.value == tiptextand) {
+		tfand.className = "searchtip";
+        tfand.value = tiptextand;
+	}
+    
+	tfand.onfocus = function(e) {
+		if(tfand.value == tiptextand) {
+			tfand.value = "";
+        }
+		tfand.className = "";
+    }
+	tfand.onblur = function(e) {
+		if(tfand.value == "") {
+			tfand.className = "searchtip";
+			tfand.value = tiptextand;
+		} else if(tfand.value == tiptextand) {
+			tfand.className = "searchtip";		
+		} else {
+			tfand.className = "";
+		}
+    }
+	
+	btsearch.onclick = function(e) {
+		if(tfor.value == tiptextor) {
+			tfor.value = "";
+		}
+		if(tfand.value == tiptextand) {
+			tfand.value = "";
+        }
+		return true;
+	}
+	
+}