function confirmCredit () 
{
	return confirm ("Wilt u deze facturen crediteren?");
}

function confirmSluiten()
{
	return confirm ("Is de factuur betaald? Weet u zeker dat u deze wilt sluiten?");
}

function confirmStorno() 
{
	return confirm ("Moet de factuur weer worden geopend? Is de opdracht bijvoorbeeld gestorneerd?");
}

function confirmMail() 
{
	return confirm ("Factuur mailen naar de klant?");
}		

function checkVerlengen(formnaam)
{
	if(document.forms[formnaam].verlengen.value == 'false')
	{
		document.forms[formnaam].verlengperiode.value = 0;
	}
}

function confirmCreditDienst () 
{
	return confirm ("Wilt u deze dienst crediteren?");
}

function checkAll(formnaam, veldnaam, check) 
{
	//als er geen check is opgegeven dit gedeelte ook uitvoeren
	if(check.length == 0)
	{			
		if(document.forms[formnaam].allemaal.checked == true)
		{
			document.forms[formnaam].allemaal.checked = true;			
			check = true;
		}
		else
		{
			document.forms[formnaam].allemaal.checked = false;
			check = false;
		}
	}

	n = document.forms[formnaam].elements.length;
	
	for (i=0; i<n; i++)
	{
		if (document.forms[formnaam].elements[i].name.indexOf(veldnaam) !=-1)
		{
			document.forms[formnaam].elements[i].checked = check;
		}
	}
}

function showsection(id, option)
{
	// Check if element is not hidden
	if (option==0)
	{
		// Hide element and save status
		document.getElementById('section_' + id).style.display = 'none';
	}
	else
	{
		// Show element and save status
		document.getElementById('section_' + id).style.display = 'inline';
	}
}

function togglesection(id)
{
	// Check if element is not hidden
	if (document.getElementById('section_' + id).style.display != 'none')
	{
		// Hide element and save status
		document.getElementById('section_' + id).style.display = 'none';
		document.getElementById('icon_' + id).src = 'images/book_dicht.gif';
	}
	else
	{
		// Show element and save status
		document.getElementById('section_' + id).style.display = 'inline';
		document.getElementById('icon_' + id).src = 'images/book_open.gif';
	}
}

function GoTo(paginanaam, nummer, soort, status, ascdesc)
{
	var pad = 'http://backoffice.grafix.nl/';

	window.location = pad + paginanaam + '?pagina=' + nummer + soort + status + ascdesc;
}
