function menuOpen(a) {
	obj = document.getElementById(a); 
	if(obj){
		obj.style.visibility="visible";
	}
}

function menuClose(a) {
	obj = document.getElementById(a); 
	if(obj){
		obj.style.visibility="hidden";
	}
}


function add_field() {
	var inputfield = document.createElement("INPUT");
	var brtje = document.createElement("BR");

	document.getElementById("file" + count).onchange = null;
	count++;
	inputfield.id = "file" + count;
	inputfield.className = "file";
	inputfield.type = "file";
	inputfield.name = "file" + count;
	inputfield.onchange = add_field;
	inputfield.style.border = "1px solid black";
	inputfield.style.margin = "0px 0px 8px 215px";
	inputfield.style.backgroundColor = "#F5F5F5";
	inputfield.style.height = "16px";
	inputfield.style.width = "203px";
	inputfield.style.fontSize = "10px";

	document.getElementById("uploadform").insertBefore(inputfield, document.getElementById("buttons"));
	document.getElementById("uploadform").insertBefore(brtje, document.getElementById("buttons"));

	return true;
}

function uploadsubmit() {
	alert(document.getElementById("file" + count).value);

	if (! document.getElementById("file" + count).value) {
		document.getElementById("file" + count).parentNode.removeChild(document.getElementById("file" + count));
	}
	return false;
}


function popitup1(locatie,windowname,x,y)
	{
	var parameters = "'toolbar=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=yes,location=no,width=" + x + ",height=" + y + "'";
	window.open(locatie,windowname,parameters);
	// windowname.moveTo(0,0);
	}
	
function popitup(locatie,windowname,x,y)
	{
	var parameters = "'toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes,resizable=no,location=no,width=" + x + ",height=" + y + "'";
	window.open(locatie,windowname,parameters);
	// windowname.moveTo(0,0);
	}


function popitup2(locatie,windowname,x,y)
	{
	var parameters = "'toolbar=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no,location=no,width=" + x + ",height=" + y + "'";
	window.open(locatie,windowname,parameters);
	// windowname.moveTo(0,0);
	}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  var MyWindow = window.open(theURL,winName,features);
  MyWindow.focus();
}

function checkform(f)
  {
  if (f.elements['contactpersoon'].value == "")
    {
    alert("Geen naam contactpersoon ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['contactpersoon'].focus()",500);
    return (false);
    }
  if ((f.elements['contactpersoon'].value.indexOf("[", 0) >= 0) && (f.elements['contactpersoon'].value.indexOf("]", 0) >= 0)){
    alert("AUB geen HTML code invoeren.");
    window.setTimeout("document.forms['informatie'].elements['contactpersoon'].focus()",500);
    return (false);
		}
  if (f.elements['adres'].value == "")
    {
    alert("Geen adres ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['adres'].focus()",500);
    return (false);
    }
  if ((f.elements['adres'].value.indexOf("[", 0) >= 0) && (f.elements['adres'].value.indexOf("]", 0) >= 0)){
    alert("AUB geen HTML code invoeren.");
    window.setTimeout("document.forms['informatie'].elements['adres'].focus()",500);
    return (false);
		}	
  if (f.elements['postcode'].value == "")
    {
    alert("Geen postcode ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['postcode'].focus()",500);
    return (false);
    }
  if ((f.elements['postcode'].value.indexOf("[", 0) >= 0) && (f.elements['postcode'].value.indexOf("]", 0) >= 0)){
    alert("AUB geen HTML code invoeren.");
    window.setTimeout("document.forms['informatie'].elements['postcode'].focus()",500);
    return (false);
		}
  if (f.elements['plaats'].value == "")
    {
    alert("Geen plaats ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['plaats'].focus()",500);
    return (false);
    }
  if ((f.elements['plaats'].value.indexOf("[", 0) >= 0) && (f.elements['plaats'].value.indexOf("]", 0) >= 0)){
    alert("AUB geen HTML code invoeren.");
    window.setTimeout("document.forms['informatie'].elements['postcode'].focus()",500);
    return (false);
		}
  if (f.elements['email'].value == "")
    {
    alert("Geen e-mail ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['email'].focus()",500);
    return (false);
    }
  else f.submit();		
  }

function checkform_offerte(f)
  {
  if (f.elements['bedrijfsnaam'].value == "")
    {
    alert("Geen bedrijfsnaam ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['bedrijfsnaam'].focus()",500);
    return (false);
    }	
  if (f.elements['contactpersoon'].value == "")
    {
    alert("Geen naam contactpersoon ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['contactpersoon'].focus()",500);
    return (false);
    }
  if (f.elements['plaats'].value == "")
    {
    alert("Geen plaats ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['plaats'].focus()",500);
    return (false);
    }
  if (f.elements['email'].value == "")
    {
    alert("Geen e-mail ingevoerd.");
    window.setTimeout("document.forms['informatie'].elements['email'].focus()",500);
    return (false);
    }
  else f.submit();		
  }

function checkform_login(f) {
  if (f.elements['ARLogin'].value == "")
    {
    alert("Geen Login naam ingevoerd.");
    window.setTimeout("document.forms[0].elements['ARLogin'].focus()",500);
    return (false);
    }	
  if (f.elements['ARPassword'].value == "")
    {
    alert("Geen wachtwoord ingevoerd.");
    window.setTimeout("document.forms[0].elements['ARPassword'].focus()",500);
    return (false);
    }
  else f.submit();
		} 

function checkform_offerte_config(f)
  {
  if (f.elements['Naam_Accountmanager'].value == "")
    {
    alert("Geen naam accountmanager ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Naam_Accountmanager'].focus()",500);
    return (false);
    }	
  if (f.elements['Mailadres_Accountmanager'].value == "")
    {
    alert("Geen mailadres accountmanager ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Mailadres_Accountmanager'].focus()",500);
    return (false);
    }
  if (f.elements['Naam_Klant'].value == "")
    {
    alert("Geen naam klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Naam_Klant'].focus()",500);
    return (false);
    }
  if (f.elements['Adres_Klant'].value == "")
    {
    alert("Geen adres klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Adres_Klant'].focus()",500);
    return (false);
    }
  if (f.elements['Postcode_Klant'].value == "")
    {
    alert("Geen postcode klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Postcode_Klant'].focus()",500);
    return (false);
    }	
  if (f.elements['Plaats_Klant'].value == "")
    {
    alert("Geen plaats klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Plaats_Klant'].focus()",500);
    return (false);
    }
  if (f.elements['Telefoon_Klant'].value == "")
    {
    alert("Geen telefoon klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Telefoon_Klant'].focus()",500);
    return (false);
    }
  if (f.elements['Contactpersoon_Klant'].value == "")
    {
    alert("Geen contactpersoon klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Contactpersoon_Klant'].focus()",500);
    return (false);
    }
  if (f.elements['Mailadres_Klant'].value == "")
    {
    alert("Geen mailadres klant ingevoerd.");
    window.setTimeout("document.forms['offerte_stap0'].elements['Mailadres_Klant'].focus()",500);
    return (false);
    }
  else document.forms['offerte_stap0'].submit();		
  }
