<?php
// Google Maps Mod
// by
// TLM <the_lost_minded@yahoo.com>

function template_map() {
	global $context, $modSettings, $scripturl, $txt, $settings;

	if ($modSettings['googleMapsEnable']) {
echo '<div class="tborder" style="margin-top: 1ex;">
		<div id="googlemap" class="titlebg" style="padding: 4px;">Member Map</div>
		<div id="googlemapmain" class="windowbg2">
	<table width="100%">
    <tr>
		<td class="windowbg2" colspan="2" valign="middle" align="center">
            <table>
                <tr>
                    <td colspan="2" align="center">
                        <table><tr><td align="center">
                            <div id="map" style="width: 700px; height: 500px; color: #000000;"></div>
                        </td>';
if ($modSettings['googleSidebar'] == 1)
echo '
                        <td align="center">
                            <div id="sidebar" class="googleMapsSidebar" align="left"></div>
                        </td>';
if ($modSettings['googleSidebar'] == 2)
echo '
                        </tr><tr>
                        <td align="center">
                            <div id="sidebar" class="googleMapsLegend" align="left"></div>
                        </td>';
echo '
                        </tr></table>
                        <script src="http://maps.google.com/maps?file=api&v=1&key=', $modSettings['googleMapsKey'], '" type="text/javascript"></script>
                        <script type="text/javascript" language="JavaScript" src="', $settings['default_theme_url'], '/Clusterer.js"></script>
                        <script type="text/javascript" language="JavaScript" src="', $scripturl, '?action=googlemap;sa=.js"></script>
                    </td>';
if ($modSettings['googleMapsEnableLegend']) {
echo '
                </tr><tr>
                    <td colspan="2" align="center" class="googleMapsLegend">
                        <table><tr>';
if (!$modSettings['googleMapsPinGender'])
    echo '
                    <td><img src="http://labs.google.com/ridefinder/images/mm_20_green.png">', $txt['googleMapGreenPinGD'], '</td>';
else
    echo '
                        <td><img src="http://labs.google.com/ridefinder/images/mm_20_green.png">', $txt['googleMapGreenPinNG'], '</td>
                        <td><img src="http://labs.google.com/ridefinder/images/mm_20_blue.png">', $txt['googleMapBluePin'], '</td>
                        <td><img src="http://labs.google.com/ridefinder/images/mm_20_red.png">', $txt['googleMapRedPin'], '</td>';
if ($modSettings['googleMapsEnableClusterer'])
echo '
                        <td><img src="http://labs.google.com/ridefinder/images/mm_20_purple.png">', $txt['googleMapPurplePin'], '</td>';
echo '
                        </tr></table>
                    </td>';
}
echo '
                </tr><tr>
                    <td align="left">';
if (allowedTo('googleMap_place'))
    echo $txt['googleMapAddPinNote'];
echo '
                    </td><td align="right">
                        <a href="', $scripturl, '?action=.kml"><img src="', $settings['default_theme_url'], '/images/google_earth_feed.gif" border="0" /></a>
                    </td>
                </tr>
            </table>
        </td>
	</tr></table>
        </div>
    </div>';
    }
}

?>
