function popup(file, scroll, width, height)
{
	window.open(file, 'popup', 'scrollbars='+scroll+', width='+width+', height='+height+'');
}

function confirmsubmitje(tekst)
{
	var agree = confirm(tekst);
	if (agree)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function popupWinkelmand(productid)
{
   	var adres = '/winkelmandje.php?productid=';
   	adres = adres + productid;
   	adres = adres + '&aantal=';
    adres = adres + document.getElementById('aantal'+productid).value;
   	window.open(adres, 'popup', 'height=230,width=220');
} 

function popupFavoriet(productid)
{
   	var adres = '/favorietpopup.php?productid=';
   	adres = adres + productid;
   	adres = adres + '&aantal=';
    adres = adres + document.getElementById('aantal'+productid).value;
   	window.open(adres, 'popup', 'height=230,width=220');
} 

// Geeft alle subcategories terug voor 1 hoofdcategorie.
function setHoofdcategorie(hcid)
{
	if(hcid > 0)
	{
		var url = "/inc/ajax.php?amode=setHoofdcategorie&hcid="+document.getElementById(hcid+'[hoofdcategorie]').value+"&gekozencid="+document.getElementById(hcid+'[gekozencid]').value+"&admin=1&productid="+hcid+"&sid="+Math.random();
		load(url, hcid+'[a-subcategories]');
	}
	else
	{
		var url = "/inc/ajax.php?amode=setHoofdcategorie&hcid="+document.getElementById('tp-hoofdcategorie').value+"&cnaam="+document.getElementById('tp-gekozencnaam').value+"&gekozencid="+document.getElementById('tp-gekozencid').value+"&sid="+Math.random();
		load(url, 'a-subcategories');
	}
}
