{% extends "marketplace/base.html" %}

{% load humanize %}

{% block og_title %}{{guide}} - Business Directory{% endblock %}
{% block og_type %}Article{% endblock %}
{% block og_url %}{{guide.get_absolute_url}}{% endblock %}
{% block og_description %}{{guide.description}}{% endblock %}
{% block og_image %}{{guide.logo.url}}{% endblock %}

{% block meta_title %}{{object.web_hed}} | {% for s in object.sites.all %}{% if forloop.first %}{{s.name}}{% endif %}{% endfor %} | Penobscot Bay Press{% endblock %}
{% block meta_keywords %}{% for tag in guide.tags.all %}{{tag}}, {%endfor %}{% endblock %}
{% block meta_description %}{{guide.description}}{% endblock %}
{% block rel-img %}{{guide.logo.url}}{% endblock %}

{% block title %}{{guide}} - Business Directory{% endblock %}

{% block loadtags %}{% for business in businesses %}setupMap{{business.id}}(); {% endfor %}{%endblock%}

{% block content %}
<td colspan="2" align="left" valign="top" bgcolor="white" width="565"> 
                    
<div class="dirservhead" align="center" style="padding-top:0px; margin-top:0px"> 
  <br>
    <div style="float:right">{% if guide.logo %}<img src="{{guide.logo.url}}">{% endif %}</div>
	<div align="left" style="margin-left:25px"><span class="dirservheader" style="color:#333399">{{guide}}</span>
  	<p>{{guide.description}}</p>
  	
	<div align="center">
	{% for e in guide.ve_guides.all %}
		{% if forloop.first %}
		<a href="{% url visitors.views.index %}" class="return">Return to the Seasonal Guide Visitor's Portal</a><br><br>
		{% endif %}
    {% endfor %}
    <a href="{% url marketplace.views.index %}" class="return">Return to the Business Directory</a>
	<hr />
    </div>
    
	{% for business in guide.businesses.all|dictsort:"name" %}
		{% if forloop.first %}
			<div align="left" style="padding-left:20px, margin-bottom:15px">
			<p style="margin:0px; padding:0px"><span class="headline">A sampling of area menus</span></p><br>
		{% endif %}
		<p style="margin:0px; padding:0px; clear:both"><strong>{{business}}</strong></p>
		<p style="float:left; clear:both; margin:0; padding:0 15px 0 0; display:block"><a class="menu" href="{% for menu in business.menu_set.all%}{%if forloop.first %}{%if menu.file%}{{menu.file.url}}{%endif%}{%endif%}{%endfor%}" target="_blank"><img src="{{MEDIA_URL}}images/menus/menu_small.gif" alt="Menu" width="33" height="40" border="0"></a></p>
	<p style="padding-left:10px; margin-left:10px; margin-top:0px; padding-top:0px; display:block">{% if business.point %}{{business.point.address}},{%endif%} {% if business.phone%}{{business.phone|cut:"207-"}}.{%endif%} {% if business.brief_hours %}{{business.brief_hours}} {%endif%} {% if business.url%}<a href="{{business.url}}" target="_blank">{{business.url|cut:"http://"}}</a>{%endif%}</p>
	{% endfor %}
	{% if forloop.last %}{% endif %}
		</div>
	</div>
