home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd1.bin / chplus / holba / h_script.js < prev    next >
Text File  |  2003-09-22  |  10KB  |  280 lines

  1.     <!--
  2.         var version = "ver2";
  3.     
  4.         function typeOfBrowser() {
  5.            var browser;
  6.            var bName = navigator.appName;
  7.            var bVersion = parseInt(navigator.appVersion);
  8.            
  9.            if (bName == "Netscape" && bVersion == 2) browser = "Netscape2";
  10.            else if (bName == "Netscape" && bVersion == 3) browser = "Netscape3";
  11.            else if (bName == "Netscape" && bVersion >= 4) browser = "Netscape4";
  12.            else if (bName == "Microsoft Internet Explorer" && bVersion >= 3 && bVersion<4) browser = "IE3";
  13.            else if (bName == "Microsoft Internet Explorer" && bVersion >= 4) browser = "IE4";
  14.             if (bName == "Netscape" && bVersion >= 3) version = "verOK";
  15.                    else if (bName == "Microsoft Internet Explorer" && bVersion >= 4) version = "verOK";
  16.            //--else version = "ver2";    
  17.            
  18.            return browser;
  19.         }
  20.  
  21.         
  22.         function typeOfOS() {
  23.           var OS;
  24.         
  25.           if (navigator.userAgent.indexOf('IRIX') != -1) OS = "Irix";
  26.           else if (navigator.userAgent.indexOf('Mac') != -1) OS = "Macintosh";
  27.           else if (navigator.userAgent.indexOf('Win') != -1) {
  28.              if (navigator.userAgent.indexOf('95') != -1) OS = "Windows95";
  29.              else if (navigator.userAgent.indexOf('NT') != -1) OS = "WindowsNT";
  30.              else OS = "Windows3.1";
  31.           }
  32.           else {OS = "other";}
  33.         
  34.           return OS;
  35.         }
  36.         
  37.         
  38.         BrowName = typeOfBrowser();
  39.         OpSys = typeOfOS();    
  40.     
  41.  
  42.            function btn_on(butName) {
  43.                if (version == "verOK") {
  44.                btnOn = eval(butName + "on.src");
  45.                document[butName].src = btnOn;
  46.                }
  47.            }
  48.  
  49.            function btn_off(butName) {
  50.                if (version == "verOK") {
  51.                btnOf = eval(butName + "of.src");
  52.                document[butName].src = btnOf;
  53.                }
  54.            }
  55.     
  56.     
  57.  
  58.            var navigatorType = "Other";
  59.            if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4) navigatorType = "IE4+";
  60.            else if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4) ) navigatorType = "Netscape4+";
  61.  
  62.         function checkFlash() {
  63.                var flashInstalled;
  64.             flashInstalled = 0;
  65.             if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
  66.                 // Check for Flash 4+> in Netscape
  67.                 var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
  68.                 if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >=4 )
  69.                     flashInstalled = 1;
  70.             } else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
  71.                   navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  72.                 // Assume any Windows IE supports the OBJECT tag
  73.                 flashInstalled = 1;
  74.             }        
  75.             //--if (navigator.mimeTypes["application/x-shockwave-flash"]) flashInstalled = 1; 
  76.             
  77.                return flashInstalled;
  78.         }
  79.         
  80.  
  81.         function openWindow(urlName,urlTitle,winX,winY,winW,winH,winParams) {
  82.         
  83.           if (winX < 0) {
  84.                   winW = screen.width-160;
  85.                 winH = screen.height-60;
  86.                 winX = (screen.width - winW)/ 2;      
  87.                 winY = (screen.height - winH)/ 2;      
  88.             }
  89.           if (winParams == "") 
  90.                 winPar = "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent=no";      
  91.           else 
  92.                 winPar = winParams;      
  93.                   
  94.             winPar += ",width="+winW+",height="+winH+",left="+winX+",top="+winY;
  95.         
  96.             //pWin = window.open(urlName,'cdzWin',winPar)
  97.             
  98.             var sLn = "";    
  99.         
  100.             posDot = urlName.lastIndexOf(".");
  101.             sLn = urlName.substring(posDot+1,urlName.length);    
  102.             if ((sLn == "gif") || (sLn == "jpg")) {
  103.                 sLn =     "<html> \n" +
  104.                         "<head> \n" +
  105.                         "<meta http-equiv='Content-Type' content='text/html; charset=windows-1250'> \n" +
  106.                         "<title>" + urlTitle + "</title> \n" +
  107.                         "<LINK href='h_style.css' rel=StyleSheet title='holba_web_style' type=text/css> \n" +
  108.                         "</head> \n" +
  109.                         "<body topmargin='0' leftmargin='0' bgcolor='#40AA54'> \n" +
  110.                         
  111.                         "<table align='center' width='100%' cellspacing='0' cellpadding='0' border='0'> \n" +
  112.                         "    <tr> \n" +
  113.                         "       <td align='center' valign='middle'> \n" +
  114.                         "       <img src='"+urlName+"' border=0> \n" +
  115.                         "        </td> \n" +
  116.                         "    </tr> \n" +
  117.                         
  118.                         "    <tr> \n" +
  119.                         "       <td align='center' valign='middle'> \n" +
  120.                         "       <button type='submit' class='h_lo' accesskey='Z' onClick='window.close();'><u>Z</u>av°φt</button> \n" +
  121.                         "        </td> \n" +
  122.                         "    </tr> \n" +
  123.                         "</table> \n" +
  124.                         
  125.                         "</body> \n" +
  126.                         "</html>";
  127.                 pWin = window.open("","workWin",winPar);
  128.                 pWin.document.writeln(sLn);    
  129.             }
  130.             else {
  131.                 
  132.                 pWin = window.open(urlName,"workWin",winPar);
  133.             }            
  134.             
  135.         } 
  136.         
  137.         
  138.         function changeFocus() {
  139.             if (BrowName != "Netscape4") {
  140.                 document.links[document.links.length-1].focus();
  141.             }        
  142.             //--alert(parent.frames['s_logo'].document.links[parent.frames['s_logo'].document.links.length-1]);
  143.             //--parent.frames['s_logo'].document.links[parent.frames['s_logo'].document.links.length-1].focus();
  144.             
  145.         }        
  146.         
  147.         function changeUrl(pageTarget) {
  148.             var frameName = parent.frames['h_main'].location;
  149.             parent.frames['h_main'].location = frameName;
  150.             parent.frames['h_main'].location.hash = pageTarget;
  151.         }
  152.  
  153.  
  154.         function changeFrames(pageTop,pageMain,pageMenu,pageMisc) {
  155.             
  156.             if (pageTop != "") {
  157.                 parent.frames['h_info'].location = pageTop;            
  158.             }    
  159.             if (pageMain != "") {
  160.                 parent.frames['h_main'].location = pageMain;
  161.             }    
  162.             if (pageMenu != "") {
  163.                 parent.frames['h_menu'].location = pageMenu;
  164.             }    
  165.             if (pageMisc != "")    {
  166.                 parent.frames['h_misc'].location = pageMisc;
  167.             }    
  168.  
  169.             //-- var frameDoc = String(parent.frames['s_main'].location);
  170.             //-- posBackslash = frameDoc.lastIndexOf("/");
  171.             //-- frameDoc = frameDoc.substring(posBackslash + 1, frameDoc.length);
  172.             //-- if (frameDoc != "s_main.htm")
  173.             //--    parent.frames['s_main'].location = "s_main.htm";
  174.         }        
  175.  
  176.         
  177.         function infoNavigation() {
  178.          var tabDef = new Array("<table align='center' cellspacing='1' cellpadding='0' border='0'>",
  179.                                 "    <tr>",
  180.                                 "        <td colspan='3' align='center' valign='bottom'>",
  181.                                 "            <a href='#' onClick=changeFocus();changeUrl('top_doc')  ",
  182.                                 "             onMouseover=document.images['topd'].src='i_toph.gif'  ",
  183.                                 "             onMouseout=document.images['topd'].src='i_top.gif'>  ",
  184.                                 "                <img src='i_top.gif' name='topd' width='7' height='3' border='0' alt='ZaΦßtek strßnky'></a></td>  ",
  185.                                 "    </tr>  ",
  186.                                 "    <tr>  ",
  187.                                 "        <td align='right' valign='top'>  ",
  188.                                 "            <a href='#' onClick=changeFocus();history.back()  ",
  189.                                 "             onMouseover=document.images['back'].src='i_backh.gif'  ",
  190.                                 "             onMouseout=document.images['back'].src='i_back.gif'>  ",
  191.                                 "                <img src='i_back.gif' name='back' width='3' height='7' border='0' alt='Zp∞t'></a></td>  ",
  192.                                 "        <td align='center' valign='top'>  ",
  193.                                 "            <a href='s_info.htm' target='_self' onClick=changeFocus();changeFrames('s_top.htm','s_main.htm','s_menu.htm','s_info.htm')  ",
  194.                                 "             onMouseover=document.images['home'].src='i_homeh.gif'  ",
  195.                                 "             onMouseout=document.images['home'].src='i_home.gif'>  ",
  196.                                 "                <img src='i_home.gif' name='home' width='7' height='7' border='0' alt='Domovskß strßnka'></a></td>  ",
  197.                                 "        <td align='left' valign='top'>  ",
  198.                                 "            <a href='#' onClick=changeFocus();history.forward()  ",
  199.                                 "             onMouseover=document.images['fwd'].src='i_fwdh.gif'  ",
  200.                                 "             onMouseout=document.images['fwd'].src='i_fwd.gif'>  ",
  201.                                 "                <img src='i_fwd.gif' name='fwd' width='3' height='7' border='0' alt='Vp°ed'></a></td>  ",
  202.                                 "    </tr>  ",
  203.                                 "    <tr>  ",
  204.                                 "        <td colspan='3' align='center' valign='top'>  ",
  205.                                 "            <a href='#' onClick=changeFocus();changeUrl('bottom_doc')  ",
  206.                                 "             onMouseover=document.images['btmd'].src='i_btmh.gif'  ",
  207.                                 "             onMouseout=document.images['btmd'].src='i_btm.gif'>  ",
  208.                                 "                <img src='i_btm.gif' name='btmd' width='7' height='3' border='0' alt='Konec strßnky'></a></td>  ",
  209.                                 "    </tr>  ",
  210.                                 "</table>  ");
  211.     
  212.                  for (var n=0; n < tabDef.length; n++) {
  213.                       document.write(tabDef[n]);
  214.                  }
  215.     
  216.             }    
  217.  
  218.         
  219.         
  220.         window.onError = null;
  221.         
  222.         function initMouse() {
  223.             if (OpSys != "Macintosh") {
  224.                 if (BrowName == "IE4") {
  225.                     document.onmousemove = mouseMove;
  226.                 }
  227.                 if (BrowName == "Netscape4") {
  228.                     document.onmousemove = mouseMove;
  229.                     document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
  230.                 }
  231.             }
  232.         }
  233.         
  234.         function mouseMove(e) {
  235.         
  236.            if (OpSys != "Macintosh") {
  237.             if (BrowName == "Netscape4") {
  238.                 var x=e.pageX; 
  239.                 var y=e.pageY;
  240.                 document.layers['barL'].top = y;
  241.                 document.layers['barL'].left = x-1032;
  242.                 document.layers['barT'].top = y-776;
  243.                 document.layers['barT'].left = x;
  244.                 document.layers['barR'].top = y;
  245.                 document.layers['barR'].left = x+8;
  246.                 document.layers['barB'].top = y+8;
  247.                 document.layers['barB'].left = x;
  248.                 return false;
  249.             } 
  250.             else if (BrowName == "IE4") {
  251.                 var x=event.x;
  252.                 var y=event.y;
  253.                 barL.style.top = y;
  254.                 barL.style.left = x-1032;
  255.                 barT.style.top = y-776;
  256.                 barT.style.left = x;
  257.                 barR.style.top = y;
  258.                 barR.style.left = x+8;
  259.                 barB.style.top = y+8;
  260.                 barB.style.left = x;
  261.                 return false;
  262.             }
  263.             
  264.             }        
  265.  
  266.         }
  267.  
  268.         function writeCorners(rowColor,sizeCorner,vertAlign,pathImg) {
  269.         
  270.         var p = vertAlign.substring(0,1);
  271.         document.write(''+
  272.             '<tr align="center" bgcolor="'+rowColor+'">'+
  273.             '    <td align="left" valign="'+vertAlign+'"><img src="'+pathImg+'p_'+p+'l.gif" width="'+sizeCorner+'" height="'+sizeCorner+'" border="0"></td>'+
  274.             '    <td></td>'+
  275.             '    <td align="right" valign='+vertAlign+'><img src="'+pathImg+'p_'+p+'r.gif" width="'+sizeCorner+'" height="'+sizeCorner+'" border="0"></td>'+
  276.             ' </tr>');
  277.         }        
  278.         
  279.     //-->
  280.