



function DeliveryAddress_copyBillingAddress()
{
	
	$('input', '#checkout_deliveryAddress').each(function()
	{
		var n = $(this).attr('id').replace(/da_/, '');
		// alert(n);
		$(this).val( $('#' + n).val() );
	});
	checkRequiredFields();
	
}




function populateProductSelectOptions(theSelect, category_id, selected_product_id)
{
	if ( category_id > 0 )
	{
		$('#' + theSelect).append('<option value="">Loading...</option>');
		$('#' + theSelect).load('/p/populateProducts.php?category_id=' + category_id + '&selected_product_id=' + selected_product_id);
	}
}





function setRequiredFields()
{
	// append a asterisk to the required fields labels
	$('.required').each(function()
	{
		if ( $('img', $(this)).length == 0 )
		{
			$(this).append('<img src="/img/forms/required.gif" alt="Required Field" style="margin:0 0 5px 5px;" />');
		}
	});
	
}


function unsetRequiredFields(fieldset)
{
	// append a asterisk to the required fields labels
	$('label.required img', '#' + fieldset).remove();
}










