function updateCost()
{
	var base_price_car = 25.00;
	var base_price_car_single = 13.00;
	var base_price_4x4 = 26.00;
	var base_price_4x4_single = 14.00;
	var base_price_motorcycle = 13.00;
	var base_price_rover = 26.00;
	var base_price_rover_single = 15.00;

	var flag_car = 5.00;
	var flag_car_single = 3.00;
	var flag_4x4 = 5.00;
	var flag_4x4_single = 3.00;
	var flag_motorcycle = 3.00;
	var flag_rover = 5.00;
	var flag_rover_single = 5.00;

	var font_car = 9.00;
	var font_car_single = 4.50;
	var font_4x4 = 9.00;
	var font_4x4_single = 4.50;
	var font_motorcycle = 4.50;
	var font_rover = 9.00;
	var font_rover_single = 4.50;

	var flag = document.getElementById('flag').value;
	var view = document.getElementById('view').value;
	var font = document.getElementById('font').value;
	var plates = document.getElementById('plates').value;
	var type = document.getElementById('type').value;

	var vat = 1;
	var base_price = 0;
	var flag_price = 0;
	var border_price = 0;
	var font_price = 0;
	var delivery_cost = 0;

	// disable form elements if needed
	if(type == 'motorcycle')
	{
		document.getElementById('plates').selectedIndex = 2;
		document.getElementById('plates').disabled = true;
	}
	else
	{
		document.getElementById('plates').disabled = false;
	}
	
	if((type == '4x4' || type == 'rover') && plates == 'front')
	{
		document.getElementById('type').selectedIndex = 0;
		type = 'car';
	}
	if(plates != 'both')
	{
		plates = '_single';
	}
	else
	{
		plates = '';
	}
	if(type == 'motorcycle')
	{
		plates = '';
	}

	// get base cost
	base_price = eval('base_price_' + type + plates);

	if(flag != 'none' && type != 'classic_car' && type != 'classic_motorcycle')
	{
		// get flag price
		flag_price = eval('flag_' + type + plates);
	}

	if(font != 'standard' && type != 'classic_car' && type != 'classic_motorcycle')
	{
		// get font price
		font_price = eval('font_' + type + plates);
	}

	// add total price
	var total = ((base_price + flag_price + border_price + font_price) * vat);
	
	document.getElementById('acrylic_plate_price').value = formatNumber(total);
}

function formatNumber(mnt)
{
	mnt -= 0;
	mnt = (Math.round(mnt * 100)) / 100;
	return (mnt == Math.floor(mnt)) ? mnt + '.00' : ((mnt * 10 == Math.floor(mnt * 10)) ? mnt + '0' : mnt);
}

function isAlphaNumeric(char)
{
	char = char.toUpperCase();
	var strValidChars = "0123456789ABCDEFGHIJKLMNOPRSTUVWXYZ";
	if(char.length == 0)
	{
		return false;
	}
	if(strValidChars.indexOf(char) == -1)
	{
		return false;
	}
	else
	{
		return true;
	}
}