function Zoeken(sObject)
{
	if (sObject.value != '')
	{
		location.href = 'assortiment.php?action=search&value=' + sObject.value;
	}
}

function Key(e, sObject)
{
	if (e.keyCode == 13)
	{
		Zoeken(sObject);
	}
}

function openSub(n) {
	var i = 0
	/*
	for(i=1;i<total_subs+1;i++) {
		var sel = document.getElementById('sub_'+i);
		sel.style.display = 'none';
	}
	*/
	var sel = document.getElementById('sub_'+n);
	sel.style.display = 'block';
}

function openSubSub(n) {
	var i = 0
	for(i=1;i<total_subsubs+1;i++) {
		var sel = document.getElementById('subsub_'+i);
		sel.style.display = 'none';
	}
	var sel = document.getElementById('subsub_'+n);
	sel.style.display = 'block';
}

function set_item(naam,pagina) {
//	document.getElementById('item_').style.backgroundColor=bg_color;
	for(i=1;i<total_subs+1;i++) {
		document.getElementById('sub_'+i).style.backgroundColor='';
	}
	for(i=1;i<total_subsubs+1;i++) {
		document.getElementById('subsub_'+i).style.backgroundColor='';
	}
	for(i=1;i<total_items+1;i++) {
		document.getElementById('item_'+i).style.backgroundColor='';
	}
//	document.getElementById('item_19').style.backgroundColor='#FFFFFF';
//	alert(naam);
	document.getElementById(naam).style.backgroundColor=bg_color;
}

function open_location(loc)
{
	if (loc != '')
	{
		location.href = loc;
	}
}

function PlaceFader(aantal, pad){
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="400" height="230" id="fader" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="sw/fader.swf?aantal=' + aantal + '&pad=' + pad + '" /><param name="menu" value="false" /><param name="scale" value="noscale" /><param name="quality" value="high" /><param name="salign" value="lt" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="sw/fader.swf?aantal=' + aantal + '&pad=' + pad + '" menu=false quality=high scale=noscale salign=lt wmode=transparent bgcolor=#ffffff width="400" height="230" name="header" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
}

function set_start(){
	for(i = 1; i <= total_subs; i++)
	{
		openSub(i);
	}
}

function run_popup(url) {
	popwidth = 420;
	popheight = 420;
	window.open(url,"pop_up","width="+ popwidth +",height="+ popheight +",scrollbars=no,toolbar=no,resizable=no," + align_string_pop(popwidth, popheight))
}

function run_popup_x(url, w, h) {
	popwidth = w;
	popheight = h;
	window.open(url,"pop_up","width="+ popwidth +",height="+ popheight +",scrollbars=no,toolbar=no,resizable=no," + align_string_pop(popwidth, popheight))
}

function align_string_pop(popwidth, popheight) {
	var breedte = screen.width;
	var hoogte 	= screen.height;
	
	var prop_left 	= (screen.width/2) - (popwidth/2);
	var prop_top	= (screen.height/2) - (popheight/2);
	
	return "left=" + prop_left + ",top=" + prop_top;
}
