function colabs_display_location_meta_box()
{
    global $post, $key;
    ?>
<div>	
	<?php 
    wp_nonce_field(plugin_basename(__FILE__), $key . '_wpnonce', false, true);
    ?>
	
	<div id="geolocation_box">
	
		<?php 
    $geo_address = get_post_meta($post->ID, 'geo_address', true);
    $colabs_geo_latitude = get_post_meta($post->ID, '_colabs_geo_latitude', true);
    $colabs_geo_longitude = get_post_meta($post->ID, '_colabs_geo_longitude', true);
    if (isset($geo_address) && $geo_address != '') {
    } else {
        $geo_address = '';
    }
    if ($colabs_geo_latitude && $colabs_geo_longitude) {
        $colabs_address = colabs_reverse_geocode($colabs_geo_latitude, $colabs_geo_longitude);
        $colabs_address = $colabs_address['address'];
    } else {
        $colabs_address = 'Anywhere';
    }
    ?>
	
		<div>
		<input type="text" class="text" name="colabs_address" id="geolocation-address" autocomplete="off" value="<?php 
    echo $geo_address;
    ?>
" /><label><input id="geolocation-load" type="button" class="button geolocationadd" value="<?php 
    _e('Find', 'colabsthemes');
    ?>
" /></label>
		<input type="hidden" class="text" name="colabs_geo_latitude" id="geolocation-latitude" value="<?php 
    echo $colabs_geo_latitude;
    ?>
" />
		<input type="hidden" class="text" name="colabs_geo_longitude" id="geolocation-longitude" value="<?php 
    echo $colabs_geo_longitude;
    ?>
" />
		</div>

		<div id="map_wrap" style="margin-top:5px; border:solid 2px #ddd;"><div id="geolocation-map" style="width:100%;min-height:200px;" ></div></div>
	
	</div>
	
	<p><strong><?php 
    _e('Current location:', 'colabsthemes');
    ?>
</strong><br/><?php 
    echo $colabs_address;
    if ($colabs_geo_latitude && $colabs_geo_longitude) {
        echo '<br/><em>Latitude:</em> ' . $colabs_geo_latitude;
        echo '<br/><em>Longitude:</em> ' . $colabs_geo_longitude;
    }
    ?>
</p>
</div>	
	<?php 
}
function colabs_child_save_meta_box($post_id)
{
    global $post, $property_details_child, $key;
    //if ( !isset($_POST[ $key . '_wpnonce' ] ) ) return $post_id;
    //if ( !wp_verify_nonce( $_POST[ $key . '_wpnonce' ], 'colabs_property_details_nounce' ) ) return $post_id;
    if (!current_user_can('edit_post', $post_id)) {
        return $post_id;
    }
    if (isset($_POST['action']) && 'editpost' == $_POST['action'] && COLABS_POST_TYPE == $post->post_type) {
        colabs_custom_meta_save_handler($post_id, $property_details_child);
        $attachment_ids = array_filter(explode(',', sanitize_text_field($_POST['property_image_gallery'])));
        update_post_meta($post_id, '_property_image_gallery', implode(',', $attachment_ids));
        update_post_meta($post_id, 'property_unique_key', $_POST['property_unique_key']);
        $property_status = empty($_POST['property-status']) ? 'sale' : sanitize_title(stripslashes($_POST['property-status']));
        wp_set_object_terms($post_id, $property_status, COLABS_TAX_STATUS);
        if ('rent' == $property_status || 'rented' == $property_status) {
            update_post_meta($post_id, 'property_price_periode', $_POST['property_price_periode']);
            update_post_meta($post_id, 'property_price_day_low', $_POST['property_price_day_low']);
            update_post_meta($post_id, 'property_price_day_med', $_POST['property_price_day_med']);
            update_post_meta($post_id, 'property_price_day_high', $_POST['property_price_day_high']);
        }
    }
    // Update location
    if (!empty($_POST['colabs_address'])) {
        $latitude = colabs_clean_coordinate($_POST['colabs_geo_latitude']);
        $longitude = colabs_clean_coordinate($_POST['colabs_geo_longitude']);
        update_post_meta($post_id, '_colabs_geo_latitude', $latitude);
        update_post_meta($post_id, '_colabs_geo_longitude', $longitude);
        if ($latitude && $longitude) {
            $address = colabs_reverse_geocode($latitude, $longitude);
            update_post_meta($post_id, 'geo_address', $address['address']);
            update_post_meta($post_id, 'geo_country', $address['country']);
            update_post_meta($post_id, 'geo_short_address', $address['short_address']);
            update_post_meta($post_id, 'geo_short_address_country', $address['short_address_country']);
            update_post_meta($post_id, 'geo_long_address', $address['long_address']);
        }
    } else {
        // They left the field blank so we assume the property is for 'anywhere'
        delete_post_meta($post_id, '_colabs_geo_latitude');
        delete_post_meta($post_id, '_colabs_geo_longitude');
        delete_post_meta($post_id, 'geo_address');
        delete_post_meta($post_id, 'geo_country');
        delete_post_meta($post_id, 'geo_short_address');
        delete_post_meta($post_id, 'geo_short_address_country');
        delete_post_meta($post_id, 'geo_long_address');
    }
}