NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/Chameleon/trunk/Chameleon/js/maptips.js

Revision 13 (checked in by jcleary, 17 years ago)

Latest Chameleon code checkout from previous repository

Line 
1 /* ==================================================================== */
2 /*  MapTipClear(szLayer, szText)                                        */
3 /*  Clears the contents of the MapTip DIV (szText can be default text)  */
4 /* ==================================================================== */
5 function MapTipClear(szLayer, szText)
6 {
7     if(!szText)
8         var szText = ' ';
9        
10     MapTipContent( szLayer, szText );
11 }
12
13 /* ==================================================================== */
14 /*  MapTipContent( szLayer, szText )                                    */
15 /*  Writes the content to the MapTip DIV                                */
16 /* ==================================================================== */
17 function MapTipContent( szLayer, szText )
18 {
19     //window.status = szLayer;
20     if(!szLayer)
21     {
22         alert('no layer specified .. exiting');
23         return false;
24     }
25
26     // should work for all browsers
27     if (document.layers)
28     {
29         var oLayer;
30         if(parentID)
31         {
32             oLayer = eval('document.' + parentID + '.document.' + szLayer + '.document');
33         }
34         else
35         {
36             oLayer = document.layers[szLayer].document;
37         }
38
39         oLayer.open();
40         oLayer.write(szText);
41         oLayer.close();
42     }
43     else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape")
44     {
45         document.getElementById(szLayer).innerHTML = szText;
46     }
47     else if (document.all)
48     {
49         document.all[szLayer].innerHTML = szText;
50     }
51    
52     return true;
53
54 }
Note: See TracBrowser for help on using the browser.