{% extends "base.html" %}
{% block title %} {{ business }} -{% endblock %}
{% block loadtags %}setupMap();" onunload="GUnload();"{% endblock %}
{% block javascript %}
<link rel="stylesheet" href="{{MEDIA_URL}}css/new_styles.css" type="text/css" />
<link href="{{MEDIA_URL}}css/business_directory.css" rel="stylesheet" type="text/css">
<script src="http://maps.google.com/maps?file=api&v=2&key={{gmaps_api_key}}" type="text/javascript"></script>
<script src="http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/src/markermanager.js"></script>

    <script type="text/javascript">
        var map = null;
        function setupMap() {
                if (GBrowserIsCompatible()) {
                 var point = new GLatLng({{business.point.lat_lon}});
                  map = new GMap2(document.getElementById("map-canvas"));
                  map.setCenter(point, 12);
                 map.setUIToDefault(); 
                         map.addOverlay(new GMarker(point));
                }
      }
   </script>
{% endblock %}

{% block content %}
<td colspan="2" align="left" valign="top" bgcolor="#FFFFFF" width="565">


<div class="business_header">                    
{% load convert_tags %}
	{% if business.logo %}
	<div class="businesslogo">{% thumbnail business.logo.url "150" %}</div>
	{% endif%}
	<div class="businessname">
		<span class="businesshead">{{business}}</span>
		{% if business.url %}
		<a href="{{business.url}}" target="_blank" class="website"><br>
	  	{{business.url|cut:"http://www."|cut:"/"}}</a><br>
	 {% endif %}<br>
    {% if menus %}
    {% for menu in menus %}
	{% if menu.sample %}
    <p class="menu"><a href="{{menu.file.url}}" alt="{{business}} menu"><img border=0 src="{{MEDIA_URL}}images/menus/menu_small.gif" target="_blank" alt="Menu"/></a></p>
	{% endif %}
    {% endfor %}
    {% endif %}
     <span class="tagline">{{business.brief}}</span>
</div>
	<ul class="info" >
	{% if business.po_box %}<li>P.O.Box {{business.po_box}}</li>{% endif %}
	{% if business.point %}<li>{{business.point.address}}<br>{{business.point.town}}&nbsp;{{business.point.zipcode }}</li>{% endif %}
	{% if business.phone %}<li><em>{{business.phone_title}}</em> {{business.phone}}</li>{% endif %}
	{% if business.phone_2%}<li><em>{{business.phone_2_title}}</em> {{business.phone_2}}</li>{% endif %}
	{% if business.phone_3 %}<li><em>{{business.phone_3_title}}</em> {{business.phone_3}}</li>{% endif %}
	{% if business.mobile_phone %}<li><em>Mobile phone</em> {{business.mobile_phone}}</li>{% endif %}
	{% if business.fax %}<li><em>Fax</em> {{business.fax}}</li>{% endif %}
	{% if business.email %}<li>{{business.email|urlize}}</li>{% endif %}
     </ul>
      {% if business.payment_accepted.all %}
     <ul class="payment_list"> 
      <b>Payment methods accepted:</b><br>
       {% for payment in business.payment_accepted.all %}
	<li><img src="{{MEDIA_URL}}{{payment.icon}}" alt="{{payment}}" title="{{payment}}"></li> 
       {% endfor %}    
     </ul> 
          {% endif %}
</div>


