<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
  
    <!-- Basic Page Needs
  ================================================== -->
    
    {% if template == 'index' %}
     <title>{{ shop.name }} | {{ shop.description }}</title>
    {% elsif template == '404' %}
      <title>Page Not Found | {{ shop.name }}</title>
    {% else %}
     <title>{{ page_title }} | {{ shop.name }}</title>
    {% endif %}
    {% assign maxmeta = 155 %}
    {% if template contains 'product' %}
     <meta name="description" content="{{ product.description | strip_html | strip_newlines | truncate: maxmeta | escape }}" />
    {% elsif template contains 'page' %}
      <meta name="description" content="{{ page.content | strip_html | strip_newlines | truncate: maxmeta | escape }}" />
    {% elsif template == 'index' and shop.description != '' %}
      <meta name="description" content="{{ shop.description | strip_html | strip_newlines | truncate: maxmeta | escape}}" />
    {% endif %}
	<link rel="canonical" href="{{ canonical_url }}" />
    

    <!-- Mobile Specific Metas
  ================================================== -->

	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- CSS
  ================================================== -->
  
	{{ 'base.css' | asset_url | stylesheet_tag }}
	{{ '1140.css' | asset_url | stylesheet_tag }}
    {{ 'ie.css' | asset_url | stylesheet_tag }}
	{{ 'layout.css' | asset_url | stylesheet_tag }}
    {{ 'stylesheet.css' | asset_url | stylesheet_tag }}
    {{ 'flexslider.css' | asset_url | stylesheet_tag }}
    
    <!-- Google Web Fonts
  ================================================== -->

    <link href='http://fonts.googleapis.com/css?family=Questrial|Glegoo|Droid+Sans|Lato|Arvo|Playfair+Display|Cutive+Mono|PT+Sans|Poiret+One|PT+Sans+Narrow|Quicksand|Noto+Serif|Lobster|Roboto+Slab:400,300|Noticia+Text|Open+Sans:400,300|Oswald:400,300|Open+Sans+Condensed:300|Raleway|Oxygen|Julius+Sans+One|Lobster+Two|Playball' rel='stylesheet' type='text/css'> 

    <!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
    
    <!-- JS
    
    ================================================= -->
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
  {% if template == 'product' %}
    {{ 'option_selection.js' | asset_url | script_tag }}
  	{{ 'jquery.instagram.js' | asset_url | script_tag }}
	{{ 'jquery.slimbox2.js' | asset_url | script_tag }}
  {% endif %}
    {{ 'css3-mediaqueries.js' | asset_url | script_tag }}
    {{ 'jquery.flexslider.js' | asset_url | script_tag }}
    {{ 'jquery.easing.1.3.js | asset_url | script_tag }}
    {{ 'theme.js' | asset_url | script_tag }}
    {{ 'select.js' | asset_url | script_tag }}

  
    <!--[if (gte IE 6)&(lte IE 8)]>
    {{ 'selectivizr-min.js' | asset_url | script_tag }}
    <![endif]-->   
    
    {{ content_for_header }}
    
    {% if template contains 'customers' %}
    {{ "shopify_common.js" | shopify_asset_url | script_tag }}
    {{ "customer_area.js"  | shopify_asset_url | script_tag }}
    {% endif %}

    <!-- Favicon
	================================================== -->
    
	<link rel="shortcut icon" href="{{ 'favicon.png' | asset_url }}">

</head>
<body>

<div id="toppanel">
    {% include 'login' %}
</div>
<div id="top-bar" class="container">
    <div class="row">
    	<div class="twelvecol">
			<ul id="top-bar-left" class="sixcol">
                {% if settings.show_multiple_currencies %}
                <li style="float: left">{% include 'currencies-switcher' %}</li>
                {% endif %} 
            </ul>
                <ul id="cart" class="sixcol last">
                {% if shop.customer_accounts_enabled %}
                <li id="toggle">       
                    {% if customer  %}
                    Welcome back {{ customer.first_name }}!&nbsp;&nbsp;
                    <a href="/account">View Your Account</a>
                    &nbsp; or &nbsp;
                     {{ "Logout" | customer_logout_link }} 
                    {% else %}
                    <a id="open" class="open" href="#">Sign in or Create an account</a> <a id="close" style="display: none;" class="close" href="#">Close</a>
                    {% endif %}
                </li>
                {% endif %}
                <li>
                    <a href="/cart">View Cart: ({{ cart.item_count }})</a>
                </li>
            </ul>
		</div>
    </div>
</div>

<header id class="container">
    <div class="row">
        <div id="logo" class="tencol">
          {% if settings.use_logo_image %}
          <a href="{{ shop.url }}"><img src="{{ 'logo.png' | asset_url }}" alt="{{ shop.name }}" style="border: 0;"/></a>
          {% else %}
          <a href="{{ shop.url }}">{{ shop.name }}</a>
          {% endif %}       
		</div>
        <div id="search" class="twocol last">
            <form action="/search" method="get">
                <input type="hidden" name="type" value="product" />
                <input type="text" name="q" id="q" class="search-field" placeholder="search..." />
                <input type="image" src="{{ 'btn-search.png' | asset_url }}" class="search-button" name="search-button" id="seek" />
            </form>
        </div>
    </div>
</header>

<div id="main-nav" class="container">
    <div class="row pad">
        <div id="navigation" class="twelvecol">
            <nav class="primary">
               <ul id="nav">
                {% for link in linklists.main-menu.links %}
                   <li>{{ link.title | link_to: link.url }}
                        {% capture child_list_handle %}{{ link.title | handleize }}{% endcapture %}
                        {% if linklists[child_list_handle] and linklists[child_list_handle].links.size > 0 %}
                            <div class="arrow-down"></div>
                                <ul>
                                    <div class="arrow-up"></div>
                                  {% for l in linklists[child_list_handle].links %}
                                  <li{% if forloop.first %} class="first"{% elsif forloop.last %} class="last"{% endif %}><a href="{{ l.url }}">{{ l.title }}</a></li>
                                  {% endfor %}
                                </ul>
                        {% endif %}
                   </li>
                {% endfor %}
                </ul>
            </nav>
		</div>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function() {

    //build dropdown
    $("<select />").appendTo("#navigation nav");
    
    // Create default option "Go to..."
    $("<option />", {
       "selected": "selected",
       "value"   : "",
	   "text"    : "Go to..."
	}).appendTo("nav select");	
	
	// Populate dropdowns with the first menu items
	$("ul#nav li a").each(function() {
	 	var el = $(this);
	 	$("<option />", {
	     	"value"   : el.attr("href"),
	    	"text"    : el.text()
	 	}).appendTo("nav select");
	});
	
	//make responsive dropdown menu actually work			
  	$("nav select").change(function() {
    	window.location = $(this).find("option:selected").val();
  	});

});	
</script>  

{% if template == 'index' %}
    {{ content_for_layout }}
    {% else %}
    <div class="container">
        <div class="pad row">
            <div id="content" class="twelvecol">
            {% if template == 'list-collections' %}
                {% include 'collection-listing' %}
            {% else %}
                {{ content_for_layout }}
            {% endif %}
    		</div>
        </div>
    </div>
{% endif %}
 
  
  
{% if template == 'product' %}
	{% if settings.instagram-feed == 'product-handle' %}  
      
  	<script type="text/javascript">
      // Instagram Extension 
      
      $(document).ready(function() {
          $(".instagram").instagram({
            hash: '{{ product.handle }}',
           show: '12',
          clientId: '200fb5a135824752a3da78fe0dc71879'
          });
         
          });
          
          $(window).load(function () {
          $('div.instagram-placeholder').each( function(i) {
          if( i % 4 != 3 )
          return
          $(this).addClass('last')
          })
      });
    </script>
    
    <div id="instagram-feed" class="container">
        <div class="pad row">	
            <div class="twelvecol">
              <h4>{{ settings.instagram-label }} #{{ product.handle }}</h4>
                <div class="instagram"></div>
            </div>
        </div>
    </div>
  
  	{% elsif settings.instagram-feed == 'user' %}
  
      <script type="text/javascript">
    // Instagram Extension 
    
    $(document).ready(function() {
        $(".instagram").instagram({
          hash: '{{ settings.hashtag }}',
         show: '12',
        clientId: '200fb5a135824752a3da78fe0dc71879'
        });
       
        });
        
        $(window).load(function () {
        $('div.instagram-placeholder').each( function(i) {
        if( i % 4 != 3 )
        return
        $(this).addClass('last')
        })
    });
    </script>
    
    <div id="instagram-feed" class="container">
        <div class="pad row">	
            <div class="twelvecol">
              <h4>{{ settings.instagram-label }} #{{ settings.hashtag }}</h4>
                <div class="instagram"></div>
            </div>
        </div>
    </div>  
  
  	{% else %}
  	{% endif %}
{% endif %}  


<div id="social-icons" class="container">
    <div class="row">
        <div id="icons" class="twelvecol">
                {% if settings.show_facebook %}<a href="{{ settings.facebook_url }}" target="_blank"><img src="{{ 'facebook.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_twitter %}<a href="http://www.twitter.com/{{ settings.twittername }}" target="_blank"><img src="{{ 'twitter.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_pinterest %} <a href="{{ settings.pinterest_url }}" target="_blank"><img src="{{ 'pinterest.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_tumblr %} <a href="{{ settings.tumblr_url }}" target="_blank"><img src="{{ 'tumblr.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_flickr %} <a href="{{ settings.flickr_url }}" target="_blank"><img src="{{ 'flickr.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_youtube %} <a href="{{ settings.youtube_url }}" target="_blank"><img src="{{ 'youtube.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_googleplus %} <a href="{{ settings.googleplus_url }}" target="_blank"><img src="{{ 'googleplus.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_vimeo %} <a href="{{ settings.vimeo_url }}" target="_blank"><img src="{{ 'vimeo.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_rss %} <a href="{{ shop.url }}/blogs/news.atom" target="_blank"><img src="{{ 'rss.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_lastfm %} <a href="{{ settings.lastfm_url }}" target="_blank"><img src="{{ 'lastfm.png' | asset_url }}"></a>{% endif %}
                {% if settings.show_instagram %} <a href="{{ settings.instagram_url }}" target="_blank"><img src="{{ 'instagram.png' | asset_url }}"></a>{% endif %}
		</div>
    </div>
</div>

<div class="clear"></div>

<div id="footer" class="container">
    <div class="row">
        <div class="twelvecol">
             <ul id="footer-links">
                {% for link in linklists.footer.links %}
                    <li>{{ link.title | link_to: link.url }}</li>
                {% endfor %}
             </ul>
         <p>
            {% if settings.american_express %}<img src="{{ 'amex.png' | asset_url }}"/>{% endif %}
            {% if settings.dankort %}<img src="{{ 'dankort.png' | asset_url }}"/>{% endif %}
            {% if settings.diners %}<img src="{{ 'diners.png' | asset_url }}"/>{% endif %}
            {% if settings.discover %}<img src="{{ 'discover.png' | asset_url }}"/>{% endif %}
            {% if settings.forbru %}<img src="{{ 'forbru.png' | asset_url }}"/>{% endif %}
            {% if settings.google %}<img src="{{ 'googlecheckout.png' | asset_url }}">{% endif %}
            {% if settings.jcb %}<img src="{{ 'jcb.png' | asset_url }}">{% endif %}
            {% if settings.maestro %}<img src="{{ 'maestro.png' | asset_url }}"/>{% endif %}
            {% if settings.mastercard %}<img src="{{ 'mastercard.png' | asset_url }}"/>{% endif %}
            {% if settings.paypal %}<img src="{{ 'paypa.png' | asset_url }}"/>{% endif %}  
            {% if settings.solo %}<img src="{{ 'solo.png' | asset_url }}"/>{% endif %}  
            {% if settings.visa %}<img src="{{ 'visa.png' | asset_url }}"/>{% endif %}
        </p>
        <p>{{ powered_by_link }}  {% if settings.credit %}<a href="http://www.undergroundmedia.co.uk"> Shopify Theme</a> by Underground Media{% endif %}</p>
		</div>
    </div>
</div>
{% include 'currencies' %}
</body>
</html>