home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / Chip_2004-11_cd1.bin / zkuste / jalbum / ukazka / res / js / save-protection.js < prev    next >
Text File  |  2004-01-02  |  579b  |  39 lines

  1. function clickIE() 
  2. {
  3.     if (document.all)
  4.     {
  5.         alert(saveProtectionMessage);
  6.         return false;
  7.     }
  8.     
  9.     return false;
  10. }
  11.  
  12. function clickNS(e)
  13. {
  14.     if( document.layers || (document.getElementById && !document.all) )
  15.     {
  16.         if (e.which==2 || e.which==3) 
  17.         {
  18.             alert(saveProtectionMessage);
  19.             return false;
  20.         }
  21.     }
  22.  
  23.     return false;
  24. }
  25.  
  26. function initSaveProtection()
  27. {
  28.     if (document.layers)
  29.     {
  30.         document.captureEvents(Event.MOUSEDOWN);
  31.         document.onmousedown = clickNS;
  32.     }
  33.     else
  34.     {
  35.         document.onmouseup = clickNS;
  36.         document.oncontextmenu = clickIE;
  37.     }
  38. }
  39.