<div class="businessdetails">
<h3>Hours:</h3>
     {% if hours %}
	{% for h in hours %}
        <div class="hours"> 
        <h5 class="table on last">{% if h.title %}{{h.title}}{%else%}Business{%endif%} </h5>
	     <table class="place_hours"> 
                <tr> 	
                  <th class="day">Monday</th> 
		  {% if h.mon_open %}
                    <td class="open_time">{{h.mon_open|time:"f a"}} &mdash;</td>
		    {% if h.mon_close %}<td class="close_time">{{h.mon_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.mon_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}
                </tr> 
		<tr>
                  <th class="day">Tuesday</th> 
		  {% if h.tue_open %}
                    <td class="open_time">{{h.tue_open|time:"f a"}} &mdash;</td>
		    {% if h.tue_close %}<td class="close_time">{{h.tue_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.tue_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}
		</tr>
		<tr>
                  <th class="day">Wednesday</th> 
		  {% if h.wed_open %}
                    <td class="open_time">{{h.wed_open|time:"f a"}} &mdash;</td>
		    {% if h.wed_close %}<td class="close_time">{{h.wed_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.wed_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}
		</tr>
		<tr>
                  <th class="day">Thursday</th> 
		  {% if h.thu_open %}
                    <td class="open_time">{{h.thu_open|time:"f a"}} &mdash;</td>
		    {% if h.thu_close %}<td class="close_time">{{h.thu_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.thu_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}
		</tr>
		<tr>
                  <th class="day">Friday</th> 
		  {% if h.fri_open %}
                    <td class="open_time">{{h.fri_open|time:"f a"}} &mdash;</td>
		    {% if h.fri_close %}<td class="close_time">{{h.fri_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.fri_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}
		</tr>
		<tr>
                  <th class="day">Saturday</th> 
		  {% if h.sat_open %}
                    <td class="open_time">{{h.sat_open|time:"f a"}} &mdash;</td>
		    {% if h.sat_close %}<td class="close_time">{{h.sat_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.sat_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}
		</tr>
		<tr>
                  <th class="day">Sunday</th> 
		  {% if h.sun_open %}
                    <td class="open_time">{{h.sun_open|time:"f a"}} &mdash;</td>
		    {% if h.sun_close %}<td class="close_time">{{h.sun_close|time:"f a"}}</td>{% endif%}
	 	  {% else %}{% if h.sun_by_appt %}
		    <td class="by_appt" colspan=2>By Appointment</td>
		  {% else %}
		    <td class="closed" colspan=2>Closed</td>
	  	  {% endif %}
	  	  {% endif %}

		</tr>
		{% if h.additional %}
		<tr><p>{{h.additional}}</p></tr>
		{% endif %}
              </table> 
	</div>
	{% endfor %}
	{% else %}
	<p>No hours available</p> 
	{% endif %}<br>
          <div><h3>Features:</h3></div>
      <ul class="featurelist">
         {% for f in business.features.all %}
 	    <li class="featurelist">{{f}}</li>
	 {% empty %}
 <p>No features available</p>
	  {% endfor %}
      </ul>
<h3>Directions:</h3>
      <div>
         {% if business.point %}
         <div id="map-canvas" style="width: 250px; height: 200px; margin:5px;"></div>
         {% endif %}
 	 {% if business.directions %}
	 <p class="directions">{{business.directions}}</p>
  	 {% endif %}
</div>
	 {% if business.point %}
	 <div class="map-buttons">
        <p>Choose a site to get complete directions:</p>
   <ul>
       <li><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={{business.point.lat_lon}}&ie=UTF8&t=h&z=17" target="_blank">
       <img src="{{MEDIA_URL}}images/maps/google_maps_icon.gif" alt="Get directions from Google Maps" width="50px" height="50px"/></a></li>
	   <li><a href="http://maps.yahoo.com/#mvt=m&lat={{latitude}}&lon={{longitude}}&zoom=16&q1={{business.point.address|iriencode}}%20{{business.point.town|iriencode}}%20{{business.point.zipcode}}" target="_blank">
       <img src="{{MEDIA_URL}}images/maps/yahoo.gif" alt="Get directions from Yahoo! Local" width="50px" height="50px"/></a></li>
	   <li><a href="http://www.bing.com/maps/?v=2&where1={{business.point.address|iriencode}}%20{{business.point.town|iriencode}}%20{{business.point.zipcode}}&encType=1" target="_blank">
       <img src="{{MEDIA_URL}}images/maps/Bing-Icon.jpeg" alt="Get directions from Bing!" width="50px" height="50px"/></a></li>
	 </ul>
	 {% endif %}
      </div>
</div>
<div class="business_photos">  
  <h4 style="padding-top:0px; margin-top:0px"><br>
  {% if business.businessphoto_set.all %}
  {% for photo in business.businessphoto_set.all %}
    {% thumbnail photo.photo "250" %}<br>
    {{photo.caption}} &nbsp;<br>
  {% endfor %}
  {% endif %}
  <br></h4>
</div>

<div class="writeupdiv" align="left">
<div class="writeup_copy">
  {% load markup typogrify %}
  {{business.description|typogrify|markdown|urlize}}
  <p><span class="writeup_copy"><a class="return" href="{% url mk-index %}">Return to Business Directory</a></span> </p>
  <hr size="1"></div>
</div>
</div>

</td>


{% endblock %}
