function autoBlur(){
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
  document.body.focus(); 
} 
  document.onfocusin=autoBlur; 

function disableclick(e) {
  if(document.all) {
    if(event.button==2||event.button==3) {
      if(event.srcElement.tagName=="IMG") {
         window.status="Right-click disabled";
        return false;
      }
    }
  }
  else if(document.layers) {
         if(e.which == 3) {
            window.status="Right-click disabled";
            return false;
          }
       }
  else if(document.getElementById) {
          if(e.which==3&&e.target.tagName=="IMG") {
             window.status="Right-click disabled";
             return false;
          }
       }
}

function associateimages() {
  for(i=0;i<document.images.length;i++)
     document.images[i].onmousedown=disableclick;
}

if (document.all)
    document.onmousedown=disableclick
else if (document.getElementById)
         document.onmouseup=disableclick;
else if (document.layers)
         associateimages();

function click(){
//  for ie ---
     if (event.button == 2 || event.button == 3) {
      window.status="Right-click disabled";
      return false;
    }
} 
  document.onmousedown = click;
