
function Checkout_OnClickConfirmSubmit()
{
	if(document.getElementById('all_content_area'))
		document.getElementById('all_content_area').style.display = 'none';
	if(document.getElementById('post_confirm_message'))
		document.getElementById('post_confirm_message').style.display = '';
}

function Checkout_LoadShippingInfoLoadButton_Clicked()
{
	// disable the dropdown box
	document.getElementById("match").disabled = 'disabled';
	
	// disable the submit button
	document.getElementById("load_ship_to_button").disabled = 'disabled';
	
	// show the loading message
	document.getElementById("load_shipping_info_status_area").innerHTML = '<img src="images/site_images/processing_small.gif">&nbsp;loading...';
	
	//==============================================================================
	// send the ajax data to the server
	//------------------------------------------------------------------------------
	var ajax_obj = new Class_Ajax();
	ajax_obj.data_obj.match_val = document.getElementById("match").value;
	ajax_obj.SendRequest('index.php?param=checkout_process_ajax&operation=get_load_shipping_info_array&');
	//==============================================================================
}

function Checkout_LoadShippingInfoDropdown_SelectedIndexChanged(dd_box)
{
	// disable the dropdown box
	document.getElementById("match").disabled = 'disabled';
	
	// show the loading message
	document.getElementById("load_shipping_info_status_area").innerHTML = '<img src="images/site_images/processing_small.gif">&nbsp;loading...';
	
	//==============================================================================
	// send the ajax data to the server
	//------------------------------------------------------------------------------
	var ajax_obj = new Class_Ajax();
	ajax_obj.data_obj.match_val = dd_box.options[dd_box.selectedIndex].value;
	ajax_obj.SendRequest('index.php?param=checkout_process_ajax&operation=get_load_shipping_info_array&');
	//==============================================================================
}

function _ajax_handler_Checkout_LoadShippingInfo_Error(error_message)
{
	alert(error_message);
	
	// re-enable the dropdown box
	document.getElementById("match").disabled = '';
	
	// re-enable the submit button (if there is one)
	if(document.getElementById("load_ship_to_button"))
		document.getElementById("load_ship_to_button").disabled = '';
		
	// hide the loading message
	document.getElementById("load_shipping_info_status_area").innerHTML = "";
	
}

function _ajax_handler_Checkout_LoadShippingInfo(load_info_JSON_obj)
{
	//convert JSON string param into object
     var load_info_obj = eval('(' +load_info_JSON_obj+ ')');
	// re-enable the dropdown box
	document.getElementById("match").disabled = '';
	
	// re-enable the submit button (if there is one)
	if(document.getElementById("load_ship_to_button"))
		document.getElementById("load_ship_to_button").disabled = '';
		
	// hide the loading message
	document.getElementById("load_shipping_info_status_area").innerHTML = "";
	
	//auto fill the available fields
	for(field_key in load_info_obj)
	{
	     if(document.getElementById(field_key))
		{
			document.getElementById(field_key).value = load_info_obj[field_key];
		}
	}

}
