﻿
        var popUpWin=0;

        function PopUpWindow(URLStr, left, top, width, height)
        {
          if(popUpWin)
          {
            if(!popUpWin.closed) popUpWin.close();
          }
          popUpWin = open(URLStr, 'popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
        } 
        
        /*************************************************************** 
            Ta bort funktionen av klick på höger musknapp. 
        ***************************************************************/
        function disableRightClick(e)
        {
          var message = "Höger musknapp ur funktion!";

          if(!document.rightClickDisabled) // initialize
          {
            if(document.layers) 
            {
              document.captureEvents(Event.MOUSEDOWN);
              document.onmousedown = disableRightClick;
            }
            else document.oncontextmenu = disableRightClick;
            return document.rightClickDisabled = true;
          }

          if(document.layers || (document.getElementById && !document.all))
          {
            if (e.which==2||e.which==3)
            {
              alert(message);
              return false;
            }
          }
          else
          {
            alert(message);
            return false;
          }
        }
        disableRightClick();  
                 
