9 |
var changed_display_pos = 0; |
var changed_display_pos = 0; |
10 |
var id_cache = []; |
var id_cache = []; |
11 |
|
|
12 |
|
var debug_on = true; |
13 |
|
function debug(text) { |
14 |
|
if (debug_on) debug_on = confirm(text); |
15 |
|
} |
16 |
|
|
17 |
function element_id(id) { |
function element_id(id) { |
18 |
|
//debug("id: "+id); |
19 |
if (id_cache[id]) { |
if (id_cache[id]) { |
20 |
|
//debug("from cache "+id+" == "+id_cache[id]); |
21 |
return id_cache[id]; |
return id_cache[id]; |
22 |
} else { |
} else { |
23 |
var el = document.getElementById(id); |
var el = self.document.getElementById(id); |
24 |
|
//debug("getElementById("+id+") == "+el); |
25 |
if (el) { |
if (el) { |
26 |
id_cache[id] = el; |
id_cache[id] = el; |
27 |
return el; |
return el; |
28 |
} |
} |
29 |
|
//} else debug("can't find element "+id); |
30 |
} |
} |
31 |
|
return null; |
32 |
} |
} |
33 |
|
|
34 |
function toggle_display(name,dont_save) { |
function toggle_display(name,dont_save) { |
35 |
var el = element_id(name); |
var el = element_id(name); |
36 |
if (el) { |
if (el) { |
37 |
|
//debug("toggle "+name+" == "+el.id+" current: '"+el.style.display+"'"); |
38 |
|
|
39 |
if (el.style.display=='none') |
if (el.style.display=='none') |
40 |
el.style.display = ''; |
el.style.display = ''; |
41 |
else |
else |
48 |
} |
} |
49 |
|
|
50 |
function default_display() { |
function default_display() { |
51 |
if (changed_display_pos == 0) return; |
if (changed_display_pos == 0) return null; |
52 |
|
|
53 |
for (var i = 0; i < changed_display_pos; i++) { |
for (var i = 0; i < changed_display_pos; i++) { |
54 |
toggle_display( changed_display_ids[i], 1 ); |
toggle_display( changed_display_ids[i], 1 ); |
111 |
|
|
112 |
var el = element_id(name); |
var el = element_id(name); |
113 |
|
|
114 |
|
//debug("outline "+name); |
115 |
|
|
116 |
if (el) { |
if (el) { |
117 |
el.style.background = "#e0e0e0"; |
el.style.backgroundColor = "#ffff66"; |
118 |
el.style.border = "1px dashed #c0c0c0"; |
//el.style.border = "1px dashed #c0c0c0"; |
119 |
|
|
120 |
if (el.style.display=='none') toggle_display(el.id); |
if (el.style.display=='none') toggle_display(el.id); |
121 |
|
|
122 |
// recursivly show elements to root |
// recursivly show elements to root |
123 |
while (el.parentNode) { |
while (el.parentNode) { |
124 |
var el=el.parentNode; |
el=el.parentNode; |
125 |
if (el.style && el.style.display=='none') toggle_display(el.id); |
if (el.style && el.style.display=='none') toggle_display(el.id); |
126 |
} |
} |
127 |
} |
} |