// function to show layers
function showlayer(id){
	if (document.getElementById)
	{
		// this is the way the standards work
		var x = document.getElementById(id).style;
		x.display = x.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var x = document.all[id].style;
		x.display = x.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[id].style;
		x.display = x.display? "":"block";
	}
}

function hidelayer(id){
	if (document.getElementById)
	{
		// this is the way the standards work
		var x = document.getElementById(id).style;
		x.display = x.display? "":"none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var x = document.all[id].style;
		x.display = x.display? "":"none";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[id].style;
		x.display = x.display? "":"none";
	}
}

function clearSearch(){
	var val = document.forms["quick_find"].elements["keywords"].value;
	if (val == "zoeken"){
		document.forms["quick_find"].elements["keywords"].value = "";
	}
}

function fillSearch(){
	var val = document.forms["quick_find"].elements["keywords"].value;
	if (val == ""){
		document.forms["quick_find"].elements["keywords"].value = "zoeken";
	}
}

//form field functions for invoerlijst
function addFormField() {
	var id = document.getElementById("id").value;
	$("#divTxt").append("<p id='row" + id + "'>&nbsp;<input class='inputfield'  name='artikel[]' size='10' type='text'> &nbsp; &nbsp; <input class='inputfield' name='aantal[]' size='5' value='1' type='text'>&nbsp;&nbsp;<img src='images/icons/delete.png' style='cursor: pointer !important;' onClick='removeFormField(\"#row" + id + "\");'></p>");
	
	$('#row' + id).highlightFade({
		speed:1000,
		start:'#FFFFFF'
	});

	id = (id - 1) + 2;
	document.getElementById("id").value = id;
}

function removeFormField(id) {
	$(id).remove();
}
//end form field functions for invoerlijst