</div> 
<div class="dirservhead" style="padding-top:0px; margin-top:0px; clear:both"> 
<br>
{% for sub in guide.subcategories.all %}
    <div class="dirservcategory" align="center" style="background-color:#99CCFF; padding-bottom:5px; padding-right:0ps; margin-right:0px; width:98%">
    <span class="dirservheader" id="{{sub.slug}}" style="font-size:32px">Restaurant Guide</span><br>
	<a class="return" href="#top">Return to top</a>
	</div><br>
	
	
{% regroup sub.business_set.all by point.town.name as town_list %}
{% for town in town_list %}
  {% for business in town.list %}
    	{% if forloop.first %}
  			{% if town.grouper %}
  				<div align="center" style="background-color:#CFCFCF; width:98%; clear:both">
  				<h2 style="padding-top:0px; margin-top:0px"><a name="{{town.grouper|cut:" "}}"></a>{{town.grouper}}</h2></div>
  			{% else %}
			<div align="center" style="background-color:#CFCFCF; width:98%; clear:both"><h2 style="padding-top:0px; margin-top:0px">
			<a name="{{town.grouper|cut:" "}}"></a>Service Businesses </h2></div>
  			{% endif %}
    	{% endif %}
	{% ifequal business.status 3 %}
	<div align="left" style="padding-left:15px; width:90%">
        <p style="margin:0px; padding:3px; background-color: #e6f3ff; display: block"><span class="biz_bizname"><a href="{{business.get_absolute_url}}" name="{{business.slug}}">{{business}}</a></span></p>
        <p class="biz_url" style="background-color: #e6f3ff; padding: 0 0 3px 3px">{% if business.url %}{{business.url|cut:"http://"|cut:"/"|urlize}}</p>{% endif %}
		{% load convert_tags typogrify %}
		{% if business.menu_set.all%}
			<a style="float:left; padding:0 10px 5px 0" href="{% for menu in business.menu_set.all%}{%if forloop.first %}{%if menu.file %}{{menu.file.url}}{%endif%}{%endif%}{%endfor%}" target="_blank"><img src="{{MEDIA_URL}}images/menus/menu_large.gif" alt="Menu" align="right" border="0"></a>
		{% endif %}
		{% if business.logo %}
		   <div style="float:right; padding:5px 0 5px 10px">{% thumbnail business.logo "200x200" %}</div>
		{% endif %}
  	    {% if business.brief %}
		<p class="biz_info"><em>{{business.brief|typogrify}}</em></p>
		{% endif %}
		<p class="biz_address">
        	{% if business.po_box %}P.O. Box {{business.po_box}}<br>{% endif %}
  	    	{% if business.point %}{{business.point.address}}{% if business.unit %} - Unit {{business.unit}}{% endif %}<br>
			{% else %}{{business.post_office.point.town}} {{business.post_office.point.zipcode}}<br>{% endif %}
			{% if business.directions %}{{business.directions}}<br>{% endif %}
  	    	{% if business.point %}{{business.point.town}} {{business.point.zipcode}}{% endif %}
		</p>
		<p class="biz_contact">
  	    	{% if business.phone_title %}{{business.phone_title}}: {% endif %}{% if business.phone %}{{business.phone}}{% endif %}
  	    	{% if business.phone_2 %}<span class="bullet_inline_dir">&bull;</span> {% if business.phone_2_title %}{{business.phone_2_title}}: {% endif %}{{business.phone_2 }}{% endif %}
  	    	{% if business.phone_3_title %}<span class="bullet_inline_dir">&bull;</span> {{business.phone_3_title}}: {% endif %}{% if business.phone_3 %}{{business.phone_3}}{% endif %}
			{% if business.mobile_phone %}<span class="bullet_inline_dir">&bull;</span> Mobile: {{business.mobile_phone}}{% endif %}
  	    	{% if business.fax %}<br>Fax: {{business.fax}}{% endif %}
  	    	{% if business.email %}<br><a href="mailto:{{business.email}}">{{business.email}}</a>{% endif %}
		</p>
		{% if business.brief_hours %}
		<p class="biz_hours" style="width:80%">Hours: {{business.brief_hours|typogrify}}</p>
		{% endif %}
     	 {% if business.payment_accepted.all %}
			<ul class="biz_payment_list">
     		{% for payment in business.payment_accepted.all %}<li class="biz_payment_list"><img src="{{MEDIA_URL}}{{payment.icon}}" alt="{{payment}}" title="{{payment}}">
     		</li> 
       		{% endfor %}
       		</ul>
       	{% endif %}
     	 {% if business.facebook %}
     		<div style="float:left; padding: 0 0 10px 20px; background-color:#eeeeee"><iframe src="http://www.facebook.com/plugins/likebox.php?href={{business.facebook}}&amp;width=450&amp;colorscheme=light&amp;show_faces=false&amp;stream=false&amp;header=false&amp;height=70" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:70px;" allowTransparency="true"></iframe></div>
       	{% endif %}
       	{% if business.twitter %}
     		<div style="float:left; padding: 20px 20px 10px 20px; background-color:#eeeeee; height:42px"><a href="{{business.twitter}}"><img src="http://twitter-badges.s3.amazonaws.com/follow_me-a.png" alt="Follow me on Twitter"/></a></div>
       	{% endif %}
    </div>
    <div style="clear:both; padding-top:10px; width:90%"><hr size="1">
    </div>
    {% endifequal %}

	{% ifequal business.status 2 %}
	<div align="left" style="padding-left:15px; width:90%">
        <p style="margin:0px; padding:0px"><span class="biz_bizname"><a name="{{business.slug}}"></a>{{business}}</span></p>
		<p class="biz_url">{% if business.url %}{{business.url|cut:"http://"|cut:"/"|urlize}}</p>{% endif %}
		{% load convert_tags typogrify %}
		{% if business.menu_set.all%}
			<a style="float:left; padding:0 10px 5px 0" href="{% for menu in business.menu_set.all%}{%if forloop.first %}{% if menu.file %}{{menu.file.url}}{%endif%}{%endif%}{%endfor%}" target="_blank"><img src="{{MEDIA_URL}}images/menus/menu_large.gif" alt="Menu" align="right" border="0"></a>
		{% endif %}
		{% if business.logo %}
		   <div style="float:right; padding:5px 0 5px 10px">{% thumbnail business.logo "200x200" %}</div>
		{% endif %}
  	    {% if business.brief %}
		<p class="biz_info"><em>{{business.brief|typogrify}}</em></p>
		{% endif %}
		<p class="biz_address">
        	{% if business.po_box %}P.O. Box {{business.po_box}}<br>{% endif %}
  	    	{% if business.point %}{{business.point.address}}{% if business.unit %} - Unit {{business.unit}}{% endif %}<br>
			{% else %}{{business.post_office.point.town}} {{business.post_office.point.zipcode}}<br>{% endif %}
			{% if business.directions %}{{business.directions}}<br>{% endif %}
  	    	{% if business.point %}{{business.point.town}} {{business.point.zipcode}}{% endif %}
		</p>
		<p class="biz_contact">
  	    	{% if business.phone_title %}{{business.phone_title}}: {% endif %}{% if business.phone %}{{business.phone}}{% endif %}
  	    	{% if business.phone_2 %}<span class="bullet_inline_dir">&bull;</span> {% if business.phone_2_title %}{{business.phone_2_title}}: {% endif %}{{business.phone_2 }}{% endif %}
  	    	{% if business.phone_3_title %}<span class="bullet_inline_dir">&bull;</span> {{business.phone_3_title}}: {% endif %}{% if business.phone_3 %}{{business.phone_3}}{% endif %}
			{% if business.mobile_phone %}<span class="bullet_inline_dir">&bull;</span> Mobile: {{business.mobile_phone}}{% endif %}
  	    	{% if business.fax %}<br>Fax: {{business.fax}}{% endif %}
  	    	{% if business.email %}<br><a href="mailto:{{business.email}}">{{business.email}}</a>{% endif %}
		</p>
		{% if business.brief_hours %}
		<p class="biz_hours" style="width:80%">Hours: {{business.brief_hours|typogrify}}</p>
		{% endif %}
     	 {% if business.payment_accepted.all %}
			<ul class="biz_payment_list">
     		{% for payment in business.payment_accepted.all %}<li class="biz_payment_list"><img src="{{MEDIA_URL}}{{payment.icon}}" alt="{{payment}}" title="{{payment}}">
     		</li> 
       		{% endfor %}
       		</ul>
       	{% endif %}
     	 {% if business.facebook %}
     		<div style="float:left; padding: 0 0 10px 20px; background-color:#eeeeee"><iframe src="http://www.facebook.com/plugins/likebox.php?href={{business.facebook}}&amp;width=450&amp;colorscheme=light&amp;show_faces=false&amp;stream=false&amp;header=false&amp;height=70" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:70px;" allowTransparency="true"></iframe></div>
       	{% endif %}
       	{% if business.twitter %}
     		<div style="float:left; padding: 20px 20px 10px 20px; background-color:#eeeeee; height:42px"><a href="{{business.twitter}}"><img src="http://twitter-badges.s3.amazonaws.com/follow_me-a.png" alt="Follow me on Twitter"/></a></div>
       	{% endif %}
    </div>
    <div style="clear:both; padding-top:10px; width:90%"><hr size="1">
    </div>
    {% endifequal %}

	{% ifequal business.status 1 %}
	<div align="left" style="padding-left:15px; width:90%">
        <p style="margin:0px; padding:0px"><span class="biz_bizname"><a name="{{business.slug}}"></a>{{business}}</span></p>
		<p class="biz_url">{% if business.url %}{{business.url|cut:"http://"|cut:"/"|urlize}}</p>{% endif %}
		{% load convert_tags typogrify %}
  	    {% if business.brief %}
		<p class="biz_info"><em>{{business.brief|typogrify}}</em></p>
		{% endif %}
		<p class="biz_address">
        	{% if business.po_box %}P.O. Box {{business.po_box}}<br>{% endif %}
  	    	{% if business.point %}{{business.point.address}}{% if business.unit %} - Unit {{business.unit}}{% endif %}<br>
			{% else %}{{business.post_office.point.town}} {{business.post_office.point.zipcode}}<br>{% endif %}
			{% if business.directions %}{{business.directions}}<br>{% endif %}
  	    	{% if business.point %}{{business.point.town}} {{business.point.zipcode}}{% endif %}
		</p>
		<p class="biz_contact">
  	    	{% if business.phone_title %}{{business.phone_title}}: {% endif %}{% if business.phone %}{{business.phone}}{% endif %}
  	    	{% if business.phone_2 %}<span class="bullet_inline_dir">&bull;</span> {% if business.phone_2_title %}{{business.phone_2_title}}: {% endif %}{{business.phone_2 }}{% endif %}
  	    	{% if business.phone_3_title %}<span class="bullet_inline_dir">&bull;</span> {{business.phone_3_title}}: {% endif %}{% if business.phone_3 %}{{business.phone_3}}{% endif %}
			{% if business.mobile_phone %}<span class="bullet_inline_dir">&bull;</span> Mobile: {{business.mobile_phone}}{% endif %}
  	    	{% if business.fax %}<br>Fax: {{business.fax}}{% endif %}
  	    	{% if business.email %}<br><a href="mailto:{{business.email}}">{{business.email}}</a>{% endif %}
		</p>
		{% if business.brief_hours %}
		<p class="biz_hours" style="width:80%">Hours: {{business.brief_hours|typogrify}}</p>
		{% endif %}
    </div>
    <div style="clear:both; padding-top:10px; width:90%"><hr size="1">
    </div>
    {% endifequal %}
  {% endfor %}
<br>
{% endfor %}
{% endfor %}

</div>
</td>
{% endblock %}
