{capture name=path}
	<a href="/{l s=${state_slug}}">{l s=${state}}</a>
	<span class="navigation-pipe">{$navigationPipe}</span><span class="navigation_page">{l s={$city}}</span>
{/capture}

<script>
$('#center_column').removeClass('col-sm-9');
</script>

<script type="application/ld+json">
{
    "@context":"http://schema.org",
    "@type":"LocalBusiness",
    "url":"https://www.safetyrestore.com/",
    "@id":"https://www.safetyrestore.com/#organization",
    "name":"Safety Restore",
    "logo":"https://www.safetyrestore.com/img/safety-restore-logo-1520019156.jpg",
    "image":"https://www.safetyrestore.com/img/safety-restore-logo-1520019156.jpg",
    "email":"Service+{str_replace(['Seat Belt Repair in ', ' '], '', $city)}@SafetyRestore.com",
    "priceRange":"$",
    "telephone":"(855) 552-7233",
    "address":{
        "@type":"PostalAddress",
        "streetAddress":"{str_replace(['Seat Belt Repair in '], '', $city)}, {$abbreviation} {$zip_code}"
    },
    "openingHours":[
        "Monday - Friday 9:00AM - 8:00PM, Saturday - Sunday Closed"
    ],

    {$reviews},

    "aggregateRating":{
        "@type":"AggregateRating",
        "ratingValue":5,
        "reviewCount":3
    }
}
</script>

<h1>{$city}</h1>

<p>It doesn’t matter if you’re in {str_replace(['Seat Belt Repair in '], '', $city)} or anywhere in North America because if you need your seat belts repaired for less than half the cost of replacing them, then you can mail in your seat belts to the Safety Restore headquarters and we will have them repaired and shipped back within 24 hours!</p>

<ul style="padding-left: 50px">
    <li>1. Choose and purchase the required seat belt repair service.</li>
    <li>2. Take off and ship us your seat belt(s)</li>
    <li>3. Our certified technicians repair and test your seat belt(s) and ship it back just 24 hours after receiving it!</li>
</ul>

{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
	{if $category->id AND $category->active}
    	{if $scenes1 || $category->description1 || $category->id_image1}
			<div class="content_scene_cat">
            	 {if $scenes}
                 	<div class="content_scene">
                        <!-- Scenes -->
                        {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
                        {if $category->description}
                            <div class="cat_desc rte">
                            {if Tools::strlen($category->description) > 10000}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                    </div>
				{else}
                    <!-- Category image -->
                    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 10000}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
				{/if}
            </div>
		{/if}
		<h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}"><span class="cat-name">SEAT BELT REPAIR SERVICES</span>{include file="$tpl_dir./category-count.tpl"}</h1>
		{if isset($subcategories)}
        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }
		<!-- Subcategories -->
		<div id="subcategories">
			<p class="subcategory-heading">{l s='Subcategories'}</p>
			<ul class="clearfix">
			{foreach from=$subcategories item=subcategory}
				<li>
                	<div class="subcategory-image">
						<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">
						{if $subcategory.id_image}
							<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{else}
							<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{/if}
					</a>
                   	</div>
					<h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5>
					{if $subcategory.description}
						<div class="cat_desc">{$subcategory.description}</div>
					{/if}
				</li>
			{/foreach}
			</ul>
		</div>
        {/if}
		{/if}
		{if $products}
			<div class="content_sortPagiBar clearfix">
            	<div class="sortPagiBar clearfix">
            		{include file="./product-sort.tpl"}
                	{include file="./nbr-product-page.tpl"}
				</div>
                <div class="top-pagination-content clearfix">
                	{include file="./product-compare.tpl"}
					{include file="$tpl_dir./pagination.tpl"}
                </div>
			</div>
			{include file="./product-list.tpl" products=$products}
			<div class="content_sortPagiBar">
				<div class="bottom-pagination-content clearfix">
					{include file="./product-compare.tpl" paginationId='bottom'}
                    {include file="./pagination.tpl" paginationId='bottom'}
				</div>
			</div>
		{/if}
	{elseif $category->id}
		<p class="alert alert-warning">{l s='This category is currently unavailable.'}</p>
	{/if}
{/if}

