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

{% block title %}{{ subcategory }}{% endblock %}

{% block javascript %}
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=333413386678763&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{% endblock %}


{% block content %}
<div style="width:100%; margin:0; padding:0">
	<div class="main_content_left">
    <div class="dirservcategory" align="center" style="background-color:#99CCFF; padding-bottom:5px; padding-right:0ps; margin-right:0px; width:98%"><span class="dirservheader">{{subcategory}}</span>
    <a class="return" href="{% url mk-index %}"><br>Click here to choose another category.</a>
    {% ifequal subcategory.slug 'dining' %}
    <p class="biz_guide"><a href="http://penobscotbaypress.com/directory/guides/cuisine-connection/" alt="PBP Cuisine Connection">Click here to see these listings sorted by town in our Cuisine Connection.</a></p>
    {% endifequal %}
    </div>
    
    <div class="dirservhead" align="center" style="padding-right:0ps; margin-right:0px; width:98%">
    <div align="left">
    {% for biz in businesses|dictsort:"name" %}
    {% ifnotequal biz.status 0 %}
    <div style="float:left"><span class="bullet_inline_dir">&bull;</span><a href="#{{biz.slug}}" class="dirservlinks">{{biz}}</a></div>
    {% endifnotequal %}
    {% endfor %}
    </div>
    <div style="clear:both; padding-top:5px; padding-right:0px; margin-right:0px; width:98%"><hr size="1"></div>
    </div>
    
    {% for biz in businesses|dictsort:"name" %}
    {% ifnotequal biz.status 0 %}
    
	{% ifequal biz.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="{{biz.get_absolute_url}}" name="{{biz.slug}}">{{biz}}</a></span></p>
        <p class="biz_url" style="background-color: #e6f3ff; padding: 0 0 3px 3px">{% if biz.url %}{{biz.url|cut:"http://"|cut:"/"|urlize}}</p>{% endif %}
		{% load convert_tags typogrify %}
		{% if biz.menu_set.all%}
			<a style="float:left; padding:0 10px 5px 0" href="{% for menu in biz.menu_set.all%}{%if forloop.first %}{{menu.file.url}}{%endif%}{%endfor%}" target="_blank"><img src="{{MEDIA_URL}}images/menus/menu_large.gif" alt="Menu" align="right" border="0"></a>
		{% endif %}
		{% if biz.logo %}
		   <div style="float:right; padding:5px 0 5px 10px">{% thumbnail biz.logo "200x200" %}</div>
		{% endif %}
  	    {% if biz.brief %}
		<p class="biz_info"><em>{{biz.brief|typogrify}}</em></p>
		{% endif %}
		<p class="biz_address">
        	{% if biz.po_box %}P.O. Box {{biz.po_box}}<br>{% endif %}
  	    	{% if biz.point %}{{biz.point.address}}{% if biz.unit %} - Unit {{biz.unit}}{% endif %}<br>
			{% else %}{{biz.post_office.point.town}} {{biz.post_office.point.zipcode}}<br>{% endif %}
			{% if biz.directions %}{{biz.directions}}<br>{% endif %}
  	    	{% if biz.point %}{{biz.point.town}} {{biz.point.zipcode}}{% endif %}
		</p>
		<p class="biz_contact">
  	    	{% if biz.phone_title %}{{biz.phone_title}}: {% endif %}{% if biz.phone %}{{biz.phone}}{% endif %}
  	    	{% if biz.phone_2 %}<span class="bullet_inline_dir">&bull;</span> {% if biz.phone_2_title %}{{biz.phone_2_title}}: {% endif %}{{biz.phone_2 }}{% endif %}
  	    	{% if biz.phone_3_title %}<span class="bullet_inline_dir">&bull;</span> {{biz.phone_3_title}}: {% endif %}{% if biz.phone_3 %}{{biz.phone_3}}{% endif %}
			{% if biz.mobile_phone %}<span class="bullet_inline_dir">&bull;</span> Mobile: {{biz.mobile_phone}}{% endif %}
  	    	{% if biz.fax %}<br>Fax: {{biz.fax}}{% endif %}
  	    	{% if biz.email %}<br><a href="mailto:{{biz.email}}">{{biz.email}}</a>{% endif %}
		</p>
		{% if biz.brief_hours %}
		<p class="biz_hours" style="width:80%">Hours: {{biz.brief_hours|typogrify}}</p>
		{% endif %}
     	 {% if biz.payment_accepted.all %}
			<ul class="biz_payment_list">
     		{% for payment in biz.payment_accepted.all %}<li class="biz_payment_list"><img src="{{MEDIA_URL}}{{payment.icon}}" alt="{{payment}}" title="{{payment}}">
     		</li> 
       		{% endfor %}
       		</ul>
       	{% endif %}
     	 {% if biz.facebook %}
     		<div style="float:left; padding: 20px 0px 10px 20px; background-color:#eeeeee">
     		<div class="fb-like-box" data-href="{{biz.facebook}}" data-width="450" data-height="70" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="false" data-show-border="false"></div>
     		</div>
       	{% endif %}
       	{% if biz.twitter %}
     		<div style="float:left; padding: 0px 20px 10px 20px; background-color:#eeeeee; height:35px"><a href="{{biz.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 biz.status 2 %}
	<div align="left" style="padding-left:15px; width:90%">
        <p style="margin:0px; padding:0px"><span class="biz_bizname"><a name="{{biz.slug}}"></a>{{biz}}</span></p>
		<p class="biz_url">{% if biz.url %}{{biz.url|cut:"http://"|cut:"/"|urlize}}</p>{% endif %}
		{% load convert_tags typogrify %}
		{% if biz.menu_set.all%}
			<a style="float:left; padding:0 10px 5px 0" href="{% for menu in biz.menu_set.all%}{%if forloop.first %}{{menu.file.url}}{%endif%}{%endfor%}" target="_blank"><img src="{{MEDIA_URL}}images/menus/menu_large.gif" alt="Menu" align="right" border="0"></a>
		{% endif %}
		{% if biz.logo %}
		   <div style="float:right; padding:5px 0 5px 10px">{% thumbnail biz.logo "200x200" %}</div>
		{% endif %}
  	    {% if biz.brief %}
		<p class="biz_info"><em>{{biz.brief|typogrify}}</em></p>
		{% endif %}
		<p class="biz_address">
        	{% if biz.po_box %}P.O. Box {{biz.po_box}}<br>{% endif %}
  	    	{% if biz.point %}{{biz.point.address}}{% if biz.unit %} - Unit {{biz.unit}}{% endif %}<br>
			{% else %}{{biz.post_office.point.town}} {{biz.post_office.point.zipcode}}<br>{% endif %}
			{% if biz.directions %}{{biz.directions}}<br>{% endif %}
  	    	{% if biz.point %}{{biz.point.town}} {{biz.point.zipcode}}{% endif %}
		</p>
		<p class="biz_contact">
  	    	{% if biz.phone_title %}{{biz.phone_title}}: {% endif %}{% if biz.phone %}{{biz.phone}}{% endif %}
  	    	{% if biz.phone_2 %}<span class="bullet_inline_dir">&bull;</span> {% if biz.phone_2_title %}{{biz.phone_2_title}}: {% endif %}{{biz.phone_2 }}{% endif %}
  	    	{% if biz.phone_3_title %}<span class="bullet_inline_dir">&bull;</span> {{biz.phone_3_title}}: {% endif %}{% if biz.phone_3 %}{{biz.phone_3}}{% endif %}
			{% if biz.mobile_phone %}<span class="bullet_inline_dir">&bull;</span> Mobile: {{biz.mobile_phone}}{% endif %}
  	    	{% if biz.fax %}<br>Fax: {{biz.fax}}{% endif %}
  	    	{% if biz.email %}<br><a href="mailto:{{biz.email}}">{{biz.email}}</a>{% endif %}
		</p>
		{% if biz.brief_hours %}
		<p class="biz_hours" style="width:80%">Hours: {{biz.brief_hours|typogrify}}</p>
		{% endif %}
     	 {% if biz.payment_accepted.all %}
			<ul class="biz_payment_list">
     		{% for payment in biz.payment_accepted.all %}<li class="biz_payment_list"><img src="{{MEDIA_URL}}{{payment.icon}}" alt="{{payment}}" title="{{payment}}">
     		</li> 
       		{% endfor %}
       		</ul>
       	{% endif %}
     	 {% if biz.facebook %}
     		<div style="float:left; padding: 20px 0px 10px 20px; background-color:#eeeeee">
     		<div class="fb-like-box" data-href="{{biz.facebook}}" data-width="450" data-height="70" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="false" data-show-border="false"></div>
     		</div>
       	{% endif %}
       	{% if biz.twitter %}
     		<div style="float:left; padding: 20px 20px 10px 20px; background-color:#eeeeee; height:42px"><a href="{{biz.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 biz.status 1 %}
	<div align="left" style="padding-left:15px; width:90%">
        <p style="margin:0px; padding:0px"><span class="biz_bizname"><a name="{{biz.slug}}"></a>{{biz}}</span></p>
		<p class="biz_url">{% if biz.url %}{{biz.url|cut:"http://"|cut:"/"|urlize}}</p>{% endif %}
		{% load convert_tags typogrify %}
  	    {% if biz.brief %}
		<p class="biz_info"><em>{{biz.brief|typogrify}}</em></p>
		{% endif %}
		<p class="biz_address">
        	{% if biz.po_box %}P.O. Box {{biz.po_box}}<br>{% endif %}
  	    	{% if biz.point %}{{biz.point.address}}{% if biz.unit %} - Unit {{biz.unit}}{% endif %}<br>
			{% else %}{{biz.post_office.point.town}} {{biz.post_office.point.zipcode}}<br>{% endif %}
			{% if biz.directions %}{{biz.directions}}<br>{% endif %}
  	    	{% if biz.point %}{{biz.point.town}} {{biz.point.zipcode}}{% endif %}
		</p>
		<p class="biz_contact">
  	    	{% if biz.phone_title %}{{biz.phone_title}}: {% endif %}{% if biz.phone %}{{biz.phone}}{% endif %}
  	    	{% if biz.phone_2 %}<span class="bullet_inline_dir">&bull;</span> {% if biz.phone_2_title %}{{biz.phone_2_title}}: {% endif %}{{biz.phone_2 }}{% endif %}
  	    	{% if biz.phone_3_title %}<span class="bullet_inline_dir">&bull;</span> {{biz.phone_3_title}}: {% endif %}{% if biz.phone_3 %}{{biz.phone_3}}{% endif %}
			{% if biz.mobile_phone %}<span class="bullet_inline_dir">&bull;</span> Mobile: {{biz.mobile_phone}}{% endif %}
  	    	{% if biz.fax %}<br>Fax: {{biz.fax}}{% endif %}
  	    	{% if biz.email %}<br><a href="mailto:{{biz.email}}">{{biz.email}}</a>{% endif %}
		</p>
		{% if biz.brief_hours %}
		<p class="biz_hours" style="width:80%">Hours: {{biz.brief_hours|typogrify}}</p>
		{% endif %}
    </div>
    <div style="clear:both; padding-top:10px; width:90%"><hr size="1">
    </div>
    {% endifequal %}
    
	{% endifnotequal %}
    {% endfor %}
</div>
	<div class="sidebar_right_media">
		<!-- Google AdSense BEGIN -->
		<div style="clear:both; text-align:center">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Square ad for right of pages -->
			<ins class="adsbygoogle"
			style="display:inline-block;width:250px;height:250px"
			data-ad-client="ca-pub-7616595738812584"
			data-ad-slot="7790117357"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
		<!-- Google AdSense END -->
		<br>
		<!-- Google AdSense BEGIN -->
		<div style="clear:both; text-align:center">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Square ad for right of pages -->
			<ins class="adsbygoogle"
			style="display:inline-block;width:250px;height:250px"
			data-ad-client="ca-pub-7616595738812584"
			data-ad-slot="7790117357"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
		<!-- Google AdSense END -->
	</div>
		<div style="padding:20px; text-align:center; margin-left:auto; margin-right:auto">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Large banner for bottom of pages -->
			<ins class="adsbygoogle"
				 style="display:inline-block;width:728px;height:90px"
				 data-ad-client="ca-pub-7616595738812584"
				 data-ad-slot="1750256958"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>		
		</div>
	</div>
<!-- AddThis Smart Layers BEGIN -->
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=penbaypress#async=1"></script>
<script type="text/javascript">
  addthis.layers({
    'theme' : 'transparent',
    'share' : {
      'position' : 'right',
      'services' : 'facebook,twitter,email,print,gmail,tumblr,more',
    }, 
    'follow' : {
      'services' : [
        {'service': 'facebook', 'id': 'penobscotbaypress'},
        {'service': 'youtube', 'id': 'penobscotbaypress'},
        {'service': 'rss', 'id': 'http://https://penobscotbaypress.com/news/feed.xml'}
      ]
    }   
  });
</script>
<!-- AddThis Smart Layers END -->
{% endblock %}
