
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(	shipping_company_name,
										shipping_first_name,
										shipping_last_name,
										shipping_address1,
										shipping_address2,
										shipping_city,
										shipping_state,
										shipping_zip,
										shipping_country,
										shipping_phone_number,
										shipping_phone_ext,
										shipping_fax_number,
										shipping_fax_ext)
{
	// 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 = "";

	//=======================================================================================================================================
	// set the values of the input boxes
	//---------------------------------------------------------------------------------------------------------------------------------------
	if(document.getElementById("shipping_company_name")){document.getElementById("shipping_company_name").value = shipping_company_name	;}
	if(document.getElementById("shipping_first_name"	)){document.getElementById("shipping_first_name"	).value = shipping_first_name		;}
	if(document.getElementById("shipping_last_name"	)){document.getElementById("shipping_last_name"	).value = shipping_last_name		;}
	if(document.getElementById("shipping_address1"	)){document.getElementById("shipping_address1"	).value = shipping_address1		;}
	if(document.getElementById("shipping_address2"	)){document.getElementById("shipping_address2"	).value = shipping_address2		;}
	if(document.getElementById("shipping_city"		)){document.getElementById("shipping_city"		).value = shipping_city			;}
	if(document.getElementById("shipping_state"		)){document.getElementById("shipping_state"		).value = shipping_state			;}
	if(document.getElementById("shipping_zip"		)){document.getElementById("shipping_zip"		).value = shipping_zip			;}
	if(document.getElementById("shipping_phone_number")){document.getElementById("shipping_phone_number").value = shipping_phone_number	;}
	if(document.getElementById("shipping_phone_ext"	)){document.getElementById("shipping_phone_ext"	).value = shipping_phone_ext		;}
	if(document.getElementById("shipping_fax_number"	)){document.getElementById("shipping_fax_number"	).value = shipping_fax_number		;}
	if(document.getElementById("shipping_fax_ext"	)){document.getElementById("shipping_fax_ext"	).value = shipping_fax_ext		;}
	//=======================================================================================================================================
}