_layout_shops.tpl 4.38 KB
{include file="include/head.tpl"}

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;hl=ru&amp;key=AIzaSyAWmuiRg7hXwlz103RrhF6qDapx0l42dEM"

      type="text/javascript" charset="utf-8"></script>

{literal}
<script type="text/javascript">
$(document).ready(function(){
var geocoder;
var map;
var addresses = new Array();
var names = new Array("<img src='/img/map_t.png' />");
var counter=0;
var maker_view=0;
{/literal}
{section name=i loop=$shops}
addresses[{$smarty.section.i.index}] = "{$shops[i].adress|escape:'html'}";
{/section}
{literal}

                                function load()
                                {
                                     // Create new map object
                                     map = new GMap2(document.getElementById("map"));

                                     // Create new geocoding object
                                     geocoder = new GClientGeocoder();

                                    // Retrieve location information, pass it to addToMap()
                                   for (i=0; i < addresses.length; i++)
                                      geocoder.getLocations(addresses[i], addToMap);
                                }

                              function createMarker(point,html)
                              {
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "/img/map_t.png";
blueIcon.iconSize = new GSize(35, 51);                
markerOptions = { icon:blueIcon };
                                  var marker = new GMarker(point,markerOptions);
                                           GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml(html);});
										  // $(document).ready(function(){
										  // $(".map_link").click(function() {alert($(".map_link").attr("title"););marker.openInfoWindowHtml(html);});
										  // });
										 
										  
	//$("#map_link"+counter).click(function() { 
	//	marker.openInfoWindowHtml(html);
	//	return false;
	//}); 


                                  return marker;
                              }

                                // This function adds the point to the map

                                function addToMap(response)
                                {
                                // Retrieve the object

                                place = response.Placemark[0];
                                point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);

                                htmlText=addresses[counter];

                                // Create a marker
                               marker=createMarker(point, htmlText);
                               map.addOverlay(marker);
                               //marker.openInfoWindowHtml(htmlText);

                           
                                 map.setCenter(point, 12);
                                map.addControl(new GSmallMapControl());
                                map.addControl(new GMapTypeControl());
                               

                              counter++;
                              }
							  
load();						  
});
</script>		
{/literal}

{include file="include/header.tpl"}

<div class="container">

<h1 class="h1_3">Äèëåðû è äèñòðèáüþòîðû</h1>
<div class="map_box">
<div id="map" class="map" style="width: 920px; height: 500px;margin-top:5px;"></div>
<div class="menu_brend">
<ul>
{section name=i loop=$brends}
<li {if $smarty.section.i.index eq count($brends)-1}class="n"{/if}><a href="{$url_lang}/shops/index/{$brends[i].translit}/" title="{$brends[i].name}" id="map_link{$smarty.section.i.index}"><img src="{$config->url}/pics/brends/{$brends[i].pic}" alt="{$brends[i].name}" /></a></li>
{/section}
</ul><div class="both"></div>
</div>
</div>


</div>


<div class="layout2">
<div class="container">
{section name=i loop=$shops}
	<div class="item_adress">
		<img src="{$config->url}/pics/shops/{$shops[i].pic}" class="fl" />
		<div class="fr">{section name=j loop=$shops[i].stars}<img src="{$config->url}/img/stars/star{$shops[i].stars[j].brend_id}.png" width="18" height="18" hspace="3" />{/section}</div>
		<div class="adress">
		{$shops[i].name}<br />{$shops[i].contacts}<br />{$shops[i].adress} <a href="http://{$shops[i].url}">{$shops[i].url}</a>
		</div><div class="both"></div>
	</div>
{/section}	
</div>
</div>

<div class="container">	
{include file="include/fotter.tpl"}

</div>
		
{include file="include/head_end.tpl"}