{{ header }}

<div id="information-contact" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
    <div id="content" class="{{ class }} contactpage">{{ content_top }}
      <h1>{{ heading_title }}</h1>
     <div id="googleMap" style="width:100%;height:500px;"></div>  
      <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCBtMUBDEpq49tm1g8lcYUSreyya6tQ6-4"></script>

<script>
	google.maps.event.addDomListener(window, 'load', init);
	
	function init() {
		 var locations = [
			['California', 36.7783, 119.4179, 1],
			/*['Coogee Beach', -33.923036, 151.259052, 5],
			['Cronulla Beach', -34.028249, 151.157507, 3],
			['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
			['Maroubra Beach', -33.950198, 151.259302, 4]*/
		  ];
	   
		var mapOptions = {                    
			zoom: 10,
			scrollwheel:false,                  
			center: new google.maps.LatLng(36.7783, 119.4179, 1),                   
		};                
		var mapElement = document.getElementById('googleMap');
		
		var map = new google.maps.Map(mapElement, mapOptions);			    
		 var marker, i;
		
		for (i = 0; i < locations.length; i++) {  
		  marker = new google.maps.Marker({
			position: new google.maps.LatLng(locations[i][1], locations[i][2]),
			map: map
		  });
		infowindow = new google.maps.InfoWindow({content: "New york<?php if ($locations){?><?php foreach ($locations as $location) { ?><?php echo $location['address']; ?><?php } ?><?php } ?>"});
	
		  google.maps.event.addListener(marker, 'click', (function(marker, i) {
			return function() {
			  infowindow.setContent(locations[i][0]);
			  infowindow.open(map, marker);
			}
		  })(marker, i));
		}		
	}
	
</script>      
      

	  
	  <div class="panel panel-default">
        <div class="panel-body">
          <div class="row">
            {% if image %}
            <div class="col-sm-3"><img src="{{ image }}" alt="{{ store }}" title="{{ store }}" class="img-thumbnail" /></div>
            {% endif %}
            <div class="col-sm-3"><h2>{{ store }}</h2><br />
              <address>
              {{ address }}
              </address>
              {% if geocode %}
              <a href="https://maps.google.com/maps?q={{ geocode|url_encode }}&hl={{ geocode_hl }}&t=m&z=15" target="_blank" class="btn btn-info"><i class="fa fa-map-marker"></i> {{ button_map }}</a>
              {% endif %}
            </div>
            <div class="col-sm-3"><h2>{{ text_telephone }}</h2><br>
              {{ telephone }}<br />
              <br />
              {% if fax %}
              <h2>{{ text_fax }}</h2><br>
              {{ fax }}
              {% endif %}
            </div>
            <div class="col-sm-3">
              {% if open %}
              <h2>{{ text_open }}</h2><br />
              {{ open }}<br />
              <br />
              {% endif %}
              {% if comment %}
              <h2>{{ text_comment }}</h2><br />
              {{ comment }}
              {% endif %}
            </div>
          </div>
        </div>
      </div>
      {% if locations %}
      <h3>{{ text_store }}</h3>
      <div class="panel-group" id="accordion">
        {% for location in locations %}
        <div class="panel panel-default">
          <div class="panel-heading">
            <h4 class="panel-title"><a href="#collapse-location{{ location.location_id }}" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion">{{ location.name }} <i class="fa fa-caret-down"></i></a></h4>
          </div>
          <div class="panel-collapse collapse" id="collapse-location{{ location.location_id }}">
            <div class="panel-body">
              <div class="row">
                {% if location.image %}
                <div class="col-sm-3"><img src="{{ location.image }}" alt="{{ location.name }}" title="{{ location.name }}" class="img-thumbnail" /></div>
                {% endif %}
                <div class="col-sm-3"><strong>{{ location.name }}</strong><br />
                  <address>
                  {{ location.address }}
                  </address>
                  {% if location.geocode %}
                  <a href="https://maps.google.com/maps?q={{ location.geocode|url_encode }}&hl={{ geocode_hl }}&t=m&z=15" target="_blank" class="btn btn-info"><i class="fa fa-map-marker"></i> {{ button_map }}</a>
                  {% endif %}
                </div>
                <div class="col-sm-3"> <strong>{{ text_telephone }}</strong><br>
                  {{ location.telephone }}<br />
                  <br />
                  {% if location.fax %}
                  <strong>{{ text_fax }}</strong><br>
                  {{ location.fax }}
                  {% endif %}
                </div>
                <div class="col-sm-3">
                  {% if location.open %}
                  <strong>{{ text_open }}</strong><br />
                  {{ location.open }}<br />
                  <br />
                  {% endif %}
                  {% if location.comment %}
                  <strong>{{ text_comment }}</strong><br />
                  {{ location.comment }}
                  {% endif %}
                </div>
              </div>
            </div>
          </div>
        </div>
        {% endfor %}
      </div>
      {% endif %}
      <form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal">
        <fieldset>
          <legend>{{ text_contact }}</legend>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-name">{{ entry_name }}</label>
            <div class="col-sm-10">
              <input type="text" name="name" value="{{ name }}" id="input-name" class="form-control" />
              {% if error_name %}
              <div class="text-danger">{{ error_name }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-email">{{ entry_email }}</label>
            <div class="col-sm-10">
              <input type="text" name="email" value="{{ email }}" id="input-email" class="form-control" />
              {% if error_email %}
              <div class="text-danger">{{ error_email }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-enquiry">{{ entry_enquiry }}</label>
            <div class="col-sm-10">
              <textarea name="enquiry" rows="10" id="input-enquiry" class="form-control">{{ enquiry }}</textarea>
              {% if error_enquiry %}
              <div class="text-danger">{{ error_enquiry }}</div>
              {% endif %}
            </div>
          </div>
          {{ captcha }}
        </fieldset>
        <div class="buttons">
          <div class="pull-right">
            <input class="btn btn-primary" type="submit" value="{{ button_submit }}" />
          </div>
        </div>
      </form>
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
{{ footer }}
