function setTimer () {
	// function to automatically log of after $Timer/1000 seconds
	var $Timer = 300000; 
	var $Clock;
	
	clearTimeout($Clock);
	$Clock = setTimeout('window.location="http://10.0.0.2/erp/index.php?type=uitloggen"',$Timer); 
}

function addAmount($sForm,$sElement,$nNumber) {
	// to add or substract $nNumber to the given box
    $x = parseInt($sForm.elements[$sElement].value,10);
    
    if (isNaN($x)){
	    $x=0;
    }
    
    $x += $nNumber;
    if ($x < 0){
	    $x=0;
    }
    
    $sForm.elements[$sElement].value = $x;
}

function openLink(src){
	window.location=src;
}

function deleteProduct($p_nProductID) {
	$bConfirmed = confirm("Product echt verwijderen? Dit kan niet ongedaan gemaakt worden!");
	
	if ($bConfirmed) {
		location.href = "admin.php?type=dropproduct&productid="+$p_nProductID;
	}
	
}

function loadProduct() {
	//document.allproducts.submit();
	//document.forms['allproducts'].submit();
}
