home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBooks / data1.cab / Pages_Questions / Empsolutions.js < prev    next >
Encoding:
Text File  |  2004-05-21  |  5.0 KB  |  133 lines

  1. function showRotatingLink()
  2. {
  3.  //Test to determine if there is at least 1 rotating link on the page
  4.  var tbodyColl = document.all.tags('TBODY');   
  5.  //alert(tbodyColl.length);
  6.  var totalNumberOfRotatingLinksGroup1 = 0;
  7.    for (var i = 0; i < tbodyColl.length; i++)
  8.    {
  9.      if (typeof(tbodyColl[i].name) != "undefined")
  10.      {
  11.        if (tbodyColl[i].name == "rotatinglinks1")
  12.        {
  13.          totalNumberOfRotatingLinksGroup1 += 1;
  14.        }
  15.      }
  16.    }
  17.    
  18. if(totalNumberOfRotatingLinksGroup1 > 0)
  19. {
  20.   var NewDisplayedRotatingLink = "";
  21.    //1st time user loads Employee Navigator after rotating link functionality is added to QB
  22.    if(!getCookie("SolutionsRotatingLinkGroup1"))
  23.    {
  24.      //alert("initial cookie value being set to display SolutionsRotatingLinkGroup1")
  25.      setPermanentCookie('SolutionsRotatingLinkGroup1', '1');
  26.      document.getElementById("SolutionsRotatingLinkGroup11").style.display = 'inline';
  27.    }
  28.    else
  29.    {  //User has previously loaded Employee Navigator after rotating link functionality was added to QB
  30.      //alert("retrieving set cookie value to display SolutionsRotatingLinkGroup1");
  31.      var CurrentDisplayedRotatingLink = parseInt(getCookie("SolutionsRotatingLinkGroup1"));
  32.      //alert("CurrentDisplayedRotatingLink = " + CurrentDisplayedRotatingLink)
  33.         
  34.      var tbodyColl = document.all.tags('TBODY');   
  35.      //alert(tbodyColl.length);
  36.      totalNumberOfRotatingLinksGroup1 = 0;
  37.        for (var i = 0; i < tbodyColl.length; i++)
  38.        {
  39.          if (typeof(tbodyColl[i].name) != "undefined")
  40.          {
  41.            if (tbodyColl[i].name == "rotatinglinks1")
  42.            {
  43.              totalNumberOfRotatingLinksGroup1 += 1;
  44.            }
  45.          }
  46.        }
  47.       //alert("totalNumberOfRotatingLinksGroup1 = " + totalNumberOfRotatingLinksGroup1);
  48.      
  49.      if(CurrentDisplayedRotatingLink < totalNumberOfRotatingLinksGroup1)
  50.      {
  51.        NewDisplayedRotatingLink = (CurrentDisplayedRotatingLink + 1);
  52.        setPermanentCookie('SolutionsRotatingLinkGroup1', NewDisplayedRotatingLink);
  53.      }
  54.      else
  55.      {
  56.        NewDisplayedRotatingLink = 1;
  57.        setPermanentCookie('SolutionsRotatingLinkGroup1', '1');
  58.      }
  59.      
  60.      //alert("NewDisplayedRotatingLink = " + NewDisplayedRotatingLink)
  61.      eval("document.getElementById('" + "SolutionsRotatingLinkGroup1" + NewDisplayedRotatingLink + "').style.display = 'inline'");
  62.    }
  63.  } // End Test to determine if there is at least 1 rotating link on the page
  64. } // End Function
  65.  
  66.  
  67.  
  68.  
  69. function showRotatingLink2()
  70. {
  71.  //Test to determine if there is at least 1 rotating link on the page
  72.  var tbodyColl = document.all.tags('TBODY');   
  73.  //alert(tbodyColl.length);
  74.  var totalNumberOfRotatingLinksGroup2 = 0;
  75.    for (var i = 0; i < tbodyColl.length; i++)
  76.    {
  77.      if (typeof(tbodyColl[i].name) != "undefined")
  78.      {
  79.        if (tbodyColl[i].name == "rotatinglinks2")
  80.        {
  81.          totalNumberOfRotatingLinksGroup2 += 1;
  82.        }
  83.      }
  84.    }
  85.    
  86. if(totalNumberOfRotatingLinksGroup2 > 0)
  87. {
  88.   var NewDisplayedRotatingLink = "";
  89.    //1st time user loads Employee Navigator after rotating link functionality is added to QB
  90.    if(!getCookie("SolutionsRotatingLinkGroup2"))
  91.    {
  92.      //alert("initial cookie value being set to display SolutionsRotatingLinkGroup2")
  93.      setPermanentCookie('SolutionsRotatingLinkGroup2', '1');
  94.      document.getElementById("SolutionsRotatingLinkGroup21").style.display = 'inline';
  95.    }
  96.    else
  97.    {  //User has previously loaded Employee Navigator after rotating link functionality was added to QB
  98.      //alert("retrieving set cookie value to display SolutionsRotatingLinkGroup2");
  99.      var CurrentDisplayedRotatingLink = parseInt(getCookie("SolutionsRotatingLinkGroup2"));
  100.      //alert("CurrentDisplayedRotatingLink = " + CurrentDisplayedRotatingLink)
  101.         
  102.      var tbodyColl = document.all.tags('TBODY');   
  103.      //alert(tbodyColl.length);
  104.      totalNumberOfRotatingLinksGroup2 = 0;
  105.        for (var i = 0; i < tbodyColl.length; i++)
  106.        {
  107.          if (typeof(tbodyColl[i].name) != "undefined")
  108.          {
  109.            if (tbodyColl[i].name == "rotatinglinks2")
  110.            {
  111.              totalNumberOfRotatingLinksGroup2 += 1;
  112.            }
  113.          }
  114.        }
  115.       //alert("totalNumberOfRotatingLinksGroup2 = " + totalNumberOfRotatingLinksGroup2);
  116.      
  117.      if(CurrentDisplayedRotatingLink < totalNumberOfRotatingLinksGroup2)
  118.      {
  119.        NewDisplayedRotatingLink = (CurrentDisplayedRotatingLink + 1);
  120.        setPermanentCookie('SolutionsRotatingLinkGroup2', NewDisplayedRotatingLink);
  121.      }
  122.      else
  123.      {
  124.        NewDisplayedRotatingLink = 1;
  125.        setPermanentCookie('SolutionsRotatingLinkGroup2', '1');
  126.      }
  127.      
  128.      //alert("NewDisplayedRotatingLink = " + NewDisplayedRotatingLink)
  129.      eval("document.getElementById('" + "SolutionsRotatingLinkGroup2" + NewDisplayedRotatingLink + "').style.display = 'inline'");
  130.    }
  131.  } // End Test to determine if there is at least 1 rotating link on the page
  132. } // End Function
  133.