-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.js
executable file
·50 lines (48 loc) · 1.85 KB
/
functions.js
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
function shownhide(id) {
if(document.getElementById){
if (document.getElementById(id).style.visibility == "visible"){
document.getElementById(id).style.visibility = "hidden";
document.getElementById(id).style.display = "none";
}else{
if (document.getElementById(id).style.visibility == "hidden"){
document.getElementById(id).style.visibility = "visible";
document.getElementById(id).style.display = "block";
}
}
}
}
function ajaxManager() {
var args = ajaxManager.arguments;
switch (args[0]) {
case "start_up":
/*ajaxManager('load_page','navigation.xml','menu'); */
/*
Args 0: load_page (der Fall, der bearbeitet werden soll)
Args 1: navigation.xml (die zu ladende Datei)
Args 2: contentLYR (das Ziel-Div)
*/
break;
case "load_page":
if (document.getElementById) { // Nur Browser die "document.getElementById" koennen duerfen weitermachen
// Browserweiche: IE braucht ActiveX, alle anderen koennen es direkt (if else Geschichte)
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}//if
// Jetzt muss es die Variable X geben, ob IE oder sonstwas:
// X ist irgendwie die XMLHTTP-Schnittstelle...
if (x) {
x.onreadystatechange = function() {
// Vigilant fuer Veraenderungen an X.
if(x.readyState == 4 && x.status == 200) { // 4 heisst "complete" (0 = uninitialized, 1 = loading, 2 = loaded, 3 = interactive)
el = document.getElementById(args[2]);
el.innerHTML = x.responseText; // "Place the data into an element and display it"
}//if
}//function
x.open("GET",args[1],true); // Get the data, which file?, loading asynchronously is true
x.send(null); // Es werden keine Daten transferiert, darum Null.
}//if
break;
case "hide_menu":
document.getElementById("eddies").style.visibility = "hidden";
break;
}//switch
}//function ajaxManager