<script type="text/template" id="tmpl-popup">
    <!-- <style type="text/css">
      .a_modal-dialog{overflow:hidden;}
    </style> -->   
    <div class="_p30">
      <div class="a_scroll_head">
               <p class="title_popupitem item_title"><%=item_name%></p>
               <p class="txt_popupitemdes item_desc"><%=item_desc%></p>               
               <% var item_price_id = prices[0].id,
                item_price_value = prices[0].value,
                item_price_desc= prices[0].desc; 
            if(prices.length == 1){ %>
                  <p class="txt_popupitemprice item_price">$<%=prices[0].value%> <% if(_.first(prices)['desc']) %> <span class="capitalize _fs12">(<%= _.first(prices)['desc'] %>)</span></p>
                <% } else { %>
                <div>
                <select class="price-select y_price_select">
                    <%                                   
                    if(price_id) {                        
                        item_price_id =price_id,
                        item_price_value = item_price,
                        item_price_desc= price_desc ;
                    }
                  _.each(prices,function(price){                         
                    var selected = "";                
                    if(price_id && parseInt(price['id'],10) == parseInt(price_id,10)) {
                        selected="selected";
                    } %>
                    <option
                    <%= selected %> value="<%= price['id']+'-'+price['value']+'-'+price['desc']%>">$<%= price['value'] %> <%= !_.isEmpty(price['desc'])? "( "+price['desc']+" )":"" %></option>
                    <% }) %>
                </select>
                <p class="_fs11">Multiple sizes available at different prices.</p>
                </div>
                <% } %>       
               </div>
               <div class="a_scroll a_area">  
                <% if(item_image_url !==''){%>
                 <img src="<%=App.imagePath+item_image_url%>" alt="<%=item_name%>" class="img-responsive">
                 <%}%>

                <div class="addons">
                  <p class="txt_addonq">Choose Your Protein For Chimichanga (Choose any one)</p>
                  <div class="row txt_addonradio">
                     <div class="col-md-6">
                        <label class="custom_radio">
                           <input type="radio" name="q" value="male" checked>
                           <span class="control_indicator"></span>
                           Barbacoa Beef
                           <p class="_fs11 txt_addondes">Slow cooked short rib.</p>
                        </label>
                     </div>
                     <div class="col-md-6">
                        <label class="custom_radio">
                           <input type="radio" name="q" value="male" checked>
                           <span class="control_indicator"></span>
                           Barbacoa Beef
                           <p class="_fs11 txt_addondes">Slow cooked short rib.</p>
                        </label>
                     </div>
                  </div>
               </div>
               <div class="txt_popupinstructions">
                  <p>Special Instructions</p>
                  <em>Eg. Sauce on the side? allergic to nuts? no tomatoes? Tell us here.
                  <span>And remember to inform the restaurant of all dietary restrictions and food allergies in the box below.</span></em>
               </div>               
                <textarea class="menu_special_instruction_item special_instruction"  placeholder="Special Instructions" maxlength="255" rows="4"><%= special_instruction %></textarea>
                <p class="txt_word_count" style="visibility: hidden;">&nbsp;</p>
                </div>
                <div class="short-addons truncate-text y_short_addons"></div>
               <div class="row addonpopup_footer">
                <input type="hidden" id="uid" value="<%=uid%>">
                <input type="hidden" id="item_id" value="<%=item_id%>">
                <input type="hidden" id="price_id" value="<%=item_price_id %>">
                <input type="hidden" id="item_price" value="<%=item_price_value%>">
                <input type="hidden" id="price_desc" value="<%=item_price_desc%>">
                <input type="hidden" id="quantity" value="<%=quantity%>">
                <input type="hidden" id="item_name" value="<%=item_name%>">
                <input type="hidden" id="item_desc" value="<%=item_desc%>">
                <input type="hidden" id="item_image_url" value="<%=item_image_url%>">
                  <div class="col-md-3 col-xs-6 col-sm-3">
                     <b>Quantity</b>
                     <div class="slider_quantity">
                        <a href="javascript:void(0);" class="ubtn btn_addtocard decrease subtract-multiplier"></a>
                        <span class="multiplier"><%=quantity%></span>            
                        <a href="javascript:void(0);" class="ubtn btn_addtocard add-multiplier"></a>
                     </div>
                  </div>
                  <div class="col-md-2 col-xs-3  col-sm-2">
                     <% var sub_total = sub_total ?sub_total:prices[0].value ; %>
                     <p><b>Price</b><strong>$<span class="sub-total"><%=sub_total%></span></strong>
                     </p>
                  </div>
                  <div class="col-md-2 col-xs-3 _mr0-xs  col-sm-2">
                    <% total = sub_total * quantity;
                    total = (Math.round(total * 100) / 100).toFixed(2) %>
                    <p class="txt_total color-red"><b>TOTAL</b><strong>$<span class="total"><%=total %></span></strong></p>
                  </div>
                  <div class="col-md-5 col-xs-12  col-sm-5 text-align-md-right text-align-ip-right text-align-xs-center">
                     <a href="javascript:void(0);" class="ubtn blackbtn btn_popupaddtoorder add-to-order">ADD TO ORDER</a>
                  </div>
               </div>
            </div>   
