var colour = null;

function highlight_field(field)
{
	colour = field.style.backgroundColor;
	field.style.backgroundColor = '#fffbcc';
}

function revert_field(field)
{
	field.style.backgroundColor = colour;
}

var delivery_billing = 0;

function delivery_to_billing(override)	
{
	var elements = ['first_name', 'last_name', 'address', 'city', 'county', 'zip_code', 'country_id'];
	if (delivery_billing == 0 || override)
	{
		if (!override) { delivery_billing = 1; }
		for (var x = 0; x < elements.length; x++)
			$('order_delivery_' + elements[x]).value = $('order_billing_' + elements[x]).value;
	}
	else 
	{
		if (!override) { delivery_billing = 0; }
		for (var x = 0; x < elements.length; x++)
			$('order_delivery_' + elements[x]).value = "";
	}
}

function track_typing()
{
	if (delivery_billing == 1)
		delivery_to_billing(true);
}

function please_wait(button)	{
	button.value= 'Please wait...'; 
}

function order_please_wait(button, wait_image)	{
	$(button).style.display = "none";
	$(wait_image).style.display = "inline";
}

function display_cvn(field)	{
	cvn = $('verification_value');
	if (field.value != 'Laser' && field.value != 'Select Card Type')
		cvn.style.display = 'block';
	else
		cvn.style.display = 'none';
}