|
1 var tocRoot, tocBranch, tocSel, tocLoading, tocLastID, tableSel, tabHead, data, tocTab, tocInitRoot, tocMemToc, rFStatus, oldData, tableSelTable; |
|
2 var initI; |
|
3 var icon=new Array(); |
|
4 var preloadIcons=new Array(1,10,101,102,103,104,106,107,108,11,113,116,118,16,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,19,20,21,24,25,26,28,29,31,34,4,5,52,53,56,57,6,60,68,69,7,8,82,9,99); |
|
5 |
|
6 var browser=browserCheck(); |
|
7 |
|
8 function browserCheck() { |
|
9 browser=navigator.userAgent.toLowerCase(); |
|
10 if (browser.indexOf('msie')!=-1) { |
|
11 if(browser.substring(browser.indexOf('msie')+5,browser.indexOf('.',browser.indexOf('msie')))>6) return("ie7"); |
|
12 if(browser.substring(browser.indexOf('msie')+5,browser.indexOf('.',browser.indexOf('msie')))>5) return("ie6"); |
|
13 else return("ie_old"); |
|
14 } |
|
15 else if (browser.indexOf('firefox')!=-1) return("ff"); |
|
16 else if (browser.indexOf('opera')!=-1) return("op"); |
|
17 else if (browser.indexOf('gecko')!=-1) return("ff"); |
|
18 } |
|
19 |
|
20 function changeCSS(theClass,element,value,target) { |
|
21 var cssRules; |
|
22 target = eval(target+'.document.styleSheets'); |
|
23 if (browser=='ie6'||browser=='ie7') { |
|
24 cssRules = 'rules'; |
|
25 } else if (browser=='ff'||browser=='op') { |
|
26 cssRules = 'cssRules'; |
|
27 } |
|
28 for (var S = 0; S < target.length; S++){ |
|
29 for (var R = 0; R < target[S][cssRules].length; R++) { |
|
30 if (target[S][cssRules][R].selectorText == theClass) { |
|
31 try { |
|
32 target[S][cssRules][R].style[element] = value; |
|
33 } catch(e) {} |
|
34 } |
|
35 } |
|
36 } |
|
37 } |
|
38 |
|
39 function initItem(item) { |
|
40 tableSel=null; |
|
41 if (cont.document.getElementById('TableGroup')!=null) { |
|
42 toggleItem(cont.document.getElementById('TableGroup').getElementsByTagName('li')[0].id.replace("Title","")); |
|
43 } |
|
44 } |
|
45 |
|
46 function initLoad(src,toc,home) { |
|
47 |
|
48 qs=document.location.search.substring(1); |
|
49 |
|
50 if (qs.substring(0,qs.indexOf('='))=='goto') { |
|
51 var gotoPage = qs.substring(qs.indexOf('=')+1).split(':'); |
|
52 var fExt = home.substring(home.lastIndexOf('.')); |
|
53 var home = "./EARoot/"; |
|
54 for (var i=0; i<gotoPage.length; i++) { |
|
55 home += "EA"+gotoPage[i]; |
|
56 if (i!=gotoPage.length-1) |
|
57 home += "/"; |
|
58 else |
|
59 home += fExt; |
|
60 } |
|
61 } |
|
62 |
|
63 src=src.document.location+""; |
|
64 |
|
65 src=src.substring(src.lastIndexOf('/')+1); |
|
66 if(src.indexOf('index')==-1&&src!="") return; |
|
67 |
|
68 var content = document.createElement('div'); |
|
69 content.className = "IndexBody"; |
|
70 content.innerHTML=" <iframe src='"+toc+"' name='toc' id='tocIFrame' frameborder='0'></iframe>\n"; |
|
71 content.innerHTML+=" <iframe src='"+home+"' name='cont' id='contentIFrame' frameborder='0'></iframe>"; |
|
72 content.innerHTML+=" <div id=\"resizeFrames\"></div>"; |
|
73 |
|
74 initPreLoad(content); |
|
75 |
|
76 } |
|
77 |
|
78 function initPage(src) { |
|
79 |
|
80 if (browser=="ie_old") return; |
|
81 |
|
82 if (toc.document==null) toc=top.frames[0]; |
|
83 if (cont.document==null) cont=top.frames[1]; |
|
84 if (cont.document==null) { |
|
85 setTimeout("initPage('"+src+"')","1000"); |
|
86 return; |
|
87 } |
|
88 |
|
89 var curPage = cont.document.location+""; |
|
90 if (curPage.indexOf('EARoot')!=-1) curPage = curPage.substring(curPage.indexOf('EARoot')); |
|
91 else curPage = curPage.substring(curPage.lastIndexOf('/')+1); |
|
92 |
|
93 for (var j=0; j<cont.document.getElementsByTagName('div').length; j++) { |
|
94 if (cont.document.getElementsByTagName('div')[j].className=="ObjectDetailsNotes") { |
|
95 var tmpStr = cont.document.getElementsByTagName('div')[j].innerHTML; |
|
96 //tmpStr=tmpStr.replace(/ <WBR>/g," "); //GAS 810 - removed as it adversely affect PreserveWS |
|
97 tmpStr=tmpStr.replace(/>/g,">"); |
|
98 tmpStr=tmpStr.replace(/</g,"<"); |
|
99 cont.document.getElementsByTagName('div')[j].innerHTML=tmpStr; |
|
100 } |
|
101 } |
|
102 |
|
103 if (src!=null) initItem(); |
|
104 |
|
105 if(curPage.substr(0,curPage.indexOf('.'))=="blank") |
|
106 return; |
|
107 |
|
108 //Check ToC is loaded |
|
109 if (toc.document.body==null) { |
|
110 setTimeout("initPage('"+src+"')","1"); |
|
111 return; |
|
112 } else if (toc.document.body.childNodes.length==1) { |
|
113 setTimeout("initPage('"+src+"')","1"); |
|
114 return; |
|
115 } else if (toc.document.body.lastChild.childNodes.length==0) { |
|
116 setTimeout("initPage('"+src+"')","1"); |
|
117 return; |
|
118 } else { |
|
119 var parTree = curPage.substr(0,curPage.lastIndexOf('/')).substr(curPage.indexOf('/')+1).replace(/EA/g,"").replace(/\//g,"."); |
|
120 |
|
121 if (parTree) { |
|
122 if (parTree.indexOf('0')!=0) parTree = "0."+parTree; |
|
123 parTree=parTree.split('.'); |
|
124 var tocTmp; |
|
125 |
|
126 for (var j=0; parTree.length>j; j++) { |
|
127 |
|
128 if (j>=2) tocTmp += "."+parTree[j]; |
|
129 else tocTmp = parTree[j]; |
|
130 |
|
131 if (toc.document.getElementById('toc'+tocTmp)==null) { |
|
132 setTimeout("initPage('"+src+"')","1"); |
|
133 return; |
|
134 } |
|
135 |
|
136 var tmpCurToc = toc.document.getElementById('toc'+tocTmp).parentNode.childNodes; |
|
137 |
|
138 toc.tocMemToc = parTree.length-j; |
|
139 |
|
140 if (tmpCurToc.length>3&&tmpCurToc[tmpCurToc.length-4].src.substring(tmpCurToc[tmpCurToc.length-4].src.lastIndexOf('images')).indexOf('plus')!=-1) { |
|
141 toc.tocClick(tmpCurToc[tmpCurToc.length-4]); |
|
142 } |
|
143 } |
|
144 } |
|
145 |
|
146 if (toc.document.getElementById(curPage)==null) { |
|
147 setTimeout("initPage('"+src+"')","1"); |
|
148 return; |
|
149 } |
|
150 |
|
151 if (toc.document.getElementById(curPage).parentNode.parentNode.parentNode.parentNode&&toc.document.getElementById(curPage).parentNode.parentNode.parentNode.parentNode.childNodes.length>3) { |
|
152 if (toc.document.getElementById(curPage).parentNode.parentNode.parentNode.parentNode.childNodes[toc.document.getElementById(curPage).parentNode.parentNode.parentNode.parentNode.childNodes.length-4].src.indexOf('plus')!=-1) { |
|
153 toc.tocClick(toc.document.getElementById(curPage).parentNode.parentNode.parentNode.parentNode.childNodes[toc.document.getElementById(curPage).parentNode.parentNode.parentNode.parentNode.childNodes.length-4]); |
|
154 } |
|
155 } |
|
156 |
|
157 if (toc.document.getElementById(curPage).parentNode.parentNode.childNodes[toc.document.getElementById(curPage).parentNode.parentNode.childNodes.length-4].src.indexOf('plus')!=-1) { |
|
158 toc.tocClick(toc.document.getElementById(curPage).parentNode.parentNode.childNodes[toc.document.getElementById(curPage).parentNode.parentNode.childNodes.length-4]); |
|
159 } |
|
160 |
|
161 if (tocSel) tocSel.parentNode.childNodes[tocSel.parentNode.childNodes.length-2].style.backgroundColor = ""; |
|
162 |
|
163 //Highlight selected ToC item and store in memory |
|
164 if (toc.document.getElementById(curPage)) { |
|
165 tocSel = toc.document.getElementById(curPage).parentNode; |
|
166 tocSel.parentNode.childNodes[tocSel.parentNode.childNodes.length-2].style.backgroundColor = "#B2B4BF"; |
|
167 if (tocSel.offsetTop<toc.document.body.scrollTop||tocSel.offsetTop>toc.document.body.offsetHeight+toc.document.body.scrollTop) { |
|
168 toc.scrollTo(0, tocSel.offsetTop-20); |
|
169 } |
|
170 } |
|
171 } |
|
172 } |
|
173 |
|
174 function initPreLoad(content) { |
|
175 |
|
176 var preload=document.getElementById('IndexHeader').parentNode.insertBefore(document.createElement('div'), document.getElementById('IndexHeader').nextSibling); |
|
177 preload.id="Preload"; |
|
178 preload.appendChild(document.createElement('p')); |
|
179 preload.firstChild.appendChild(document.createTextNode("Loading...")); |
|
180 |
|
181 if (browser=="ie_old") return; |
|
182 |
|
183 if (browser=="ie6"||browser=="ie7") |
|
184 changeCSS('#Preload','height',top.document.body.clientHeight-67+'px','this'); |
|
185 else |
|
186 changeCSS('#Preload','height',top.innerHeight-67+'px','this'); |
|
187 |
|
188 for (var i=0; i<preloadIcons.length; i++) { |
|
189 icon[preloadIcons[i]]=new Image(); |
|
190 icon[preloadIcons[i]].src="images/"+preloadIcons[i]+".png"; |
|
191 } |
|
192 |
|
193 var preloader = document.body.appendChild(document.createElement('div')); |
|
194 preloader.style.display="none"; |
|
195 preloader.id="preloader"; |
|
196 preloader.appendChild(content); |
|
197 |
|
198 resizeFrames('init'); |
|
199 |
|
200 } |
|
201 |
|
202 function initPreLoaded() { |
|
203 |
|
204 if (browser=="op") |
|
205 setCSS(); |
|
206 |
|
207 var preloader = document.getElementById('preloader'); |
|
208 |
|
209 document.getElementById('Preload').parentNode.replaceChild(preloader.firstChild, document.getElementById('Preload')); |
|
210 preloader.parentNode.removeChild(preloader); |
|
211 |
|
212 if (browser!="op") |
|
213 setTimeout('setCSS();','1000'); |
|
214 |
|
215 } |
|
216 |
|
217 function resizeFrames(str) { |
|
218 |
|
219 var resizeFrames = document.getElementById('resizeFrames'); |
|
220 |
|
221 if (str=="init") { |
|
222 resizeFrames.onmousedown = resizeFramesOn; |
|
223 resizeFrames.onmouseup = resizeFramesOff; |
|
224 resizeFrames.onmouseout = resizeFramesOff; |
|
225 resizeFrames.onmousemove = resizeFramesMove; |
|
226 } |
|
227 |
|
228 } |
|
229 |
|
230 function resizeFramesOn(e) { |
|
231 rFStatus=1; |
|
232 |
|
233 var resizeFrames = document.getElementById('resizeFrames'); |
|
234 tmpRF = resizeFrames.parentNode.appendChild(document.createElement('div')); |
|
235 |
|
236 tmpRF.style.left=(document.getElementById('tocIFrame').clientWidth+1)+"px"; |
|
237 tmpRF.id="tmpRF"; |
|
238 resizeFrames.style.width="100%" |
|
239 resizeFrames.style.left="0px"; |
|
240 } |
|
241 |
|
242 function resizeFramesOff(e) { |
|
243 rFStatus=0; |
|
244 |
|
245 var resizeFrames = document.getElementById('resizeFrames'); |
|
246 |
|
247 if (document.getElementById('tmpRF')!=null) |
|
248 document.getElementById('tmpRF').parentNode.removeChild(document.getElementById('tmpRF')); |
|
249 |
|
250 resizeFrames.style.width="5px"; |
|
251 resizeFrames.style.left=(document.getElementById('tocIFrame').clientWidth+1)+"px"; |
|
252 } |
|
253 |
|
254 function resizeFramesMove(e) { |
|
255 if (rFStatus!=0) { |
|
256 if (rFStatus==2) |
|
257 var posX = e+2; |
|
258 else if (browser=="ff") |
|
259 var posX = e.pageX; |
|
260 else |
|
261 var posX = event.x; |
|
262 |
|
263 if (posX<=150) |
|
264 posX=150; |
|
265 else if (posX>=top.document.body.clientWidth/2) |
|
266 posX=top.document.body.clientWidth/2; |
|
267 |
|
268 document.getElementById('contentIFrame').style.left=(posX+3)+"px"; |
|
269 document.getElementById('contentIFrame').style.width=(top.document.body.clientWidth-posX-4)+"px"; |
|
270 if (document.getElementById('tmpRF')!=null) |
|
271 document.getElementById('tmpRF').style.left=(posX-2)+"px"; |
|
272 if (browser=="ie6") |
|
273 document.getElementById('tocIFrame').style.width=(posX-4)+"px"; |
|
274 else |
|
275 document.getElementById('tocIFrame').style.width=(posX-3)+"px"; |
|
276 |
|
277 if(tableSelTable!=null) { |
|
278 if(tableSelTable.childNodes.length>1&&document.getElementById('tmpRF')!=null) { |
|
279 tableSelTable.style.width=(document.body.clientWidth-(document.getElementById('tmpRF').offsetLeft+6)-20)+"px"; |
|
280 tableSelTable.childNodes[0].style.width=(tableSelTable.offsetWidth-19)+"px"; |
|
281 tableSelTable.childNodes[1].style.width=(tableSelTable.offsetWidth-19)+"px"; |
|
282 } |
|
283 } |
|
284 } |
|
285 } |
|
286 |
|
287 function resizePage() { |
|
288 if(rFStatus==1) return; |
|
289 rFStatus=2; |
|
290 |
|
291 if(document.getElementById('resizeFrames')==null) |
|
292 return; |
|
293 |
|
294 if (browser=="ie6") { |
|
295 pHeight=top.document.body.clientHeight; |
|
296 } else { |
|
297 pHeight=top.document.documentElement.clientHeight; |
|
298 } |
|
299 |
|
300 resizeFramesMove(document.getElementById('resizeFrames').offsetLeft); |
|
301 document.getElementById('contentIFrame').style.height=pHeight-74+'px'; |
|
302 if (browser=="ie7") { |
|
303 document.getElementById('resizeFrames').style.height=pHeight-72+'px'; |
|
304 changeCSS('#tmpRF','height',pHeight-72+'px','this'); |
|
305 } else { |
|
306 document.getElementById('resizeFrames').style.height=pHeight-70+'px'; |
|
307 changeCSS('#tmpRF','height',pHeight-70+'px','this'); |
|
308 } |
|
309 document.getElementById('tocIFrame').style.height=pHeight-74+'px'; |
|
310 rFStatus=0; |
|
311 } |
|
312 |
|
313 function setCSS() { |
|
314 if (browser=="ie6") { |
|
315 pHeight=top.document.body.clientHeight; |
|
316 } else { |
|
317 pHeight=top.document.documentElement.clientHeight; |
|
318 } |
|
319 |
|
320 if (browser=="ie6"||browser=="ie7") { |
|
321 changeCSS('.IndexBody','width','','this'); |
|
322 changeCSS('.IndexBody','top','0px','this'); |
|
323 changeCSS('.IndexBody','position','relative','this'); |
|
324 changeCSS('#contentIFrame','height',pHeight-74+'px','this'); |
|
325 changeCSS('#contentIFrame','left','257px','this'); |
|
326 changeCSS('#resizeFrames','background','#000000','this'); |
|
327 changeCSS('#resizeFrames','filter','progid:DXImageTransform.Microsoft.Alpha(opacity=0)','this'); |
|
328 changeCSS('#resizeFrames','height',pHeight-72+'px','this'); |
|
329 changeCSS('#tmpRF','border','0px','this'); |
|
330 changeCSS('#tmpRF','height',pHeight-70+'px','this'); |
|
331 changeCSS('#tocIFrame','height',pHeight-74+'px','this'); |
|
332 } |
|
333 |
|
334 if (browser=="op"||browser=="ie6"||browser=="ie7") |
|
335 changeCSS('#contentIFrame','width',top.document.body.clientWidth-258+'px','this'); |
|
336 } |
|
337 |
|
338 |
|
339 function tocBuild(data) { |
|
340 |
|
341 var tocType = new Array(); |
|
342 var tocTypes = new Array(); |
|
343 var tocErrs = new Array(); |
|
344 |
|
345 for (var i=0; i<tocTab.length; i++) { |
|
346 if (!tocTab[i][8]) tocTab[i][8] = 'misc'; |
|
347 if (tocTab[i][8].toLowerCase().indexOf('diagram')!=-1 && (tocTab[i][6]=="" || tocTab[i][6]=="0")) tocTab[i][8] = "0Diagram"; |
|
348 if (tocTab[i][8].toLowerCase().indexOf('package')!=-1) tocTab[i][8] = "1Package"; |
|
349 if (!tocType[tocTab[i][8]]) { |
|
350 tocType[tocTab[i][8]] = new Array(); |
|
351 tocTypes[tocTypes.length]=tocTab[i][8]; |
|
352 } |
|
353 tocType[tocTab[i][8]][tocType[tocTab[i][8]].length] = i; |
|
354 } |
|
355 |
|
356 tocTypes.sort(); |
|
357 |
|
358 for (var i=0; i<tocTypes.length; i++) { |
|
359 for (var j=0; j<tocType[tocTypes[i]].length; j++) { |
|
360 var build = tocBuildItem(tocType[tocTypes[i]][j]); |
|
361 if (build!=true) { |
|
362 build = build.substring(1); |
|
363 tocErrs[tocErrs.length]=build; |
|
364 } |
|
365 } |
|
366 } |
|
367 |
|
368 var errRuns=0; |
|
369 var errTotal=tocErrs.length; |
|
370 |
|
371 while(tocErrs.length!=0) { |
|
372 if (errNums==tocErrs.length) { |
|
373 errRuns++; |
|
374 if (errRuns>errTotal) { |
|
375 break; |
|
376 } |
|
377 } |
|
378 var errNums=tocErrs.length; |
|
379 var tmp=tocBuildItem(tocErrs.shift()); |
|
380 if(tmp!=true) { |
|
381 tocErrs[tocErrs.length]=tmp.substring(1); |
|
382 } |
|
383 } |
|
384 |
|
385 while(tocErrs.length!=0) { |
|
386 tocTab[tocErrs[0]][6]="0"; |
|
387 tocBuildItem(tocErrs.shift()); |
|
388 } |
|
389 |
|
390 if (tocLastID!=0) { |
|
391 var tocLastSrc = document.getElementById("toc"+tocLastID).parentNode.childNodes[document.getElementById("toc"+tocLastID).parentNode.childNodes.length-4]; |
|
392 tocLastSrc.src = tocLastSrc.src.substring(tocLastSrc.src.lastIndexOf('images')).replace("01","02"); |
|
393 } |
|
394 } |
|
395 |
|
396 function tocBuildItem(i) { |
|
397 |
|
398 var childItem = false; |
|
399 |
|
400 if (tocTab[i][0].indexOf(':')!=-1) tocBranch = document.getElementById("toc"+tocTab[i][0].substring(0, tocTab[i][0].lastIndexOf(':'))); |
|
401 else if (tocTab[i][0].indexOf('.')!=-1) tocBranch = document.getElementById("toc"+tocTab[i][0].substring(0, tocTab[i][0].lastIndexOf('.'))); |
|
402 else if (tocTab[i][0]!="0") tocBranch = document.getElementById("toc0"); |
|
403 else if (tocTab[i][1]==3) tocBranch = document.getElementById("System").parentNode.lastChild; |
|
404 else tocBranch = tocRoot; |
|
405 |
|
406 //Check if item is child |
|
407 if (tocTab[i][5]&&tocTab[i][6]&&tocTab[i][6]!="0") { |
|
408 if (document.getElementById(tocTab[i][6])==null) return 'i'+i; |
|
409 tocBranch = document.getElementById(tocTab[i][6]).parentNode.lastChild; |
|
410 childItem = true; |
|
411 } |
|
412 |
|
413 tocBranch = tocBranch.appendChild(document.createElement('li')); |
|
414 |
|
415 if (tocTab[i][0]!=0||tocTab[i][1]==3) { |
|
416 tocImage = tocBranch.appendChild(document.createElement('img')); |
|
417 |
|
418 if (tocTab[i][0].indexOf('.')==-1&&(tocTab[i][0].indexOf(':')==-1||tocTab[i][0].indexOf('0')==0)) tocImage.src = "images/join01.gif"; |
|
419 else if (tocTab[i][0].indexOf('.')!=-1||tocTab[i][0].indexOf(':')!=-1) { |
|
420 var tocTmp=tocTab[i][0].replace(':','.'); |
|
421 for (var m=0; tocTmp.split('.').length>m+1; m++) { |
|
422 if (document.getElementById("toc"+tocTmp.substring(0,tocTmp.lastIndexOf('.'))).parentNode.childNodes[m].src.substring(document.getElementById("toc"+tocTmp.substring(0,tocTmp.lastIndexOf('.'))).parentNode.childNodes[m].src.lastIndexOf('images')).indexOf('02')!=-1||document.getElementById("toc"+tocTmp.substring(0,tocTmp.lastIndexOf('.'))).parentNode.childNodes[m].src.substring(document.getElementById("toc"+tocTmp.substring(0,tocTmp.lastIndexOf('.'))).parentNode.childNodes[m].src.lastIndexOf('images')).indexOf('04')!=-1) tocImage.src = "images/join04.gif"; |
|
423 else tocImage.src = "images/join03.gif"; |
|
424 tocImage = tocBranch.appendChild(document.createElement('img')); |
|
425 } |
|
426 tocImage.src = "images/join01.gif"; |
|
427 } |
|
428 tocImage.onclick = function() { tocClick(this); } |
|
429 |
|
430 if (tocTab[i][1]==3) { |
|
431 tocImage.src=tocImage.src.substring(tocImage.src.lastIndexOf('images')).replace("01","02"); |
|
432 if (tocImage.parentNode.parentNode.childNodes.length>1) { |
|
433 tocTmp = tocImage.parentNode.previousSibling.childNodes[tocImage.parentNode.previousSibling.childNodes.length-4]; |
|
434 tocTmp.src=tocTmp.src.substring(tocTmp.src.lastIndexOf('images')).replace("02","01"); |
|
435 } |
|
436 } |
|
437 |
|
438 //Check if item has children data |
|
439 if (tocTab[i][1]&&tocTab[i][1]!=3) { |
|
440 tocImage.id=tocTab[i][7]; |
|
441 tocImage.alt=tocTab[i][7]; |
|
442 } else if (childItem==true) { |
|
443 while (tocImage.parentNode.childNodes.length<document.getElementById(tocTab[i][6]).parentNode.childNodes.length-2) { |
|
444 tocImage.parentNode.insertBefore(document.createElement('img'), tocImage).src="images/join03.gif"; |
|
445 } |
|
446 tocImage.src=tocImage.src.substring(tocImage.src.lastIndexOf("images")).replace('01','02'); |
|
447 if (document.getElementById(tocTab[i][6]).parentNode.lastChild.childNodes.length>1) { |
|
448 tocTmpSrc=document.getElementById(tocTab[i][6]).parentNode.lastChild.lastChild.previousSibling.childNodes[document.getElementById(tocTab[i][6]).parentNode.lastChild.lastChild.previousSibling.childNodes.length-4]; |
|
449 tocTmpSrc.src=tocTmpSrc.src.substring(tocTmpSrc.src.lastIndexOf('images')).replace('02','01'); |
|
450 } |
|
451 tocImage = document.getElementById(tocTab[i][6]).parentNode.childNodes[document.getElementById(tocTab[i][6]).parentNode.childNodes.length-4]; |
|
452 tocImage.parentNode.lastChild.style.display = "none"; |
|
453 } |
|
454 |
|
455 if ((tocTab[i][1]&&tocTab[i][1]!=3)||childItem==true) { |
|
456 tocImage.id=tocImage.id.substr(1,tocImage.id.length-2); |
|
457 tocImage.src=tocImage.src.substring(tocImage.src.lastIndexOf('images')).replace('join','plus'); |
|
458 } |
|
459 } |
|
460 |
|
461 //Set Icon |
|
462 if (tocTab[i][3]) { |
|
463 tocImg = tocBranch.appendChild(document.createElement('a')); |
|
464 tocImg.href = tocTab[i][3]; |
|
465 tocImg.target = top.frames[1].name; |
|
466 } else tocImg = tocBranch; |
|
467 tocTab[i][4]=tocTab[i][4].substring(0,tocTab[i][4].indexOf('.')) |
|
468 |
|
469 tocImg = tocImg.appendChild(document.createElement('img')); |
|
470 if(top.icon[tocTab[i][4]]) |
|
471 tocImg.src = top.icon[tocTab[i][4]].src; |
|
472 else |
|
473 tocImg.src = "images/"+tocTab[i][4]+".png"; |
|
474 |
|
475 if (tocTab[i][3]) |
|
476 tocImg.id=tocTab[i][3]; |
|
477 |
|
478 //Set Text/Link |
|
479 if (tocTab[i][5]&&tocTab[i][8]!="0Diagram") tocBranch.lastChild.id=tocTab[i][5]; |
|
480 else tocBranch.lastChild.id="0"; |
|
481 tocBranch.lastChild.style.marginRight="4px"; |
|
482 if (tocTab[i][3]) { |
|
483 tocText = tocBranch.appendChild(document.createElement('a')); |
|
484 tocText.href = tocTab[i][3]; |
|
485 tocText.target = top.frames[1].name; |
|
486 if (tocTab[i][9]) |
|
487 tocText.id = tocTab[i][9]; |
|
488 else if (tocTab[i][7]) |
|
489 tocText.id = tocTab[i][7]; |
|
490 } |
|
491 else tocText = tocBranch; |
|
492 var j=0; |
|
493 |
|
494 //Replace values |
|
495 while (tocTab[i][2].indexOf('"')!=-1) tocTab[i][2] = tocTab[i][2].replace('"','\"'); |
|
496 while (tocTab[i][2].indexOf('<br />')!=-1) tocTab[i][2] = tocTab[i][2].replace('<br />','\n'); |
|
497 while (tocTab[i][2].indexOf(''')!=-1) tocTab[i][2] = tocTab[i][2].replace(''','\''); |
|
498 if (tocTab[i][2]=="") tocTab[i][2]=" "; |
|
499 |
|
500 tocText.appendChild(document.createTextNode(tocTab[i][2])); |
|
501 tocBranch.appendChild(document.createElement('ul')).id = "toc"+tocTab[i][0]; |
|
502 |
|
503 tocLastID = tocTab[i][0]; |
|
504 |
|
505 return true; |
|
506 |
|
507 } |
|
508 |
|
509 function tocClick(tocSrc) { |
|
510 |
|
511 if (tocSrc.src.substring(tocSrc.src.lastIndexOf('images')).indexOf('minus')!=-1) { |
|
512 |
|
513 tocSrc.parentNode.childNodes[tocSrc.parentNode.childNodes.length-1].style.display = "none"; |
|
514 tocSrc.src=tocSrc.src.substring(tocSrc.src.lastIndexOf('images')).replace('minus','plus'); |
|
515 |
|
516 } else if (tocSrc.src.substring(tocSrc.src.lastIndexOf('images')).indexOf('plus')!=-1) { |
|
517 |
|
518 tocSrc.parentNode.childNodes[tocSrc.parentNode.childNodes.length-1].style.display = "block"; |
|
519 tocSrc.src=tocSrc.src.substring(tocSrc.src.lastIndexOf('images')).replace('plus','minus'); |
|
520 |
|
521 //Check if children data built |
|
522 if (tocSrc.parentNode.childNodes[tocSrc.parentNode.childNodes.length-1].childNodes.length==0) { |
|
523 tocLoadData(tocSrc.id+".xml"); |
|
524 } |
|
525 |
|
526 } |
|
527 |
|
528 } |
|
529 |
|
530 function tocInit() { |
|
531 if (browser=="ie_old") { |
|
532 top.document.getElementById('Preload').childNodes[0].innerHTML="<strong>It appears you are using an outdated version of Internet Explorer, please download a later version from <a href=\"http://www.microsoft.com/windows/ie/default.mspx\">Microsoft</a></strong>"; |
|
533 return; |
|
534 } |
|
535 tocLoading = document.body.appendChild(document.createElement('div')); |
|
536 tocRoot = document.body.appendChild(document.createElement('ul')); |
|
537 tocRoot.id = "tocRoot"; |
|
538 tocInitRoot = 1; |
|
539 tocLoadData('root.xml'); |
|
540 } |
|
541 |
|
542 function tocLoadData(src) { |
|
543 |
|
544 var tmp=document.location+""; |
|
545 tmp=tmp.substring(0,tmp.indexOf('toc.')); |
|
546 |
|
547 src = tmp+"js/data/"+src; |
|
548 tocTab = new Array(); |
|
549 |
|
550 try { |
|
551 data = new XMLHttpRequest(); |
|
552 data.onreadystatechange = tocLoadDataProcess; |
|
553 data.open("GET", src, true); |
|
554 data.send(null); |
|
555 } catch(e) { |
|
556 if (browser=="ie6"||browser=="ie7") { |
|
557 data = new ActiveXObject("Microsoft.XMLHTTP"); |
|
558 if (data) { |
|
559 data.onreadystatechange = tocLoadDataProcess; |
|
560 data.open("GET", src, true); |
|
561 data.send(); |
|
562 } |
|
563 } else { |
|
564 alert(e); |
|
565 } |
|
566 } |
|
567 } |
|
568 |
|
569 function tocLoadDataProcess() { |
|
570 if (data.readyState == 4) { |
|
571 if (oldData==data) |
|
572 return; |
|
573 oldData=data; |
|
574 try { |
|
575 eval(data.responseText); |
|
576 tocBuild(); |
|
577 tocInitRoot++; |
|
578 if (tocInitRoot==2) { |
|
579 tocLoadData(tocTab[0][7].substring(1,tocTab[0][7].length-1)+".xml"); |
|
580 } else if (tocInitRoot==3&&top.document.getElementById('Preload')!=null) { |
|
581 tocInitRoot=0; |
|
582 top.initPreLoaded(); |
|
583 } |
|
584 } catch(e) { |
|
585 if(top.document.getElementById('Preload')!=null) |
|
586 top.document.getElementById('Preload').childNodes[0].innerHTML="<strong>An error occured while loading data files, please confirm that all files have been generated and are intact.</strong>"; |
|
587 return; |
|
588 } |
|
589 } |
|
590 } |
|
591 |
|
592 function toggleData(src) { |
|
593 var dataRoot = cont.document.getElementById(src).parentNode.parentNode.parentNode; |
|
594 if (cont.document.getElementById(src).src.substring(cont.document.getElementById(src).src.lastIndexOf('images')).indexOf('plus')!=-1) cont.document.getElementById(src).src=cont.document.getElementById(src).src.substring(0,cont.document.getElementById(src).src.lastIndexOf('images'))+cont.document.getElementById(src).src.substring(cont.document.getElementById(src).src.lastIndexOf('images')).replace('plus','minus'); |
|
595 else cont.document.getElementById(src).src=cont.document.getElementById(src).src.substring(0,cont.document.getElementById(src).src.lastIndexOf('images'))+cont.document.getElementById(src).src.substring(cont.document.getElementById(src).src.lastIndexOf('images')).replace('minus','plus'); |
|
596 for (var i=0; i<dataRoot.getElementsByTagName('tr').length; i++) { |
|
597 if (dataRoot.getElementsByTagName('tr')[i].id.indexOf(src)!=-1&&cont.document.getElementById(src).src.substring(cont.document.getElementById(src).src.lastIndexOf('images')).indexOf('minus')!=-1&&dataRoot.getElementsByTagName('tr')[i].getElementsByTagName('td')[1].firstChild!=null) dataRoot.getElementsByTagName('tr')[i].style.display=""; |
|
598 else if (dataRoot.getElementsByTagName('tr')[i].id.indexOf(src)!=-1) dataRoot.getElementsByTagName('tr')[i].style.display="none"; |
|
599 } |
|
600 if (cont.document.getElementById('TableGroup')!=null) { |
|
601 toggleItem(tableSel,2); |
|
602 } |
|
603 } |
|
604 |
|
605 function toggleItem(item,type) { |
|
606 |
|
607 if (tableSel!=null) { |
|
608 cont.document.getElementById(tableSel+"Title").style.background="#FFFFFF"; |
|
609 cont.document.getElementById(tableSel+"Title").style.color="#000000"; |
|
610 cont.document.getElementById(tableSel+"Table").style.display="none"; |
|
611 } |
|
612 tableSel=item; |
|
613 tableSelTable = cont.document.getElementById(item+"Table"); |
|
614 tableSelTitle = cont.document.getElementById(item+"Title"); |
|
615 |
|
616 tableSelTitle.style.background="#DDDDDD"; |
|
617 tableSelTitle.style.color="#666666"; |
|
618 tableSelTable.style.display="block"; |
|
619 |
|
620 if (browser=="ff"||browser=="op"||browser=="ie7") { |
|
621 var contWHeight = document.documentElement.clientHeight-78; |
|
622 var contWWidth = cont.document.documentElement.clientWidth; |
|
623 } else { |
|
624 var contWHeight = document.body.clientHeight-74; |
|
625 var contWWidth = document.body.clientWidth-(top.document.getElementById('resizeFrames').offsetLeft+6); |
|
626 } |
|
627 |
|
628 if (tableSelTable.id=="LinkedDocumentTable") |
|
629 tableSelTable.style.overflow="scroll"; |
|
630 |
|
631 if (cont.document.body.offsetHeight-contWHeight>0) { |
|
632 if (tableSelTable.id!="LinkedDocumentTable") |
|
633 tableSelTable.style.overflow="scroll"; |
|
634 if (browser=="ff"||browser=="op") { |
|
635 tableSelTable.style.height=tableSelTable.offsetHeight-(cont.document.body.offsetHeight-cont.innerHeight)-12+"px"; |
|
636 } else { |
|
637 |
|
638 tableSelTable.style.height=tableSelTable.offsetHeight-(cont.document.body.offsetHeight-contWHeight)-3+"px"; |
|
639 if (cont.document.body.offsetWidth>contWWidth||type==null) { |
|
640 tableSelTable.style.width=contWWidth-20+"px"; |
|
641 if(tableSelTable.getElementsByTagName('table').length!=0) |
|
642 tableSelTable.getElementsByTagName('table')[0].style.width=tableSelTable.getElementsByTagName('table')[0].offsetWidth-18+"px"; |
|
643 } |
|
644 } |
|
645 if(tableSelTable.getElementsByTagName('table').length!=0) { |
|
646 tabHead = tableSelTable.appendChild(tableSelTable.getElementsByTagName('table')[0].cloneNode(true)); |
|
647 tabHead.style.position="absolute"; |
|
648 if (browser=="ff"||browser=="op") |
|
649 tabHead.style.width=tableSelTable.offsetWidth+"px"; |
|
650 tabHead.style.top=tableSelTable.offsetTop+1+"px"; |
|
651 for (var i=0; i<tabHead.getElementsByTagName('tr').length; i++) { |
|
652 if (i!=0) tabHead.getElementsByTagName('tr')[i].style.display="none"; |
|
653 } |
|
654 } |
|
655 } else if (cont.document.getElementById('TableGroup').offsetHeight+cont.document.getElementById('TableGroup').offsetTop<(contWHeight-6)&&tableSelTable.style.overflow=="scroll") { |
|
656 if (browser=="ff"||browser=="op") { |
|
657 tableSelTable.style.height=tableSelTable.offsetHeight-(cont.document.body.offsetHeight-cont.innerHeight)-12+"px"; |
|
658 } else { |
|
659 tableSelTable.style.height=tableSelTable.offsetHeight+((contWHeight-8)-(cont.document.getElementById('TableGroup').offsetHeight+cont.document.getElementById('TableGroup').offsetTop))+"px"; |
|
660 } |
|
661 } |
|
662 if(tableSelTable.childNodes.length>1) { |
|
663 tableSelTable.style.width=(document.body.clientWidth-(top.document.getElementById('resizeFrames').offsetLeft+6)-20)+"px"; |
|
664 tableSelTable.childNodes[0].style.width=(tableSelTable.offsetWidth-19)+"px"; |
|
665 tableSelTable.childNodes[1].style.width=(tableSelTable.offsetWidth-19)+"px"; |
|
666 } |
|
667 } |
|
668 |
|
669 function guidLink(guid, qs) { |
|
670 if (toc.document.getElementById(guid)) |
|
671 cont.location = toc.document.getElementById(guid); |
|
672 } |