</script>

<script type="text/template" id="tmpl-locationPopup">
  <div class="popup_location _p30">
    <p class="txt_locationdetail sectiontitle y-popup-title">See which location delivers to you!</p>
    <div class="text-align-center panel_button">
      <% _.each(resContacts, function(resContact){ %>
        <a href="javascript:void(0);" class="ubtn blackbtn y-resUrl" data-resid="<%=resContact.id%>" data-resname="<%=resContact.name%>" hasreservation="<%=resContact.has_reservation%>"><%=resContact.name%></a>
      <%})%>
    </div>
  </div>

</script>

<script type="text/template" id="tmpl-adonsItem"> 
<% _.each(addons,function(addon){ %>
<div class="panel_chooseyourtoppings addon-collection" 
    data-menu-price-id="<%= menu_price_id %>" 
    data-selection-type="<%= addon['selection_type'] %>" 
    data-addon-id="<%= addon['addon_id'] %>" 
    data-item-limit="<%= addon['item_limit'] %>" 
    data-enable-price-beyond="<%= addon['enable_pricing_beyond'] %>">
    <p class="txt_chooseyourtoppings txt_addonq">
        <strong><%= addon['name'] %></strong>
        <% if(addon['selection_type'] == 0) { %>
        (Choose any one)
        <% } else if(!parseInt(addon['item_limit'],10)) { 
        if(addon['enable_pricing_beyond']){ %>
        (Choose any <%= addon['enable_pricing_beyond']%> item(s) for free)
        <!--(Choose wisely)-->
        <% } else { %>
        (Choose wisely)
        <% }
        } else { %>
        (Choose any <%= App.digitToString(addon['item_limit']) %>)
        <% } %>
    </p>
    <p class="addon-error-message error-message hide">Please select an option from below</p>
    <%
    var inputType = (addon['selection_type'] == 1 ? "checkbox":"radio");
    var inputContainerType = (addon['selection_type'] == 1 ? "prettycheckbox":"prettyradio");
    var inputName = (addon['selection_type'] == 1 ? ("addon["+ addon["addon_id"] +"][]") : "addon["+ addon["addon_id"] + "]");
    var selected = false;
    var doSelect = (addon['selection_type'] == 1?false:true);
    %>
    <ul class="unstyled box panel_popupaddon txt_addonradio clearfix">
        <% _.each(addon['options'], function(option){ %>
        <%
        var hasChecked = _.findWhere(selected_options,{optionId: parseInt(option['id'],10)});
        var checked = hasChecked?"checked":"";       
        if(inputType == 'radio'){
            if((option['name']==='None') || (option['name']==='Do Not Substitute') || (option['name']==='No Dressing')){
             var checked = "checked";
            }
        }
        %>
        <li class="has-pretty-child">
          <div class="custom_checkbox">
            <div class="row">
              <div class="col-md-10 col-xs-10">
                <div class="<%= inputContainerType %> labelright blue" data-id="<%= option['id'] %>">
                  <label for="<%= option['id'] %>">
                    <input <%= checked %> type="<%= inputType %>" class="t-addonsItems" name="<%= inputName %>" data-name="<%= option['name'] %>" id="<%= option['id'] %>" value="<%= option['price'] %>" data-menu-price-id="<%= menu_price_id %>"
                       data-item-limit="<%= addon['item_limit'] %>" data-option-name="<%= option['name'] %>"
                       data-addon-id="<%= addon['addon_id'] %>" data-option-price="<%= option['price'] %>"
                       <%= hasChecked?' data-priority="'+ hasChecked['priority'] +'" ':'' %>
                       data-option-id="<%= option['id'] %>" data-addon-name="<%= addon['name'] %>" data-label="<%= option['name'] %>" data-free-addons="<%= addon['enable_pricing_beyond']%>">
                       <span class="control_indicator"></span>
                    <!--<label for="<%= option['id'] %>"></label>-->
                    <%= option['name'] %></label>
                </div>      
              </div>
              <% if(parseFloat(option['price']) > 0.0){ %>
                <div class="col-md-2 col-xs-2">
                  <strong>$<%= App.getNumber(option['price'],2) %></strong>
                </div>
              <% } %>
            </div>
             <div class="descriptionContainer _fs11 txt_addondes">  
            <% if(option['addon_description']){ %> <span class="addonDescription"><%= option['addon_description'] %></span><% } %>            
             </div>
             </div>
        </li>
        <% }); %>
    </ul>
</div>
<% }) %>
</script>
<script type="text/template" id="tmpl-orderItem"> 
    <div class="row txt_bs_item item_<%=uid%>">
    <div class="col-md-8 col-xs-8" title="<%=item_name%>">
    <p class="truncate-text"><%=item_name%> <%= !_.isEmpty(price_desc)? "( "+price_desc+" )":"" %></p>
    </div>
    <strong class="col-md-1 col-xs-1 column"><%=quantity%></strong>
    <p class="col-md-3 col-xs-3 column text-align-right">$<%= App.getNumber(item_price *  quantity,2) %></p>
    </div>
    <% if(addons.length >0){ %>
    <div class="t-addons-summary">
            <% _.each(addons, function(addon){ %>
            <div class="row addons-txt txt_bs_item">
                <span class="col-md-8 col-xs-8 column truncate-text">+ <%=  addon['optionName'] %></span>
                <span class="col-md-1 col-xs-1 column review"><%= quantity %></span>
                <% if(addon['isFree']) { %>
                    <span class="col-md-3 col-xs-3 column text-align-right">$0.00</span>
                <% } else { %>
                    <span class="col-md-3 col-xs-3 column text-align-right">$<%= App.getNumber(addon['optionPrice'] *  quantity,2) %></span>
                <% } %>
            </div>
            <% }); %>
    </div>
    <% } if(addons.length >0){ %>
        <div class="t-item-total item-total-txt text-align-right _fs12 _fontarial">$<%=total_item_price%></div>
    <% } %>  
    <p class="t-item-instructions _fs10 _fontarial"><%=special_instruction%></p>  
    <div class="link_edit clearfix position-relative">
    <a href="javascript:void(0);" class="t-edit-order edit_<%=uid%> ubtn" data-id="<%=uid%>" data-toggle="tooltip" title="Edit Dish">
      <i class="i_pencil"></i>
    </a>
    <a href="javascript:void(0);" class="t-delete-order ubtn" data-id="<%=uid%>" data-name="<%=item_name %>" data-toggle="tooltip" title="Remove Dish">
      <i class="i_wrong">+</i>
    </a>
    <div class="tooltip t-tooltip_<%=uid%> hide">
      <div class="txt">
        <p>Are you sure you want to <br>remove <strong>'<span class="itemName_<%=uid%>">Azteca Chicken Wings</span>'</strong> from your order?</p>
        <span class="ubtn blackbtn t-confirm-delete-order" data-id="<%=uid%>">YES, DELETE IT</span><span class="ubtn blackbtn t-cancel-delete-order" data-id="<%=uid%>">CANCEL</span>
      </div>
    </div>
