<?php
	$bill_map_url 	= 'http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q='.urlencode($rdata['Bill_Street']).','.urlencode($rdata['Bill_City']).','.urlencode($rdata['Bill_State_Abbreviation']).','.urlencode($rdata['Bill_Postal_Code']).','.urldecode($rdata['Bill_Country_Name']).'&amp;z=13';
	$ship_map_url 	= 'http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q='.urlencode($rdata['Ship_Street']).','.urlencode($rdata['Ship_City']).','.urlencode($rdata['Ship_State_Abbreviation']).','.urlencode($rdata['Ship_Postal_Code']).','.urldecode($rdata['Ship_Country_Name']).'&amp;z=13';
	$maps_same 		= $bill_map_url == $ship_map_url;
	$and_shipping	= $maps_same ? 'and Shipping ' : '';

if ($SC['settings']['CP_Maps_Enabled'] == 1) {
?>
<div class="google_map">
	<h2>Billing <?php print $and_shipping?>Address Location</h2>
	<iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php print $bill_map_url ?>&amp;output=embed"></iframe><br />
	<a class="larger_map" href="<?php print $bill_map_url ?>">View Larger Map</a>
	
	<?php if (!$maps_same && !empty($rdata['Ship_Postal_Code'])):?>
		<h2>Shipping Address Location</h2>
		<iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php print $ship_map_url ?>&amp;output=embed"></iframe><br />
		<a class="larger_map" href="<?php print $ship_map_url ?>">View Larger Map</a>
	<?php endif; ?>
</div>
<?php } ?>