<style>
.toggle-content {
    display: none;
    height: 0;
    overflow: hidden;
    transition: height 350ms ease-in-out;
}

.toggle-content.is-visible {
    display: block;
    height: auto;
}

.reviews-content .fa-star {
    color: #ff9800;
    font-size: 14px;
}

.reviews-content b {
    margin-bottom: -2px;
    color: #2196F3;
    font-size: 14px;
}

.reviews-content .body {
    font-size: 14px;
    margin-bottom: 5px;
}
</style>

<div class="row">
    <div class="col-sm-6">
        <!--h4>Reviews Widget w/ schema (from their google+ local listings)</h4-->
        <h4>Hours</h4>
        <p>
        Monday - Friday 9:00AM - 8:00PM<br>
        Saturday - Sunday Closed<br>
        </p>

        <h4>Location</h4>
        <iframe style="border: none; width: 100%; height: 150px;" src="https://www.google.com/maps/embed/v1/directions?key=AIzaSyCktSX7TQWES0JzBhhTWy9uWFpLhK3Vtas&avoid=tolls|highways&origin={str_replace(['Seat Belt Repair in '], '', $city)} City&destination={str_replace(['Seat Belt Repair in '], '', $city)}"></iframe>
    </div>

    <div class="col-sm-6">
        <h4>Zip Codes in the {str_replace(['Seat Belt Repair in '], '', $city)} Area</h4>
		<p>{join(',', array_slice(explode(',', $zip_codes), 0, 8))}
        	<span class="toggle-content" id="example">
            	{join(',', array_slice(explode(',', $zip_codes), 8))}
        	</span>
        </p>
        {if count(array_slice(explode(',', $zip_codes), 8))}
		<a class="toggle" href="#example">Show Zip Codes</a>
        {/if}

        <h4>Address</h4>
        <p>{str_replace(['Seat Belt Repair in '], '', $city)}, {$abbreviation} {$zip_code}</p>

        <h4>Payment Accepted</h4>
        <p>Cash, Credit Card, Debit Card, Check</p>

        <h4>Contact</h4>
        <p>P: (855) 552-7233<br>E: Service+{str_replace(['Seat Belt Repair in ', ' '], '', $city)}@SafetyRestore.com</p>
    </div>
</div>

<div class="row reviews-content"></div>

<script>
var reviews = {str_replace('"reviews":', '', $reviews)}; console.log(reviews);

html = '';
$.each(reviews, function(index, item) {
    console.log(item);

    html += '<div class="col-sm-4"><b>' + item.author.name + '</b><div><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i></div><div class="body">' + item.reviewBody + '</div></div>';
});

$('.reviews-content').html('<h4>Reviews</h4><ul>' + html + '</ul>');

</script>

<script>
// Show an element
var show = function (elem) {

    // Get the natural height of the element
    var getHeight = function () {
        elem.style.display = 'block'; // Make it visible
        var height = elem.scrollHeight + 'px'; // Get it's height
        elem.style.display = ''; //  Hide it again
        return height;
    };

    var height = getHeight(); // Get the natural height
    elem.classList.add('is-visible'); // Make the element visible
    elem.style.height = height; // Update the max-height

    // Once the transition is complete, remove the inline max-height so the content can scale responsively
    window.setTimeout(function () {
        elem.style.height = '';
    }, 350);

};

// Hide an element
var hide = function (elem) {

    // Give the element a height to change from
    elem.style.height = elem.scrollHeight + 'px';

    // Set the height back to 0
    window.setTimeout(function () {
        elem.style.height = '0';
    }, 1);

    // When the transition is complete, hide it
    window.setTimeout(function () {
        elem.classList.remove('is-visible');
    }, 350);

};

// Toggle element visibility
var toggle = function (elem, timing) {

    // If the element is visible, hide it
    if (elem.classList.contains('is-visible')) {
        hide(elem);
        return;
    }

    // Otherwise, show it
    show(elem);
};

// Listen for click events
document.addEventListener('click', function (event) {

    // Make sure clicked element is our toggle
    if (!event.target.classList.contains('toggle')) return;

    // Prevent default link behavior
    event.preventDefault();

    // Get the content
    var content = document.querySelector(event.target.hash);
    if (!content) return;

    // Toggle the content
    toggle(content);

}, false);
</script>
