/* Tratamento eventos botão direito - INICIO */
function clickIE() {
	if (document.all) {
		return false;
	}
}

function clickNS(e) {
	if (document.layers||(document.getElementById&&!document.all)) {
		if (e.which==2||e.which==3) {
			return false;
		}
	}
}

function imageBtnRight() {
	if(document.images) {
		for(i=0;i<document.images.length;i++) {
			document.images[i].onmousedown = right;
			document.images[i].onmouseup = right;
		}
	}
}

function right(e) {
	var msg = "Desculpe, as imagens não estão disponíveis para download.";
	if (navigator.appName == 'Netscape' && e.which == 3) {
		alert(msg);
		return false;
	} else if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
		alert(msg);
		return false;
	} else {
		return true;
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS;
} else {
	document.onmouseup=clickNS;
	document.oncontextmenu=clickIE;
}

document.oncontextmenu=new Function("return false"); 

/* Tratamento eventos botão direito - FIM */

function openPopup(url, name, width, height, scrollbars) {
  window.open(url, name, 'width=' + width + 'px, height=' + height + 'px, menubar=no, resizable=no, scrollbars=' + scrollbars + ', status=no, titlebar=no, toolbar=no');
}

function isNumberKey(evt)
{
  var charCode = 0;
  if ((evt != null) && (evt.which)) {
	charCode = evt.which;
  } else if (evt != null) {
	charCode = evt.keyCode;
  } else if (event != null) {
	charCode = event.keyCode ;
  }
  if ((charCode < 48 || charCode > 57) && (charCode != 8) && (charCode != 9)  && (charCode != 46)
	  && (charCode != 37) && (charCode != 38) && (charCode != 39) && (charCode != 40))
    return false;

  return true;
}
