home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 June / CHIPCD_6_2000.iso / software / trial / atlas / 00_system / script / frmset.js next >
Encoding:
JavaScript  |  2000-02-04  |  6.4 KB  |  181 lines

  1. //<BODY>
  2. //<script language=javascript>
  3. //    JScript ΩεΣ Σδ  ΣεΩ≤∞σφ≥α "index.htm"
  4. //    ─α≥α ±≥Γε≡σφφ :        20.10.98
  5. //    ╬±≥αφφ  ≡σΣαΩ÷│ :    
  6. //    ╧≡Φτφα≈σφφ : ≤∩≡αΓδ│φφ  ⌠≡σΘ∞ε∞ contents
  7. //    ├δεßαδⁿφ│ Ωεφ±≥αφ≥Φ (Σε±≥≤∩ Σε Γ±│⌡ τ∞│φφΦ⌡ ≥α Ωεφ±≥αφ≥ τ Σε≈│≡φ│⌡ ⌠≡σΘ∞│Γ ≈σ≡στ parent): 
  8. //        c_strParentFile - φατΓα ⌠αΘδα Σαφεπε ΣεΩ≤∞σφ≥α - ∞α║ ταπ≡≤µα≥Φ±ⁿ ∩σ≡°Φ∞
  9. //        c_intDefaultTimeOut - │φ≥σ≡Γαδ ε≈│Ω≤Γαφφ  Σδ  ±Φφ⌡≡εφ│τα÷│┐ 
  10. //        c_blnAskUser - ≈Φ τα∩Φ≥≤Γα≥Φ Ωε≡Φ±≥≤Γα≈α ∩≡Φ ΓΦ≈σ≡∩αφφ│ timeout
  11. //        c_strMapPageLocation - Γ│Σφε±φΦΘ ∙δ ⌡ Σε ±≥ε≡│φΩΦ τ εß'║Ω≥ε∞ mapxmap
  12. //        c_intDefaultTimeOut = 500;        // ±≥αφΣα≡≥φΦΘ ≥αΘ∞-α≤≥ Σδ  ±Φφ⌡≡εφ│τα÷│┐ ⌠≡σΘ∞│Γ    
  13. //    ├δεßαδⁿφ│ τ∞│φφ│ : 
  14. //        m_strMapPageLocation - ∩εΓφΦΘ °δ ⌡ Σε ±≥ε≡│φΩΦ τ εß'║Ω≥ε∞ mapxmap 
  15. //        m_PgDsc        - ε∩Φ± ∩ε≥ε≈φε┐ ±≥ε≡│φΩΦ ⌠≡σΘ∞≤ contents
  16. //        m_frmContents - ΓΩατ│ΓφΦΩ φα ⌠≡σΘ∞ contents
  17. //    ╦Φ≥ΓΦφσφΩε ╬. (10.10.98-20.10.98)
  18.  
  19. var c_strParentFile = "index.htm"; 
  20. var c_intDefaultTimeOut = 500;            
  21. var c_blnAskUser = true; 
  22. var c_maxMaps = 1000;    // Σ│α∩ατεφ Σδ  ID Γ ≥αßδΦ÷│ ε∩Φ±≤ Ωα≡≥
  23.  
  24. var m_strParentFileLocation = self.location.href; 
  25.     m_strParentFileLocation = m_strParentFileLocation.substring(m_strParentFileLocation.length-c_strParentFile.length,0)
  26. var m_strMapPageLocation = m_strParentFileLocation+c_strMapPageLocation; 
  27. var m_PgDsc = null;        
  28. var m_frmContents;
  29. var g_strPhotoFile = "";
  30.     
  31. // * * * * * * * * * * * * * * * Atlas_ReloadContents * * * * * * * * * * * * * * * * * * *
  32. //    ╧≡Φτφα≈σφφ : ╧σ≡σταπ≡≤µα║ ⌠≡σΘ∞ contents. ╟απ≡≤µα║ ∩ε≥≡│ßφ≤ ±≥ε≡│φΩ≤ ≥α 
  33. //                ΓΦßΦ≡α║ │φ⌠ε≡∞α÷│■ (Ωα≡≥≤, ≥αßδΦ÷■,...) Σδ  Γ│Σεß≡αµσφφ  
  34. //    └≡π≤∞σφ≥Φ:    a_ID - │Σσφ≥Φ⌠│Ωα≥ε≡ Ωα≡≥Φ, ≥αßδΦ÷│, ≥ε∙ε
  35. //    ╨στ≤δⁿ≥α≥:    ⌠≤φΩ÷│  φσ ΓΦτφα≈α║ ≡στ≤δⁿ≥α≥. ╘≤φΩ÷│┐ Atlas_ReloadContentsFrame 
  36. //                ≥α Atlas_RedrawContentsFrame ΓΦΩεφ≤■≥ⁿ±  α±Φφ⌡≡εφφε, ≥ε∞≤ ≡στ≤δⁿ≥α≥ ΓΦτφα≈α║≥ⁿ±  
  37. //                ∩│±δ  ταΓσ≡°σφφ  Σαφε┐ ⌠≤φΩ÷│┐
  38. //
  39. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  40. function Atlas_ReloadContents(a_ID, a_blnFirstTime) { 
  41.     if (a_blnFirstTime) {
  42.         if (!a_ID) 
  43.             return false;
  44.         m_PgDsc = null; // ∩ε≥ε≈φα ±≥ε≡│φΩα ±≥α║ φσαΩ≥≤αδⁿφε■
  45.         if (! Exec("script_RefreshPageDsc", a_ID)) // ∩│Σπε≥εΓΩα ε∩Φ±≤ ±≥ε≡│φΩΦ
  46.             return false;
  47.     }
  48.  
  49.     if (!IsRegistered("script_IsLoaded")) // script ∩εΓΦφσφ ß≤≥Φ ταπ≡≤µσφΦ∞
  50.         if (a_blnFirstTime) {
  51.             setTimeout("Atlas_ReloadContents(0,false)", c_intDefaultTimeOut);
  52.             return;
  53.         }
  54.         else 
  55.             if (c_blnAskUser && confirm ("═σ ΓΣα║≥ⁿ±  τα≡σ║±≥≡≤Γα≥Φ Ωα≡≥≤. ╤∩≡εß≤Γα≥Φ ∙σ ≡ατ?")){
  56.                 setTimeout("Atlas_ReloadContents(0,false)", c_intDefaultTimeOut);
  57.                 return;
  58.             }
  59.             else return false;
  60.  
  61.     if (!Atlas_ReloadContentsFrame())
  62.         return false;
  63.     else return;
  64. }
  65.  
  66.  
  67. // * * * * * * * * * * * * * * * Atlas_ReloadContentsFrame * * * * * * * * * * * * * * * * * * * *
  68. //    ╧≡Φτφα≈σφφ : ╧σ≡σταπ≡≤µα║ ±≥ε≡│φΩ≤ ⌠≡σΘ∞≤ contents. ─δ  ≥σΩ±≥≤ ταπ≡≤µα║ │φ⌠ε≡∞α÷│■, 
  69. //                ─δ  Ωα≡≥Φ ταπ≡≤µα║ δΦ°σ mapxmap, ±α∞≤ Ωα≡≥≤ ταπ≡≤µα║ Atlas_RedrawContentsFrame
  70. //    └≡π≤∞σφ≥Φ:    a_blnFirstTime - │Σσφ≥Φ⌠│Ωα≥ε≡ ∩σ≡°επε ΓΦΩδΦΩ≤ (Σδ  ±Φφ⌡≡εφ│τα÷│┐)
  71. //    ╨στ≤δⁿ≥α≥:    true - ∩≡Φ ≤±∩│°φε∞≤ ΓΦΩεφαφφ│, false - φσ ΓΦτφα≈σφΦΘ ≈Φ φσ ≤±∩│°φΦΘ ≡στ-≥. 
  72. //                
  73. //
  74. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  75. function Atlas_ReloadContentsFrame() { 
  76.     m_PgDsc = Exec("script_GetPageDsc"); // ε≥≡Φ∞≤≥Φ ε∩Φ± ∩ε≥ε≈φε┐ ±≥ε≡│φΩΦ (∩εΓΦφσφ ≤µσ ß≤≥Φ)
  77.     if (m_PgDsc.type!="map"){
  78.         m_frmContents.window.location.href = m_PgDsc.src;
  79.         return true;
  80.     }
  81.     if (m_PgDsc.type== "map") {
  82.         if ( !IsRegistered("Contents_IsLoaded")) 
  83.             m_frmContents.window.location.href = m_strMapPageLocation;
  84.         Atlas_RedrawContentsFrame(true);// φσ ∩σ≡σΓ│≡ ║∞ ΩεΣΦ ∩εΓσ≡φσφφ  - ÷  ⌠≤φΩ÷│  ±α∞α ΓΦτφα≈α║ ≡στ≤δⁿ≥α≥
  85.         return ;
  86.     }
  87.     return;
  88. }
  89.  
  90.  
  91. // * * * * * * * * * * * * * * * Atlas_RedrawContentsFrame * * * * * * * * * * * * * * * * * * * *
  92. //    ╧≡Φτφα≈σφφ : ╟απ≡≤µα║ ≥α Γ│Σ∞αδⁿεΓ≤║ Ωα≡≥≤ ≤ ⌠≡σΘ∞│ contents. ─δ  │φ°Φ⌡ ΓΦΣ│Γ │φ⌠ε≡∞α÷│┐ Σ│Θ 
  93. //                φσ ΓΦΩεφ≤║
  94. //    └≡π≤∞σφ≥Φ:    a_blnFirstTime - │Σσφ≥Φ⌠│Ωα≥ε≡ ∩σ≡°επε ΓΦΩδΦΩ≤ (Σδ  ±Φφ⌡≡εφ│τα÷│┐)
  95. //    ╨στ≤δⁿ≥α≥:    true - ∩≡Φ ≤±∩│°φε∞≤ ΓΦΩεφαφφ│, false - φσ ΓΦτφα≈σφΦΘ ≈Φ φσ ≤±∩│°φΦΘ ≡στ-≥. 
  96. //
  97. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  98. function Atlas_RedrawContentsFrame( a_blnFirstTime){
  99.     if (m_PgDsc==null)
  100.         return false;
  101.     if (!IsRegistered("Contents_IsLoaded")) // contents ∩εΓΦφσφ ß≤≥Φ ταπ≡≤µσφΦ∞, ≈σΩα║∞
  102.         if ( a_blnFirstTime) {
  103.             setTimeout("Atlas_RedrawContentsFrame(false)", c_intDefaultTimeOut);
  104.             return false;
  105.         }
  106.         else 
  107.             if (c_blnAskUser && confirm ("═σ ΓΣα║≥ⁿ±  ταπ≡≤τΦ≥Φ Ωα≡≥≤. ╤∩≡εß≤Γα≥Φ ∙σ ≡ατ?")){
  108.                 setTimeout("Atlas_RedrawContentsFrame(false)", 2*c_intDefaultTimeOut);
  109.                 return false;
  110.             }
  111.             else return false;
  112.         
  113.     if (m_PgDsc.type== "map") { 
  114.         mpxMap=Exec("Contents_GetMapX");
  115.         mpxMap.object.AutoRedraw = false;
  116.         Atlas_SetMapXParam(mpxMap, m_PgDsc);
  117.         mpxMap.object.Refresh();
  118.         mpxMap.object.AutoRedraw = true;
  119.         return true;
  120.     }
  121.     return false;
  122. }
  123.  
  124. // * * * * * * * * * * * * * * * Atlas_SetMapXParam * * * * * * * * * * * * * * * * * * * *
  125. //    ╧≡Φτφα≈σφφ : ┬±≥αφεΓδ■║ ∩α≡α∞σ≥≡Φ εß'║Ω≥α  ≤ ⌠≡σΘ∞│ contents.
  126. //    └≡π≤∞σφ≥Φ:    a_mpxMap - ∩ε±Φδαφφ  φα εß'║Ω≥ MapX,
  127. //                a_PgDsc - τφα≈σφφ  ∩α≡α∞σ≥≡│Γ Σδ  Γ±≥αφεΓδσφφ 
  128. //    ╨στ≤δⁿ≥α≥:    true - ∩≡Φ ≤±∩│°φε∞≤ ΓΦΩεφαφφ│, false - φσ ΓΦτφα≈σφΦΘ ≈Φ φσ ≤±∩│°φΦΘ ≡στ-≥. 
  129. //
  130. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  131. function Atlas_SetMapXParam(a_mpxMap, a_PgDsc){
  132.  
  133.     a_mpxMap.object.GeoSet = a_PgDsc.src;
  134.  
  135.     if (a_PgDsc.MapDataSet!=null && a_PgDsc.MapDataSet!="")
  136.         var l_lrCurrentLayer = mpxMap.Layers(a_PgDsc.MapDataSet);
  137.     else return false;
  138.  
  139.  
  140.     a_mpxMap.Datasets.Add(6,l_lrCurrentLayer,a_PgDsc.MapDataSet);
  141.     a_mpxMap.CurrentTool = 1007;
  142.         
  143.     return true;
  144. }
  145.  
  146. function Load() {
  147.     if (!IsRegistered("script_IsLoaded")) {
  148.         if (confirm ("Load:script_IsLoaded is not registered. Wait...")){
  149.             setTimeout("Load()", c_intDefaultTimeOut);
  150.             return;
  151.         }
  152.         else 
  153.             return;
  154.     }
  155.     Register (null, "Atlas_ReloadContentsFrame");
  156.     Register (null, "Atlas_ReloadContents");
  157.     m_frmContents = self.frames["contents"];
  158.         return;
  159. }
  160.  
  161.  
  162. function UnLoad() {
  163.     if (IsRegistered("script_IsLoaded")||IsRegistered("Contents_IsLoaded")) {
  164.         setTimeout("UnLoad()", c_intDefaultTimeOut);
  165.         return;
  166.     }
  167.     UnRegisterFrame(null);
  168. }
  169.  
  170. function errortrap(msg,url,line){
  171.     alert("╧ε∞ΦδΩα JScript: \n\t "+msg);
  172.     return true;
  173. }
  174.  
  175. window.onerror=errortrap;
  176. window.onload=Load;
  177. window.onunload=UnLoad;
  178. // end script 
  179. //</script>
  180. //</BODY></HTML>
  181.