</script>
<script type="text/template" id="tmpl-restuarant-close">
    <div class="d_restauranclosed popup_delivery_address">
    <p class="txt_restauranclosed">We&rsquo;re sorry, but we&rsquo;re no longer accepting orders for this evening. Please visit us another time!</p>
    <p><a href="javascript:;" class="btn close_msgpopup">continue</a></p>
    </div>
</script>
<script type="text/template" id="tmpl-slotChange">
    <div class="d_restauranclosed popup_delivery_address">
    <p class="txt_restauranclosed">We&rsquo;re sorry, but we&rsquo;re no longer accepting reservation for this slot. Please try for another time slot!</p>
    <p><a href="javascript:;" class="btn close_slotChangePopup">continue</a></p>
    </div>
</script>
<script type="text/template" id="tmpl-search-geoaddress">
        <div class="_p30">    
             <p class="txt_m_enteryouraddress _fs14">Before proceeding to order, please enter your address to verify if its in the restaurant&#180;s coverage area.
             <strong class="txt_delivery_address"><%=App.currentRestaurant.delivery_desc%></strong></p>
              <div class="m_location_verify">
                <i class="i_circle i_wrong y-closeError">+</i>
                <input type="text" id="searchTextField" class="input_delivery_address" value="" placeholder="(Ex: 79 Madison Street, New  York...)"/>
                <input type="hidden" id="fullAddress" value=""/>
                <input type="hidden" id="addressLat" value=""/>
                <input type="hidden" id="addressLng" value=""/>
                <input type="hidden" id="addressType" value=""/>
              </div>
              <div class="but_m_actions">
                <a href="javascript:void(0)" class="ubtn blackbtn t-verify_proceed"">verify & proceed to order</a>
                <% if(App.currentRestaurant.has_takeout){%>
                    <span>OR</span>
                    <a href="javascript:void(0)" class="ubtn t_proceed_takeout">order takeout</a>
                <% } %>
              </div>
              <span class="lineloader hide">  <span></span><span></span><span></span></span>
               <div class="txt_vpsorry">
               
               <p class="t-right_address error_delivery_zone hide"><i class="i_circle i_right"></i>Good News! This restaurant will deliver to you. Close this window if it hasn't closed itself already.</p>
               <p class="t-wrong_address error_delivery_zone hide"><i class="i_circle i_wrong">+</i>Sorry, you&#180;re outside this restaurant&#180;s delivery zone.</p>
               <p class="t-invalid_address error_delivery_zone txt_invalid_address error-message hide">Hey! We need to know your full street address (ex: 79 Madison Avenue, New York) so we can find you all the great restaurants and food spots that will deliver to you. We promise not to drop by unannounced. 
               </p>
            </div>
        </div> 
