/* PALIMPSEST NIJMEGEN 2007 */

// BEREKENINGEN FORMULIER

function Calculate(form)

{	var totaal       = 0;
	var aantal_items = 0;

	form.bedrag_atap.value         =20.00 * form.aantal_atap.value;
	totaal +=                      (20.00 * form.aantal_atap.value);
	aantal_items +=                (1     * form.aantal_atap.value);

	form.bedrag_echos.value        =18.00 * form.aantal_echos.value;
	totaal +=                      (18.00 * form.aantal_echos.value);
	aantal_items +=                (1     * form.aantal_echos.value);

	form.bedrag_vluchten.value 	   =15.00 * form.aantal_vluchten.value;
	totaal +=                      (15.00 * form.aantal_vluchten.value);
	aantal_items +=                (1     * form.aantal_vluchten.value);

	form.bedrag_windstreken.value  = 8.00 * form.aantal_windstreken.value;
	totaal +=                      ( 8.00 * form.aantal_windstreken.value);
	aantal_items +=                (1 *     form.aantal_windstreken.value);

	form.bedrag_weeshuis.value     =18.00 * form.aantal_weeshuis.value;
	totaal +=                      (18.00 * form.aantal_weeshuis.value);
	aantal_items +=                (1     * form.aantal_weeshuis.value);


	form.aantal_items.value        =parseFloat(aantal_items);

		
	if(form.leveradres[0].checked == true)
	{
        form.toeslag.value         = 0.00 *	form.aantal_items.value;
        totaal +=                  ( 0.00 * form.aantal_items.value);
	}
	else
	{
        form.toeslag.value         = 8.00 *	form.aantal_items.value;
        totaal +=                  ( 8.00 * form.aantal_items.value);
	}

	form.totaal.value              =parseFloat(totaal);
}


//  CONFIRM RESET FORMULIER

function BevestigReset()
{
    if(confirm('Wilt u de bestelling annuleren en alle gegevens wissen?'))
    {
        document.getElementById('bestelform').reset();
        location.replace('discografie.html');
    }
    else
    {
        return false;
    }
}

function ConfirmReset()
{
    if(confirm('Do you wish to cancel your order and to delete your data?'))
    {
        document.getElementById('bestelform').reset();
        location.replace('discography.html');
    }
    else
    {
        return false;
    }
}

//  CONFIRM SUBMIT FORMULIER

function BevestigSubmit()
{
    if(confirm('Wilt u de bestelling verzenden?'))
    {
        document.getElementById('bestelform').submit();
        return true;
    }
    else
    {
        return false;
    }
}

function ConfirmSubmit()
{
    if(confirm('Do you wish to submit your order?'))
    {
        document.getElementById('bestelform').submit();
        return true;
    }
    else
    {
        return false;
    }
}
