-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
179 lines (176 loc) · 6.45 KB
/
home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html>
<head>
<title>UW/OLYMPEX</title>
<link href="home.css" type="text/css" rel="stylesheet">
<meta charset="utf-8" />
<link rel="icon" href="http://pmm.nasa.gov/sites/default/files/imce/olympex-logo-smaller.png" type="image/png">
</head>
<body>
<div id="top">
<div id="topContent">
<a href="http://pmm.nasa.gov/sites/default/files/imce/olympex-logo-smaller.png"><img src="http://pmm.nasa.gov/sites/default/files/imce/olympex-logo-smaller.png" alt="logo"></a>
<p>OLYMPEX: A NASA/GPM Ground Validation Field Campaign in the Pacific Northwest</p>
</div>
<ul>
<li class="tab">Home</li>
<li class="tab">Forecast</li>
<li class="tab">Standard Obs</li>
<li class="tab">Model Analyses</li>
<li class="tab">OLYMPEX Obs</li>
<li class="tab">Aircraft Flights</li>
<li class="tab">Science Summaries</li>
<li class="tab">Forecast Briefings</li>
<li class="tab">Archive Links</li>
</ul>
</div>
<div id="main"></div>
<div id="center">
<img class="bottom" src="nasa.png" alt="NASA">
<p class="bottom">For questions, contact <a href="mailto:[email protected]?subject=OLYMPEX">Lynn McMurdie</a></p>
<img class="bottom" src="http://olympex.atmos.washington.edu/gif/uw_logo.jpg" alt="UW" height="40">
</div>
</body>
<script type="text/javascript">
var starts = "page";
if (document.cookie ==""|document.cookie.indexOf(starts) == -1) {
bootHome();
} else{
boot();
}
var tabs = document.getElementsByClassName("tab");
var re = /\s/g;
for (var i = 0; i < tabs.length; i++) {
tabs[i].onclick = function() {
deleteCookie();
/*for (var i = 0; i < tabs.length; i++) {
tabs[i].style.backgroundColor = "#c2dbdb";
tabs[i].style.color = "blue";
}
this.style.backgroundColor = "white";
this.style.color = "#009fc6";*/
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("main").innerHTML = "";
document.getElementById("main").innerHTML = xmlhttp.responseText;
var links = document.links;
for (var i = 0; i < links.length; i++) {
if (links[i].href == window.location.href){
links[i].onclick = function() {
deleteCookie();
}
}
}
}
}
if(!document.getElementsByTagName("body")[0].innerText != undefined){
var page = this.textContent.replace(re, "_");
} else{
var page = this.innerText.replace(re, "_");
}
var d = new Date();
d.setTime(d.getTime() +100000);
var expires = "expires="+d.toUTCString();
document.cookie = "page=" + page + "; " + expires;
var cookies = document.cookie.split(";");
var tabName = findCookie();
var Window = window.open(window.location.href);
/*xmlhttp.open("GET", "Home.html", true);
xmlhttp.send();*/
}
}
function boot() {
var tabs = document.getElementsByClassName("tab");
var names = [];
var tabName = findCookie();
var re = /\s/g;
for (var i = 0; i < tabs.length; i++) {
names[i] = tabs[i].textContent.replace(re,"_");
}
tabIndex = names.indexOf(tabName);
for (var j = 0; j < tabs.length; j++) {
for (var i = 0; i < tabs.length; i++) {
tabs[i].style.backgroundColor = "#c2dbdb";
}
tabs[tabIndex].style.backgroundColor = "white";
tabs[tabIndex].style.color = "#009fc6";
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("main").innerHTML = "";
document.getElementById("main").innerHTML = xmlhttp.responseText;
}
}
var re = /\s/g;
sessionStorage.test = tabName;
console.log(sessionStorage.test);
xmlhttp.open("GET", tabName + ".html", true);
xmlhttp.send();
}
}
function bootHome() {
var tabs = document.getElementsByClassName("tab");
for (var j = 0; j < tabs.length; j++) {
for (var i = 0; i < tabs.length; i++) {
tabs[i].style.backgroundColor = "#c2dbdb";
}
tabs[0].style.backgroundColor = "white";
tabs[0].style.color = "#009fc6";
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("main").innerHTML = "";
document.getElementById("main").innerHTML = xmlhttp.responseText;
}
}
var re = /\s/g;
if(!document.getElementsByTagName("body")[0].innerText != undefined){
var page = tabs[0].textContent.replace(re, "_");
} else{
var page = tabs[0].innerText.replace(re, "_");
}
var d = new Date();
d.setTime(d.getTime() +100000);
var expires = "expires="+d.toUTCString();
document.cookie = "page=" + page + "; " + expires;
if (findCookie) {
var tabName = findCookie();
} else{
var tabName = "Home";
}
xmlhttp.open("GET", tabName + ".html", true);
xmlhttp.send();
}
}
function deleteCookie() {
var date = new Date();
document.cookie = "page=;expires="+ date;
}
function findCookie() {
var re = /\s/g;
var cookies = document.cookie.split(";");
var cookieNames = [];
for (var i = 0; i < cookies.length; i++) {
cookieNames[i]=cookies[i].replace(re,"");
if (cookieNames[i].match(/page=/)){
cookieIndex = i;
}
}
var tabName = cookieNames[cookieIndex].replace("page=","");
return tabName;
}
</script>
</html>