</script>
<script type="text/template" id="tmpl-dateTime">             
  <div class="box_expectedtime _fs14">
  <p class="_fontarial">Expected Time of <span class="text-capitalize"><%=order_type%></span>:</p>
<% if(typeof date!= "undefined" && typeof time!="undefined" && !_.isEmpty(date) && !_.isEmpty(time)) { %>
    
        <p class="txt_upper"><%= App.getFormattedDateText(date) %>, <%= App.get12HourTime(time) %></p>
        <p class="txt_minhours">Hours: <span class="t-operation-hours"></span></p>
         <a href="javascript:void(0)" class="txtlink t-changeTime">Change</a>       
    </div>
<% } else { %>
  <div class="panel_selectexpectedtime">
        <select class="t-order-date">       
            <% _.each(dates,function(date){ %>
                <option <%= (App.parseDate(date['value']).getTime()==App.parseDate(selectedDate).getTime()?"selected":"")%> value="<%= date['value'] %>"><%= date['text'] %></option>
            <% }); %>   
        </select>
        <select class="t-order-time"></select>
   </div>     
       <!--  <p><a href="javascript:;" class="txtlink t-saveDateTime">Submit</a></p> -->
        <div class="tooltip lightbox tooltipselecttime hide">
            <p class="txt">You need to select a date and time from our available slots to proceed with your order.<a href="javascript:void(0)" class="i_close btn_close">+</a></p>
        </div>
    </div>
<% } %>    
</script>
<script type="text/template" id="tmpl-bookTable">
<div class="_p30 popup_reservetable">
  <form name="bookform" id="bookform" method="post">
   <div class="formstep1">
      <p class="sectiontitle _mb40">reserve a table</p>
      <div class="form_bookatable_level1">
        <div class="row">
         <div class="update_people_bookatable col-md-4 col-sm-4">
            <div class="reserveinputstyle">
               <select name="people" id="people">
                  <option value="2">2 people</option>
                  <option value="3">3 people</option>
                  <option value="4">4 people</option>
                  <option value="5">5 people</option>
                  <option value="6">6 people</option>
                  <option value="7">7 people</option>
                  <option value="8">8 people</option>
                  <option value="9">9 people</option>
                  <option value="10">10 people</option>
               </select>
            </div>
         </div>
         <div class="col-md-4  col-sm-4">
            <div class="reserveinputstyle">
               <input type="text" name="datepicker1" id="datepicker1" value="" readonly>
            </div>
         </div>
         <div class="col-md-4 col-sm-4 position-relative">
            <div class="reserveinputstyle">
               <input type="text" name="timepicker1" id="timepicker1" readonly tabindex="-99" >
               <div class="timepicker_custom outerDIVclose">
                  <ul class="t_timepicker unstyled clearfix">
                  </ul>
               </div>
            </div>
         </div>
      </div>
         <div class="text-align-center _mt35">
            <input type="button" value="Reserve it" name="btnbook" id="btnbook" class="ubtn">
         </div>
      </div>
   </div>
   <div class="formstep2 hide forreserve">
   <p class="sectiontitle _mb40">reserve a table</p>
   <div class="text-align-center">
     <p class="msgreservation _mb15">Your reservation is almost complete</p>
     <a href="javascript:void(0)" class="ubtn blackbtn y-editReservation">edit</a>
     <p class="txt_reservationwarning _fs12">Reservations are based upon availability at individual restaurants and they reserve the right to accept or decline any and all reservations.</p>
   </div>
   <div class="form_reservetable">
   <em class="txt_mandatorymessage"><span class="color_red">*</span> Mandatory Fields</em>
    <div class="row">
      <p class="col-md-4 col-sm-4 col-xs-12 text-align-md-right txt_checkoutlabel ">Name<span class="error-color">*</span></p>
      <div class="col-md-8 col-sm-8 col-xs-12 inputtwo">       
        <input type="text" name="first_name_r" id="first_name_r" placeholder="First Name" value="" class="require">
        <input type="text" name="last_name_r" id="last_name_r" placeholder="Last Name" value="" class="require" >
        <p class="error-message new-location-msg hide">Sorry, We don't talk to strangers</p>
        <input type="hidden" id="y-reservation-id" value="">
      </div>
    </div>
   <div class="row">
    <p class="col-md-4 col-xs-12 col-sm-4 text-align-md-right txt_checkoutlabel">Phone<span class="error-color">*</span></p>
    <div class="col-md-8 col-sm-8 col-xs-12">
      <div class="phoneno_code"><input type="tel" name="phone_no_r" id="phone_no_r" value="" maxLength="10" class="require" pattern="[0-9]*" ><em class="_fs10 txt_checkout_notification"></div>We only call in case of food emergencies (i.e. Order & reservation changes, clarifications or cancellations)</em>
      <p class="error-message new-location-msg hide y_error_phone">We promise; No prank calls</p>
    </div>
   </div>
   <div class="row">
    <p class="col-md-4 col-sm-4 col-xs-12 text-align-md-right txt_checkoutlabel">Email<span class="error-color">*</span></p>
    <div class="col-md-8 col-sm-8 col-xs-12">
      <input type="text" name="email_r" id="email_r" value="" class="require">
      <p class="error-message new-location-msg hide">Hey, you forgot something</p>
    </div>
  </div>
   <div class="row _m0">
      <p class="col-md-4 col-xs-12 col-sm-4 text-align-md-right txt_checkoutlabel">Special Instructions</p>
      <div class="col-md-8 col-xs-12 col-sm-8 panel_instructions panel_specialinstructions">
            <label class="inputfield custom_checkbox" id="req_boothID">
              <input type="checkbox" value="Request a booth" name="instructions[]" id="req_booth" >
               <span class="control_indicator"></span>
               Request a Booth
            </label>

            <label class="inputfield custom_checkbox" id="req_kidplaceID">
              <input type="checkbox" value="Request kid's place settings" name="instructions[]" id="req_kidplace" >
               <span class="control_indicator"></span>
               Request kid's place settings
            </label>

            <label class="inputfield custom_checkbox" id="req_nocenterpieceID">
              <input type="checkbox" value="Request no centerpiece" name="instructions[]" id="req_nocenterpiece" >
               <span class="control_indicator"></span>
               Request no centerpiece
            </label>

            <textarea id="comment" name="own_instruction" class="own_instruction special_instruction special_instruction" maxlength="255" rows="5" placeholder="Enter your own"></textarea>

            <p class="txt_word_count" style="visibility: hidden;">&nbsp;</p>
      </div>
   </div>
   </div>
   <p class="text-align-center error_time_slot error-message hide"></p>
    <p class="text-align-center"><a href="javascript:void(0)" id="btnconfirm" class="ubtn">Request reservation</a><span class="lineloader confirm_loader hide"><span></span><span></span><span></span></span></p>
   </div>
   <div class="formstep3 thanku text-align-center hide" id="formstp3">
        <p class="sectiontitle _mb40">reservation summary</p>
        <div class="row box_typeofplace">
            <p class="col-md-4 col-xs-12 col-sm-4"><span id="y-party-size"></span> people</p>
            <p class="col-md-4 col-xs-12 col-sm-4 y-reserve-date"></p>
            <p class="col-md-4 col-xs-12 col-sm-4 y-reserve-time"></p>
        </div>
        <em class="_fs11 txt_reservationsbased">Reservations are based upon availability at individual restaurants and they reserve the right to accept or decline any and all reservations.</em>
        <p class="txt_ordersummary">Thank you for your reservation.</p>
        <p class="txt_receiptid">Your receipt # is <span class="y-recieptN"></span> </p>
        
        <p class="txt_receiptmes _fs12">We will review your request and send you confirmation after checking availability. If you have any issues or want help, feel free to call us at <a class="contact_resphoneno" href="tel:<%=App.currentRestaurant.phone_no %>"><%=App.formattedPhoneNo(App.currentRestaurant.phone_no) %></a></p>

        <div class="_paneladdtocalendar">
            <a href="javascript:void(0)" class="ubtn blackbtn calendarClick" id="calendarClick-1" data-id="1" data-starttime="2017-4-10" data-endtime="2017-4-12" data-title="tedt" data-description="nn" data-location="qbc">add to calendar</a>
            <div class="googleCalender"></div>              
        </div>
       <div class="send_invites">
          <p class="txt_ordersummary _mt70 _p0">Let Your Friends Know About Your Culinary Discovery!</p>
            <em class="_fs10 display-block">You found a great spot. Invite your friends to bask in the glory that is your reservation and to dine with the God (or Goddess) of fine food.</em>
            <div class="text-align-left">
                <p class="_mt30 _fontarial _fs12 _pb3">Invite Friends to Join Your Reservation *<br /><strong>Enter email address Separated by "," or ";"</strong></p>
                <input id="emails" size="50" type="text" class="tags email invisible" value="" />
                <em class="error-color _fs10  emails-error hide"></em>

                <p class="_fontarial _fs12 _pb3 _pt10">Include a Personalized Message</p>
                <textarea id="send-reservation-msg" name="own_instruction" placeholder="" autocomplete="off" rows="5"></textarea>
                <em class="error-color _fs10  msg-error hide">Hey, you forgot something</em>
                <p class="text-align-center _mt30"><a href="javascript:void(0)" class="ubtn blackbtn y-send-invitation">SEND</a><span class="lineloader confirm_loader hide"><span></span><span></span><span></span></span></p>
            </div>
        </div>    
    </div>
    <div class="sendinvite-thank hide">
        <p class="txt_yourinvites txt_ordersummary _mt70 text-align-center">Your invite(s) have gone out to<br />
        <strong class="toBeSendContact _fontarial"></strong></p>
        <p class="txt_yourinvites_expect _fs14 text-align-center">Expect RSVPs soon!</p>
        <!--<p class="text-align-center"><a href="javascript:void(0)" title="INVITE MORE people to join your party" class="orangebtn invitemore">INVITE MORE people to join your party</a></p>-->
    </div>
