// 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 == "trefwoorden"){
		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 = "trefwoorden";
	}
}

//form field functions for invoerlijst
function addFormField() {
	var id = document.getElementById("id").value;
	$("#tableTxt").append("<tr id='row" + id + "'><td><input class='inputfield' name='artikel[]' size='10' type='text' onchange='showProduct(this.value," + id + ")' value=''></td><td><span id='products_name_" + id + "'>-</span></td><td><span id='donker_blauw'><span id='besteleenheid_" + id + "'>-</span></span></td><td><span id='donker_blauw'><span id='verpakeenheid_" + id + "'>-</span></span></td><td><div id='goods_out_of_stock" + id + "' style='display:none;'><img src='images/out_of_stock.gif' width='16' height='16'/></div><div id='goods_in_stock" + id + "' style='display:none;'><img src='images/in_stock.gif' width='16' height='16'/></div></td><td><input class='inputfield' name='aantal[]' id='aantal" + id + "' size='5' value='' type='text'></td><td></td></tr>");
	id = (id - 1) + 2;
	document.getElementById("id").value = id;
}


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

