home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / ChipCD_1.03.iso / servis / msiecu / 501sp3 / MS02-066_soubory / secBulletins.js < prev    next >
Text File  |  2002-11-28  |  2KB  |  71 lines

  1. function newitem(str)
  2. {
  3.  
  4.  
  5.    endDate = new Date(str);
  6.    if (Date.parse(Date()) < Date.parse(endDate))
  7.    {
  8.        document.write('New! ');
  9.    }
  10. }
  11.  
  12.  
  13. function tierMenu(objMenu,objImage)
  14. {
  15.    if (objMenu.style.display == "none")
  16.    {
  17.        objMenu.style.display = "";
  18.        objImage.src = "/technet/images/minus.gif";
  19.    }
  20.    else
  21.    {
  22.        objMenu.style.display = "none";
  23.        objImage.src = "/technet/images/plus.gif";
  24.    }
  25. }
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. ///
  29. /// <function>
  30. /// <name>fnPrint</name>
  31. /// <summary>
  32. /// Added 9/5/01 to accomodate Print Friendly fix.  Used to expand
  33. /// any collapsed content and then print the page.
  34. /// </summary>
  35. /// </function>
  36. ///
  37. /////////////////////////////////////////////////////////////////////////////
  38.  
  39. function fnPrint()
  40. {
  41.    if(oBD.majorVer >= 4)
  42.    {
  43.       try
  44.       {
  45.          if(oBD.browser == "MSIE")
  46.          {
  47.             for(i = 1;i < 4;i++)
  48.             {
  49.                var sSpanID = "menu" + i;
  50.                var sCheck = eval(sSpanID).style.display;
  51.  
  52.                if(sCheck == 'none')
  53.                {
  54.                   var sImageID = "img" + i;
  55.                   tierMenu(eval(sSpanID),eval(sImageID));
  56.                }
  57.             }
  58.          }
  59.          window.print();
  60.       }
  61.       catch(e)
  62.       {
  63.          alert('The attempt to print failed. Please use your browsers default print services.');
  64.       }
  65.    }
  66.    else
  67.    {
  68.       alert("You are using a browser that is not supported by the Print button on this page. You can print this page by right-clicking within the article and selecting Print from the menu that appears.");
  69.    }
  70.  
  71. } //end fnPrint