home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1999 November / PCOnline_11_1999.iso / muenchen / hpan.js < prev    next >
Text File  |  1999-09-28  |  2KB  |  88 lines

  1. var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
  2.  
  3. if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && 
  4.  (navigator.userAgent.indexOf("Windows 95")>=0 || 
  5.   navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
  6.  document.write('<script language=VBScript\> \n');
  7.  document.write('Sub hpan_FSCommand(ByVal command, ByVal args)\n');
  8.  document.write('  call hpan_DoFSCommand(command, args)\n');
  9.  document.write('end sub\n');
  10.  document.write('</script\> \n');
  11. }
  12.  
  13. function hpan_DoFSCommand(command, args) {
  14. var panObj = InternetExplorer ? hpan : document.hpan;
  15. var mapObj = InternetExplorer ? parent.fmap.hmap : parent.fmap.document.hmap;
  16. var p = parent.frames[10].para;
  17. var z = p[3];
  18. var f = p[8];
  19. var agu = parseInt(args);
  20. var pos;
  21.  
  22. if ( command=="home" ) {
  23.   mapObj.Zoom(0);
  24.   p[1] = 0 ;
  25.   p[2] = 0 ;
  26.   p[3] = 0 ;
  27.   p[4] = 0;
  28.   p[5] = 0;
  29.   p[6] = 5700;
  30.   p[7] = 5700;
  31.  } 
  32. else if ( command=="zoom" ) {
  33.   mapObj.Zoom(agu);
  34.   p[3] = agu;
  35.  } 
  36. else if ( command=="panx" ) {
  37.  pos = f + (agu / 100);
  38.  
  39.  
  40.  if ( z == 0 && p[8]!=0 && pos<=p[14] && pos>0) {
  41.    p[0] = f + (agu / 100) ;
  42.    p[8] = p[0];
  43.    p[1] = 0;
  44.    p[2] = 0;
  45.    p[3] = 0;
  46.    p[4] = 0;
  47.    p[5] = 0;
  48.    p[6] = 5700;
  49.    p[7] = 5700;
  50.    mapObj.GotoFrame(p[15]); 
  51.    } else {
  52.    mapObj.Pan(agu, 0, 1);
  53.    }
  54.   } 
  55. else if (command=="pany" ) {
  56.  if ( z == 0 && p[8]!=0 ) {
  57.    pos = f+p[13];
  58.     if (agu == 100 && pos<=p[14] && pos>0) {
  59.      p[0] = f + p[13] ;
  60.      p[8] = p[0];
  61.      p[1] = 0;
  62.      p[2] = 0;
  63.      p[3] = 0;
  64.      p[4] = 0;
  65.      p[5] = 0;
  66.      p[6] = 5700;
  67.      p[7] = 5700;
  68.      mapObj.GotoFrame(p[15]); 
  69.      }
  70.     else if ((f - p[13])>0) {
  71.      p[0] = f - p[13] ;
  72.      p[8] = p[0];
  73.      p[1] = 0;
  74.      p[2] = 0;
  75.      p[3] = 0;
  76.      p[4] = 0;
  77.      p[5] = 0;
  78.      p[6] = 5700;
  79.      p[7] = 5700;
  80.      mapObj.GotoFrame(p[15]); 
  81.      }
  82.    } else {
  83.    mapObj.Pan(0, agu, 1);
  84.    } 
  85.   } 
  86. }
  87.  
  88.