</form>
</div>
</script>
<script type="text/template" id="tmpl-checkout-address">
<% if($.jStorage.get('order_type_'+restId) == "delivery") {             
          var data = App.getFormattedAddress($.jStorage.get('address_value_'+restId));
          %>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">address 1<span class="error-color">*</span></div>
            <div class="col-md-7">
               <input name="address_1" type="text" value="<%=data.addressValue%>" <%=(data.zipCode)?'disabled':''%> maxlength="100">
               <em class="_fs10 txt_checkout_notification">Enter only street address. (Don't include building name, suite number or floor number)</em>
               <p class="error-message hide">Hey, you forgot something</p>
            </div>
         </div>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">address 2<span class="error-color"></span></div>
            <div class="col-md-7">
               <input name="address_2" type="text" maxlength="100" value="<%=(data.city===stateName)?'':data.city%>">
               <em class="_fs10 txt_checkout_notification">Enter additional address information (such as building name, suite number or floor number)</em>
               <p class="error-message hide">Hey, you forgot something</p>
            </div>
         </div>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">city<span class="error-color">*</span></div>
            <div class="col-md-7 inputtwo">
               <input name="city" type="text" value="<%=stateName %>" disabled>
               <input name="state_code" type="text" value="<%=data.stateCode%> "disabled>
               <p class="error-message hide">Hey, you forgot something</p>
            </div>
         </div>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">zip<span class="error-color">*</span></div>
            <div class="col-md-7">
               <input name="zipcode" type="tel" value="<%=data.zipCode%>" <%=(data.zipCode)?'disabled':''%> class="zip" pattern="[0-9]*" maxlength="9">
               <p class="error-message hide">Hey, you forgot something</p>
            </div>
         </div>
         <% } %>
</script> 
<script type="text/template" id="tmpl-chk-instruction">
 <%  if($.jStorage.get('order_type_'+restId) == "delivery") {%>
        <label class="inputfield custom_checkbox">
        <input name="instructions[]" type="checkbox" value="Please call before you deliver">
        <span class="control_indicator"></span>
        Please call before you deliver
        </label>
        <label class="inputfield custom_checkbox">
        <input name="instructions[]" type="checkbox" value="Please leave with the doorman">
       <span class="control_indicator"></span>
        Please leave with the doorman
        </label>
        <label class="inputfield custom_checkbox">
        <input name="instructions[]"  type="checkbox" value="Please do not send any napkins or plasticware">
       <span class="control_indicator"></span>
        Please do not send any napkins or plasticware
        </label>
        <% }else{%>
        <label class="inputfield custom_checkbox">
        <input name="instructions[]" type="checkbox" value="Please call when the order is ready">
        <span class="control_indicator"></span>
        Please call when the order is ready
        </label>
        <label class="inputfield custom_checkbox">
        <input name="instructions[]"  type="checkbox" value="Please do not pack any napkins or plasticware">
         <span class="control_indicator"></span>
        Please do not pack any napkins or plasticware
        </label>
        <% } %>
</script> 
<script type="text/template" id="tmpl-checkout">
   <div>
      <p class="title_checkout">Enter your contact details below</p>
      <div class="form_checkoutsubsection">
         <em class="txt_mandatorymessage"><span class="color_red">*</span> Mandatory Fields</em>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">Name<span class="error-color">*</span></div>
            <div class="col-md-7 inputtwo">
               <input placeholder="First Name" name="first_name"  type="text"><input placeholder="Last Name" name="last_name" value="" class="capitalize" type="text">
               <p class="error-message hide">Sorry, We don't talk to strangers</p>
            </div>
         </div>
         <div class="y_checkout_delivery_address hide"></div>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">phone<span class="error-color">*</span></div>
            <div class="col-md-7">
               <div class="phoneno_code"><input name="phone_no" maxLength="10" type="tel" pattern="[0-9]*"></div>
               <em class="_fs10 txt_checkout_notification">We only call in case of food emergencies (i.e. Order and reservation changes, clarifications or cancellations)</em>
               <p class="error-message error-phoneNo hide">We promise; No prank calls</p>
            </div>
         </div>
         <div class="row">
            <div class="col-md-5 text-align-md-right txt_checkoutlabel">email<span class="error-color">*</span></div>
            <div class="col-md-7">
               <input name="email" type="text">
               <p class="error-message hide">Hey, you forgot something</p>
            </div>
         </div>
         <div class="row panel_instructions">
            <div class="col-md-5">&nbsp;</div>
            <div class="col-md-7">
              <div class="panel_specialinstructions">
               <strong>Add special instructions for your order (optional)</strong>
               <br>
               <div class="y_checkout_chk_instructions"></div>
               <textarea name="own_instruction" class="own_instruction special_instruction" maxlength="255" placeholder="Enter your own" autocomplete="off" rows="4"></textarea>
               <p class="txt_word_count" style="visibility: hidden;">&nbsp;</p>
              </div>
            </div>
         </div>
         </div>
         <div class="">
         <p class="title_checkout">Enter payment details</p>
         <div class="form_checkoutsubsection">
            <div class="row">
               <p class="col-md-5 text-align-md-right txt_checkoutlabel">Name on Card <span class="error-color astrickCheckout">*</span></p>
               <div class="col-md-7">
                  <input name="card_name" class="capitalize" autocomplete="off" type="text">
                  <em class="_fs10 txt_checkout_notification">As it appears on your credit card</em>
                  <p class="error-message new-card-msg hide">And whose card is this?</p>
                  <ul class="credit_cards unstyled">
                     <li class="visa" data-type="visa"></li>
                     <li class="master_card" data-type="master"></li>
                     <li class="amex" data-type="amex"></li>
                     <li class="ddiscover" data-type="disc"></li>
                     <li class="diners" data-type="dinn"></li>
                     <li class="jcb" data-type="jcb"></li>
                  </ul>
               </div>
            </div>
            <div class="row">
               <p class="col-md-5 text-align-md-right txt_checkoutlabel">Card Number <span class="error-color astrickCheckout">*</span></p>
               <div class="col-md-7">
                  <input name="card_number" type="tel" maxLength="19" value="" >
                  <em class="_fs10 txt_checkout_notification">Up to 16 digits on the front of your card. No spaces or dashes</em>
                  <p class="error-message new-card-msg hide">Try rubbing your fingers over the numbers, that helps us get 'em right</p>
               </div>
            </div>
            <div class="row">
               <p class="col-md-5 text-align-md-right txt_checkoutlabel">Expiry Date <span class="error-color astrickCheckout">*</span></p>
               <div class="col-md-7 expiry_date_custom">
                  <div class="select_expiry inputtwo clearfix">                                    
                        <select class="card_expire_month" onchange="$('.selectMonthVaue').text($(this).find('option:selected').text());">
                           <% var d = new Date();
                              if(App.currentRestaurant){
                                  d = App.parseDate(App.currentRestaurant.current_dateTime);
                              }
                              var currentMonth = d.getMonth() + 1;
                              for(var month=1;month<13;month++){ %>
                           <option value="<%= month %>" <% if (currentMonth==month){%>selected <% } %> ><%= (month > 9) ? month : "0" + month %></option>
                           <% } %>
                        </select>
                                          
                        <select class="card_expire_year" onchange="$('.selectYearVaue').text($(this).find('option:selected').text());">
                           <% 
                              var currentYear = d.getFullYear();
                              for(var year=currentYear;year<(currentYear+10);year++){ %>
                           <option value="<%=year %>" <% if (currentYear==year){%>selected <% } %> ><%=year %></option>
                           <% } %>
                        </select>                     
                  </div>
                  <em class="_fs10 txt_checkout_notification">Find this on the front of your card</em>
                  <p class="error-message new-card-msg card-validity hide">Please select valid expiry date(MM-YYYY).</p>
               </div>
            </div>
            <div class="row position_relative">
               <p class="col-md-5 text-align-md-right txt_checkoutlabel">CVV Code <span class="error-color astrickCheckout">*</span></p>
               <div class="col-md-7">
                  <input class="creditcard-cvv" name="cvv_code" type="tel" maxlength="4" value="" pattern="[0-9]*">
                  <div class="link_cvvpanel">
                    <a href="javascript:void(0)" class="link_cvvmessage" onclick="$('body').addClass('cvvpanelactive');$('.cvvmessagebox').removeClass('hide');">What's this?</a>
                    <div class="cvvmessagebox hide">
                       <div class="box_cvvnumber rs">
                          <p class="txt_cvvnumber fleft">What is CVV Number?</p>
                          <a href="javascript:void(0)" class="i_close btn_close" onclick="$('body').removeClass('cvvpanelactive');$('.cvvmessagebox').addClass('hide');">+</a>
                       </div>
                       <div class="cvvcontent row">
                          <div class="col-md-5 col-xs-5"><img src="images/card_verification_img1.jpg" class="img-responsive"></div>
                          <div class="col-md-7 col-xs-7">
                             <div class="txtcvvcontent">
                                <strong>For Visa/Master/Diners Card Holders</strong>
                                <p>For your safety and security, we require that you enter your cards verification
                                   number. The verification number is a 3-digit number printed on the back of your
                                   card. It appears after and to the right of your card number.
                                </p>
                             </div>
                          </div>
                       </div>
                       <div class="cvvcontent row">
                          <div class="col-md-5 col-xs-5"><img src="images/card_verification_img2.jpg" class="img-responsive"></div>
                          <div class="col-md-7 col-xs-7">
                             <div class="txtcvvcontent">
                                <strong>For American Express Card Holders</strong>
                                <p>For your safety and security, we require that you enter your cards verification
                                   number. The American Express verification number is a small 4-digit number
                                   printed on the front of your card on the right hand side.
                                </p>
                             </div>
                          </div>
                       </div>
                       <div class="cvvcontent row">
                          <div class="col-md-5 col-xs-5"><img src="images/card_verification_img3.jpg" class="img-responsive"></div>
                          <div class="col-md-7 col-xs-7">
                             <div class="txtcvvcontent">
                                <strong>For JCB Card Holders</strong>
                                <p>For your safety and security, we require that you enter your cards verification
                                   number. The JCB verification number is a small 4-digit number printed on the
                                   front of your card on the left hand side.
                                </p>
                             </div>
                          </div>
                       </div>
                       <div class="whitedownarrowa"></div>
                    </div>
                  </div>
                  <em class="_fs10 txt_checkout_notification">3 or 4 digits on the back of most cards. On the front of AMEX cards</em>
                  <p class="error-message new-card-msg hide">It would be irresponsible of us not to require this.</p>
               </div>
            </div>
            <div class="row row-checkout-billingzip">
               <p class="col-md-5 text-align-md-right txt_checkoutlabel">Billing Zip <span class="error-color astrickCheckout">*</span></p>
               <div class="col-md-7 column">
                  <input class="checkout-billingzip" name="zip" type="tel" value="" maxlength="10" pattern="[0-9]*" autocomplete="off">
                  <p class="error-message new-card-msg hide">Come on, you gave us all the other info. Why you holding out?</p>
               </div>
            </div>
            <div class="row hide">
               <p class="col-md-5 column">&nbsp;</p>
               <div class="col-md-7">
                  <p class="error-message stripe-error">
               </div>
            </div>
            <div class="row">
               <p class="col-md-5 column hidden-sm hidden-xs">&nbsp;</p>
               <div class="col-md-7 text-align-center">
                 <a href="javascript:void(0);" class="ubtn blackbtn placemyorder">place my order</a>
                  <span class="lineloader confirm_loader hide">  <span></span><span></span><span></span></span>
               </div>
            </div>
         </div>
         </div>
      </div>
   </div>
</script>
<script type="text/template" id="tmpl-checkout-thankyou">
 <div class="checkoutsection_thanku text-align-center">
  <p class="txt_ordersummary"><span class="show-mobile">Thank You. <br></span>Our chefs will begin crafting your order soon.</p>
    <p class="txt_receiptid">Your receipt # is <%=receipt%></p>
    <p class="txt_receiptmes">You will receive a confirmation email soon. If you have any issues or want help, feel free to call us at <a class="contact_resphoneno" href="tel:<%=App.currentRestaurant.phone_no %>"><%=App.formattedPhoneNo(App.currentRestaurant.phone_no) %></a></p>
</div>
</script> 

<script type="text/template" id="about_wine_program">
 <div class="_p40 about_program_section">
    <p class="txt_header _pb30">Tramunte Wine</p>
    <img src="theme/tramontipizza/images/tramonti-wine-des.png" alt="Tramonti Wine" style="width: 100%;">
</div>
</script> 

<script type="text/template" id="tmpl-restaurant-calender">
<% if(!_.isEmpty(calendar['detail'])){ %>
    <strong class="_pb10">Hours</strong>
    <% var days = {
    "mo" : "Monday", "tu" : "Tuesday", "we" : "Wednesday", "th" : "Thursday", "fr" : "Friday", "sa" : "Saturday", "su" : "Sunday"
}; %>
<% _.each(calendar['detail'], function(calendar, day){ %>
    <div class="row borderdotted">
        <div class="col-md-4 col-xs-4"><%= days[calendar['calendar_day']] %></div>
        <%  var ohs = calendar['operation_hours'].split(","); %>
        <% var isFirst = true; %>
        <% _.each(ohs,function(oh){ %>
        <%  if(!isFirst) { %>
        <div class="col-md-4 col-xs-4">&nbsp;</div>
        <% }  else { isFirst = false; }%>
        <div class="col-md-8 col-xs-8 text-align-right">
            <% ohs = oh.split('-'); 
            if(ohs[0] && ohs[1]){
            %> <%= ohs[0].trim() %> to <%= ohs[1].trim() %>
            <% } %>
        </div>
        <% }) %>
    </div>
    <% }) %>
<% } else{ %>
<strong>hours</strong> <%=calendar['open_twenty_four_hours']%>
<% }%>
</script> 