var zeit;
function click() {
if (event.button != 1) {
popup();
return false;
}
}
function nsc(e) {
if (e.which != 1) keinkontext();
}
function popup() {
return false;
}
function nichts(e) {
if (e.which != 1) return false;
}
function keinkontext() {
clearTimeout(zeit);
zeit = setTimeout("kontext()",1);
}
function kontext() {
clearTimeout(zeit);
popup();
}
if (document.all)
if (document.getElementById) document.oncontextmenu=popup;
else document.onmousedown=click0;
if (!(document.all) && document.getElementById)
document.oncontextmenu=popup;
if (document.layers) {
document.captureEvents(Event.MOUSEUP | Event.MOUSEDOWN);
document.onmousedown=nichts;
document.onmouseup=nsc;
}

errorEmpty = false;

function checkEmpty(text,id) {
  if (text == '') {
	document.getElementById(id).style.color = 'red';
	errorEmpty = true;
  }
  else{
  document.getElementById(id).style.color = '#333333';
  if(errorEmpty != true)
		errorEmpty = false;
  }
}

function checkForm() {
  
  errorEmpty = false;
  
  var firstText = document.getElementById("boxfirst").value;
  var lastText = document.getElementById("boxlast").value;
  var companyText = document.getElementById("boxcompany").value;
  var phoneText = document.getElementById("boxphone").value;
  var emailText = document.getElementById("boxemail").value;


  checkEmpty(firstText,'first');
  checkEmpty(lastText,'last');	
  checkEmpty(companyText,'company');	
  checkEmpty(phoneText,'phone');
  checkEmpty(emailText,'email');
  
  if (errorEmpty == true) {
		errorEmpty = false;
		return false;
  }
}
