home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2003 August / PCWELT_8_2003.ISO / pcwhtml / js / changecolor.js next >
Encoding:
Text File  |  2002-05-14  |  1.7 KB  |  65 lines

  1. <!--
  2.     var strLastID = "";
  3.     var strClickedID = "";
  4.     
  5.   function changeColor(cellID, switchOFF)
  6.   {
  7.         if (document.getElementById)
  8.         {
  9.             if (switchOFF==true) 
  10.             {
  11.                 if (cellID!=strLastID) 
  12.                 {
  13.                     document.getElementById(cellID).style.backgroundColor="#000066";
  14.                 }
  15.             } 
  16.             else 
  17.             {
  18.                 if (cellID!=strClickedID) 
  19.                 {
  20.                 document.getElementById(cellID).style.backgroundColor="#9797FB";
  21.                 }
  22.             }
  23.         }
  24.     }
  25.  
  26.     function doClick(id1, astrHeaderText, intFrameLayout, strDetailUrl, strSelectSearchUrl, strTocUrl) 
  27.     {
  28.         var tmpVal = strLastID;
  29.         strLastID = id1;
  30.         strClickedID = id1;
  31.         
  32.         if (tmpVal!="") changeColor(tmpVal, true);
  33.         changeColor(id1, false);
  34.         
  35.         if (document.getElementById)
  36.         {
  37.                 document.getElementById(id1).style.backgroundColor="#7786B3";
  38.         }
  39.  
  40.         switch(intFrameLayout)
  41.         {
  42.             case 1: // Standard-Frameset <--- fsActiveStandard.htm
  43.                 top.SetFrames(1, astrHeaderText, strDetailUrl, "", "")
  44.                 top.frames["pcw_main"].location.href = "../static/fsActiveStandard.htm";
  45.                 break;
  46.             case 2: // Advanced-Frameset mit Toc und Search <--- fsActiveTocIndex.htm
  47.                 top.SetFrames(2, astrHeaderText, strDetailUrl, strSelectSearchUrl, strTocUrl)
  48.                 top.frames["pcw_main"].location.href = "../static/fsActiveWithToc.htm";
  49.                 break;
  50.             case 3: // Standard-Frameset mit Scrolling = false <--- fsActiveStandardWS.htm
  51.                 top.SetFrames(1, astrHeaderText, strDetailUrl, "", "")
  52.                 top.frames["pcw_main"].location.href = "../static/fsActiveStandardWS.htm";
  53.         }
  54.     }
  55.  
  56.     function SelectDefaultItem()
  57.     {
  58.         doClick('c10', 'Willkommen', 3, "../detail/startpage.htm", "", "");
  59.     }
  60.  
  61.     function doInit()
  62.     {
  63.         SelectDefaultItem();
  64.     }
  65. //-->