﻿function click(e)
{

  if (document.all)
  {
    if (event.button==2||event.button==3)
    {
      return false;
    }
  }
  else
  {
    if (e.button==2||e.button==4)
    {
      e.preventDefault();
      e.stopPropagation();
      alert(message);
      return false;
    }
  }
}

if (document.all) // for IE
{
  document.onmousedown=click;
}
else // for FF
{
  document.onclick=click;
}

function ehan( evnt )
{
  document.selection = "";
	if( evnt.which == 3 )
  {
    return false;
  }
  return true;
}

function ocmh()
{
  return false;
}

document.oncontextmenu = ocmh;

if( document.layers ) document.onmousedown = ehan;

if (window!=top){top.location.href=location.href;}

var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){

if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)

return false

}

function reEnable(){

return true

}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}

if (window!=top){top.location.href=location.href;}


var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){

if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)

return false

}

function reEnable(){

return true

}

if (typeof document.onselectstart!="undefined")

document.onselectstart=new Function ("return false")

else{

document.onmousedown=disableselect

document.onmouseup=reEnable

}


//Sample usages
//disableSelection(document.body) //Disable text selection on entire body
//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"



