cat_actief = 1;
vakje_licht = 0;
koop_cat = "";
koop_catnr = "";
koop_name = "";
koop_desc = "";
koop_price = "";
for (i = 1; i <= 15; i++)
{
	eval_strings = 'seticon_'+i+' = 0; naamicon_'+i+' = ""; omschrijficon_'+i+' = "";';
	eval(eval_strings);
}
function clear_icons()
{
	clear_iconen();
	clear_rest();
}
function clear_iconen()
{
	for (i = 1; i <= 15; i++)
	{
		document.getElementById("srcicon_"+i).src = "images/catalogus/icon.gif";
	}
	for (i = 1; i <= 15; i++)
	{
		eval_strings = 'seticon_'+i+' = 0; naamicon_'+i+' = ""; omschrijficon_'+i+' = "";';
		eval(eval_strings);
	}
	if (vakje_licht != 0)
	{
		document.getElementById("srcvakje_"+vakje_licht).src = "images/catalogus/vakje1.gif";
		vakje_licht = 0;
	}
	document.getElementById("cat_pijl1").src = "images/catalogus/pijl1_1.gif";
	document.getElementById("cat_pijl2").src = "images/catalogus/pijl2_1.gif";
}
function clear_rest()
{
	document.getElementById("naam").innerHTML = "";
	document.getElementById("prijsvakje").style.visibility = 'hidden';
	document.getElementById("prijs").style.visibility = 'hidden';
	document.getElementById("koopknop").style.visibility = 'hidden';
	document.getElementById("prijs").innerHTML = "";
	koop_cat = "";
	koop_catnr = "";
	koop_name = "";
	koop_desc = "";
	koop_price = "";
}
function lichtop(vak_nr)
{
	eval_controle = "if (seticon_"+vak_nr+" == 1) { controle = \"ja\"; } else { controle = \"nee\"; }";
	eval(eval_controle);
	if (controle == "ja")
	{
		eval_getname = "getname = naamicon_"+vak_nr+";";
		eval(eval_getname);
		eval_getomschrijf = "getomschrijf = omschrijficon_"+vak_nr+";";
		eval(eval_getomschrijf);
		eval_getprijs = "getprijs = prijsicon_"+vak_nr+";";
		eval(eval_getprijs);
		eval_getcat = "getcat = caticon_"+vak_nr+";";
		eval(eval_getcat);
		eval_getcatnr = "getcatnr = catnricon_"+vak_nr+";";
		eval(eval_getcatnr);
		if (vakje_licht == 0)
		{
			vakje_licht = vak_nr;
			document.getElementById("srcvakje_"+vak_nr).src = "images/catalogus/vakje2.gif";
		}
		else
		{
			if (vakje_licht != vak_nr)
			{
				document.getElementById("srcvakje_"+vakje_licht).src = "images/catalogus/vakje1.gif";
				vakje_licht = vak_nr;
				document.getElementById("srcvakje_"+vak_nr).src = "images/catalogus/vakje2.gif";
			}
		}
		if (getprijs == 1)
		{
			cr_prijs = "Credit";
		}
		else
		{
			cr_prijs = "Credits";
		}
		document.getElementById("srcplaatje").src = "images/items/"+getcat+"/"+getcatnr+"/1.gif";
		document.getElementById("prijsvakje").style.visibility = 'visible';
		document.getElementById("prijs").style.visibility = 'visible';
		document.getElementById("koopknop").style.visibility = 'visible';
		document.getElementById("prijs").innerHTML = getprijs+" "+cr_prijs;
		document.getElementById("naam").innerHTML = getname;
		document.getElementById("kies").innerHTML = getomschrijf;
		koop_cat = getcat;
		koop_catnr = getcatnr;
		koop_name = getname;
		koop_desc = getomschrijf;
		koop_price = getprijs;
	}
}
function categorie(catnum)
{
	document.getElementById("srclogo").src = "images/catalogus/logo/"+catnum+".gif";
	document.getElementById("cat_pagina").innerHTML = "";
	document.getElementById("cat_pijl1_div").style.visibility = 'hidden';
	document.getElementById("cat_pijl2_div").style.visibility = 'hidden';
	document.getElementById("cat_pagina_div").style.visibility = 'hidden';
	clear_icons();
	if (catnum == 1)
	{
		document.getElementById("kies").innerHTML = "";
		document.getElementById("srcinhoud").style.visibility = 'visible';
		document.getElementById("srckado").style.visibility = 'hidden';
		document.getElementById("srcplaatje").style.visibility = 'hidden';
		document.getElementById("cat_omschrijf").style.visibility = 'hidden';
		document.getElementById("srccat_kiesart").style.visibility = 'hidden';
		document.getElementById("cat_icons").style.visibility = 'hidden';
		document.getElementById("srclinks_"+cat_actief).src = "images/catalogus/links1.gif";
		document.getElementById("srclinks_"+catnum).src = "images/catalogus/links2.gif";
		document.getElementById("srccatknop_"+cat_actief).style.background = "rgb(221, 221, 221)";
		document.getElementById("srccatknop_"+catnum).style.background = "rgb(240, 240, 240)";
		cat_actief = catnum;
	}
	else
	{
		if (catnum == 32)
		{
			document.getElementById("kies").innerHTML = "";
			document.getElementById("srcinhoud").style.visibility = 'hidden';
			document.getElementById("srckado").style.visibility = 'visible';
			document.getElementById("srcplaatje").style.visibility = 'hidden';
			document.getElementById("cat_omschrijf").style.visibility = 'hidden';
			document.getElementById("srccat_kiesart").style.visibility = 'hidden';
			document.getElementById("cat_icons").style.visibility = 'hidden';
			document.getElementById("srclinks_"+cat_actief).src = "images/catalogus/links1.gif";
			document.getElementById("srclinks_"+catnum).src = "images/catalogus/links2.gif";
			document.getElementById("srccatknop_"+cat_actief).style.background = "rgb(221, 221, 221)";
			document.getElementById("srccatknop_"+catnum).style.background = "rgb(240, 240, 240)";
			cat_actief = catnum;
		}
		else
		{
			document.getElementById("kies").innerHTML = "Klik op een artikel voor meer details.";
			document.getElementById("srcplaatje").style.visibility = 'visible';
			document.getElementById("cat_omschrijf").style.visibility = 'visible';
			if (catnum != 2)
			{
				document.getElementById("cat_icons").style.visibility = 'visible';
				document.getElementById("srccat_kiesart").style.visibility = 'visible';
			}
			else
			{
				document.getElementById("cat_icons").style.visibility = 'hidden';
				document.getElementById("srccat_kiesart").style.visibility = 'hidden';
			}
			document.getElementById("srcinhoud").style.visibility = 'hidden';
			document.getElementById("srckado").style.visibility = 'hidden';
			document.getElementById("cat_omschrijf").innerHTML = cat_desc[catnum];
			document.getElementById("srcplaatje").src = "images/catalogus/plaatjes/"+catnum+".gif";
			document.getElementById("srclinks_"+cat_actief).src = "images/catalogus/links1.gif";
			document.getElementById("srclinks_"+catnum).src = "images/catalogus/links2.gif";
			document.getElementById("srccatknop_"+cat_actief).style.background = "rgb(221, 221, 221)";
			document.getElementById("srccatknop_"+catnum).style.background = "rgb(240, 240, 240)";
			cat_actief = catnum;
			var x;
			aantal = 0;
			eval_aantal = "for (x in cat_cat"+catnum+") { aantal++; }";
			eval(eval_aantal);
			if (aantal <= 15)
			{
				loopaf = aantal;
				for (i = 1; i <= loopaf; i++)
				{
					roep_array = i - 1;
					eval_image = "icon_image = cat_cat"+catnum+"[roep_array]+'/'+cat_catnr"+catnum+"[roep_array];";
					eval(eval_image);
					document.getElementById("srcicon_"+i).src = "images/items/"+icon_image+"/icon.gif";
					eval_setting = "seticon_"+i+" = 1;";
					eval(eval_setting);
					eval_naam = "icon_naam = cat_naam"+catnum+"[roep_array];";
					eval(eval_naam);
					eval_setnaam = "naamicon_"+i+" = \""+icon_naam+"\";";
					eval(eval_setnaam);
					eval_setomschrijf = "omschrijficon_"+i+" = cat_omschrijf"+catnum+"[roep_array];";
					eval(eval_setomschrijf);
					eval_setprijs = "prijsicon_"+i+" = cat_prijs"+catnum+"[roep_array];";
					eval(eval_setprijs);
					eval_setcat = "caticon_"+i+" = cat_cat"+catnum+"[roep_array];";
					eval(eval_setcat);
					eval_setcatnr = "catnricon_"+i+" = cat_catnr"+catnum+"[roep_array];";
					eval(eval_setcatnr);
				}
			}
			else
			{
				document.getElementById("cat_pijl1_div").style.visibility = 'visible';
				document.getElementById("cat_pijl2_div").style.visibility = 'visible';
				document.getElementById("cat_pagina_div").style.visibility = 'visible';
				loopaf = 15;
				for (i = 1; i <= loopaf; i++)
				{
					roep_array = i - 1;
					eval_image = "icon_image = cat_cat"+catnum+"[roep_array]+'/'+cat_catnr"+catnum+"[roep_array];";
					eval(eval_image);
					document.getElementById("srcicon_"+i).src = "images/items/"+icon_image+"/icon.gif";
					eval_setting = "seticon_"+i+" = 1;";
					eval(eval_setting);
					eval_naam = "icon_naam = cat_naam"+catnum+"[roep_array];";
					eval(eval_naam);
					eval_setnaam = "naamicon_"+i+" = \""+icon_naam+"\";";
					eval(eval_setnaam);
					eval_setomschrijf = "omschrijficon_"+i+" = cat_omschrijf"+catnum+"[roep_array];";
					eval(eval_setomschrijf);
					eval_setprijs = "prijsicon_"+i+" = cat_prijs"+catnum+"[roep_array];";
					eval(eval_setprijs);
					eval_setcat = "caticon_"+i+" = cat_cat"+catnum+"[roep_array];";
					eval(eval_setcat);
					eval_setcatnr = "catnricon_"+i+" = cat_catnr"+catnum+"[roep_array];";
					eval(eval_setcatnr);
				}
				cat_blz = Math.ceil(aantal/15);
				cat_pijl1_to = 0;
				document.getElementById("cat_pijl1").src = "images/catalogus/pijl1_1.gif";
				if (cat_blz > 1)
				{
					cat_pijl2_to = 2;
					document.getElementById("cat_pijl2").src = "images/catalogus/pijl2_2.gif";
				}
				else
				{
					cat_pijl2_to = 0;
					document.getElementById("cat_pijl2").src = "images/catalogus/pijl2_2.gif";
				}
				document.getElementById("cat_pagina").innerHTML = "1/"+cat_blz;
			}
		}
	}
}
function cat_show_blz(blz)
{
	if (blz != 0)
	{
		clear_iconen();
		if (blz == 1)
		{
			cat_pijl1_to = 0;
			document.getElementById("cat_pijl1").src = "images/catalogus/pijl1_1.gif";
		}
		else
		{
			cat_pijl1_to = blz-1;
			document.getElementById("cat_pijl1").src = "images/catalogus/pijl1_2.gif";
		}
		if (blz != cat_blz)
		{
			cat_pijl2_to = blz+1;
			document.getElementById("cat_pijl2").src = "images/catalogus/pijl2_2.gif";
		}
		else
		{
			cat_pijl2_to = 0;
			document.getElementById("cat_pijl2").src = "images/catalogus/pijl2_1.gif";
		}
		document.getElementById("cat_pagina").innerHTML = blz+"/"+cat_blz;
		aantal = 0;
		eval_aantal = "for (x in cat_cat"+cat_actief+") { aantal++; }";
		eval(eval_aantal);
		tot_item = blz*15;
		van_item = tot_item-15;
		if (tot_item > aantal)
		{
			tot_item = aantal;
		}
		i2 = 1;
		for (i = van_item+1; i <= tot_item; i++)
		{
			roep_array = i - 1;
			eval_image = "icon_image = cat_cat"+cat_actief+"[roep_array]+'/'+cat_catnr"+cat_actief+"[roep_array];";
			eval(eval_image);
			document.getElementById("srcicon_"+i2).src = "images/items/"+icon_image+"/icon.gif";
			eval_setting = "seticon_"+i2+" = 1;";
			eval(eval_setting);
			eval_naam = "icon_naam = cat_naam"+cat_actief+"[roep_array];";
			eval(eval_naam);
			eval_setnaam = "naamicon_"+i2+" = \""+icon_naam+"\";";
			eval(eval_setnaam);
			eval_setomschrijf = "omschrijficon_"+i2+" = cat_omschrijf"+cat_actief+"[roep_array];";
			eval(eval_setomschrijf);
			eval_setprijs = "prijsicon_"+i2+" = cat_prijs"+cat_actief+"[roep_array];";
			eval(eval_setprijs);
			eval_setcat = "caticon_"+i2+" = cat_cat"+cat_actief+"[roep_array];";
			eval(eval_setcat);
			eval_setcatnr = "catnricon_"+i2+" = cat_catnr"+cat_actief+"[roep_array];";
			eval(eval_setcatnr);
			i2++;
		}
	}
}