function protectPage(contextMenu, selectText, printPage, whichContent) {
var ctrl = false;
var element = document.getElementById(whichContent);
     if (selectText == "false") {
          element.onselectstart = function() { return false;} // kills IE text highlighting and IE select all with ctrl + A
          element.ondragstart = function() { return false;}  // kills IE drag and drop of selected items (such as dropping highlighted text or image into Word)
          //commented out line below - prevents selecting text box for entering search values
          //element.onmousedown = function() { return false;} // kills Mozilla drag and drop of selected items (such as dropping highlighted text or image into Word)
     }   
     if (contextMenu == "false") {
         element.oncontextmenu = function() { return false;} // kills context menu for both IE and Mozilla
     }
     //force pages to print as blank to avoid simple print to pdf or printer and use OCR, make sure this is written into the HEAD section of the page 
     if (printPage == "false") {
          document.write('<style type="text/css">');
          document.write('@media print {');
          document.write('     body { display:none }');
          document.write('}');
          document.write('</style>');
     }

     //make sure select all key combination is suppressed for all browsers to prevent select all copies, ASCII val 65 = "A" and ASCII val 17 for ctrl
     function clearCtrl(e){
     var keyPressed;
          if (window.event) {
               keyPressed = window.event.keyCode;     //IE
          } else {
               keyPressed = e.which;     //Firefox
          }
          if(keyPressed == 17) {ctrl=false;}
     }
     function disableSelectAll(e){
     var keyPressed;
          if (window.event) {
               keyPressed = window.event.keyCode;     //IE
          } else {
               keyPressed = e.which;     //Firefox
          }
          if(keyPressed == 17) {ctrl=true;}
          if(keyPressed == 65 && ctrl == true) {return false;}
     }
     document.onkeyup = clearCtrl;
     document.onkeydown = disableSelectAll;
}
