<div class="tab-pane fade in active">
   <div class="row">
      <!--Popup status-->
      <div class="col-md-4">
         <h5><span class="required">* </span><strong>Popup <?php echo $popup['id']; ?> status</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $poup_status_help; ?></span>
      </div>
      <div class="col-md-3">
         <select id="Checker" name="<?php echo $popup_name; ?>[Enabled]" class="form-control">
            <option value="yes" <?php echo (!empty($popup_data['Enabled']) && $popup_data['Enabled'] == 'yes') ? 'selected=selected' : '' ?>><?php echo $text_enabled; ?></option>
            <option value="no"  <?php echo (empty($popup_data['Enabled']) || $popup_data['Enabled']== 'no') ? 'selected=selected' : '' ?>><?php echo $text_disabled; ?></option>
         </select>
      </div>
      <div class="col-md-5" style="text-align:right;">
         Impressions:
         <?php if (isset($impressions)) {
                foreach ($impressions as $p_impressions) {
                    if ($p_impressions['popup_id'] == $popup['id']) {
                        echo $p_impressions['impressions'];
                    }
                }
            } else {
                echo 0;
            }
         ?>
      </div>
   </div>
   <!--End Popup status-->
   <br/>
   <div class="row">
      <!--Showing method-->
      <div class="col-md-4">
         <h5><strong><?php echo $showing_method_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $choose_method_help; ?> </span>
      </div>
      <div class="col-md-3">
         <select name="<?php echo $popup_name; ?>[method]" class="methodTypeSelect form-control">
            <option value="0" <?php echo (!empty($popup_data['method']) && $popup_data['method'] == '0') ? 'selected=selected' : '' ?>><?php echo $on_homepage_text; ?></option>
            <option value="1" <?php echo (!empty($popup_data['method']) && $popup_data['method'] == '1') ? 'selected=selected' : '' ?>><?php echo $on_all_pages_text; ?></option>
            <option value="2" <?php echo (!empty($popup_data['method']) && $popup_data['method'] == '2') ? 'selected=selected' : '' ?>><?php echo $on_specific_urls_text;?></option>
            <option value="3" <?php echo (!empty($popup_data['method']) && $popup_data['method'] == '3') ? 'selected=selected' : '' ?>><?php echo $css_selector_text;?></option>
         </select>
      </div>
   </div>
   <!--End Showing method-->
   <div class="row specURL">
      <br />
      <div class="col-md-4">
         <h5><strong><?php echo $urls_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $urls_text_help; ?></span>
      </div>
      <div class="col-md-8">
         <textarea rows="5" placeholder="http://" type="text" class="form-control" name="<?php echo $popup_name; ?>[url]"><?php if (!empty($popup_data['url'])) {
             echo $popup_data['url'];
         } else {
             echo"";
         } ?></textarea>
      </div>
   </div>
   <div class="row excludeURL">
      <br />
      <div class="col-md-4">
         <h5><strong><?php echo $excluded_urls_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $excluded_urls_text_help;?></span>
      </div>
      <div class="col-md-8">
         <textarea rows="5" placeholder="http://" type="text" class="form-control" name="<?php echo $popup_name; ?>[excluded_urls]"><?php if (!empty($popup_data['excluded_urls'])) {
             echo $popup_data['excluded_urls'];
         } else {
             echo"";
         } ?></textarea>
      </div>
   </div>
   <div class="row cssSelector">
      <br />
      <div class="col-md-4">
         <h5><strong><?php echo $choose_css_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $choose_css_text_help; ?></span>
      </div>
      <div class="col-md-3">
         <input placeholder=".css" type="text" class="form-control" name="<?php echo $popup_name; ?>[css_selector]" value="<?php if (!empty($popup_data['css_selector'])) {
             echo $popup_data['css_selector'];
         } else {
             echo"";
         } ?>" />
      </div>
   </div>
   <!--End Showing method-->
   </br>
   <div class="row">
      <!--Trigger event-->
      <div class="col-md-4">
         <h5><strong><?php echo $show_on_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $show_on_text_help; ?></span>
      </div>
      <div class="col-md-3">
         <select name="<?php echo $popup_name; ?>[event]" class="eventSelect form-control">
            <option value="0" <?php echo (!empty($popup_data['event']) && $popup_data['event'] == '0') ? 'selected=selected' : '' ?>>Window Load Event</option>
            <option value="1" <?php echo (!empty($popup_data['event']) && $popup_data['event'] == '1') ? 'selected=selected' : '' ?>>Page Load Event</option>
            <option value="2" <?php echo (!empty($popup_data['event']) && $popup_data['event'] == '2') ? 'selected=selected' : '' ?>>Body Click Event</option>
            <option value="3" <?php echo (!empty($popup_data['event']) && $popup_data['event'] == '3') ? 'selected=selected' : '' ?>>Exit intent</option>
            <option value="4" <?php echo (!empty($popup_data['event']) && $popup_data['event'] == '4') ? 'selected=selected' : '' ?>>Scroll Percentage Event</option>
         </select>
      </div>
   </div>
   </br>
   <div class="row">
      <!-- Show on Mobile-->
      <div class="col-md-4">
         <h5><strong><?php echo $show_on_desktop_text;?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $show_on_desktop_text; ?></span>
      </div>
      <div class="col-md-3">
         <select name="<?php echo $popup_name; ?>[show_on_desktop]" class="form-control">
            <option value="1" <?php echo (!isset($popup_data['show_on_desktop']) || $popup_data['show_on_desktop'] == '1') ? 'selected=selected' : '' ?>><?php echo $text_yes;?></option>
            <option value="0" <?php echo (isset($popup_data['show_on_desktop']) && $popup_data['show_on_desktop'] == '0') ? 'selected=selected' : '' ?>><?php echo $text_no;?></option>
         </select>
      </div>
   </div>
   </br>
   <div class="row">
      <!-- Show on Mobile-->
      <div class="col-md-4">
         <h5><strong><?php echo $show_on_mobile_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $show_on_mobile_text_help;?></span>
      </div>
      <div class="col-md-3">
         <select name="<?php echo $popup_name; ?>[show_on_mobile]" class="form-control">
            <option value="1" <?php echo (!isset($popup_data['show_on_mobile']) || $popup_data['show_on_mobile'] == '1') ? 'selected=selected' : '' ?>><?php echo $text_yes;?></option>
            <option value="0" <?php echo (isset($popup_data['show_on_mobile']) && $popup_data['show_on_mobile'] == '0') ? 'selected=selected' : '' ?>><?php echo $text_no;?></option>
         </select>
      </div>
   </div>
   <br/>
   <div class="row percentageInput">
      <div class="col-md-4">
         <h5><strong><span class="required">* </span><?php echo $scroll_text; ?></strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $scroll_text_help; ?></span>
      </div>
      <div class="col-md-2">
         <div class="percentageInput">
            <br/>
            <div class='input-group'>
               <input type='number' min="1" class="form-control" name="<?php echo $popup_name; ?>[scroll_percentage]" value="<?php if (!empty($popup_data['scroll_percentage'])) {
                     echo $popup_data['scroll_percentage'];
                 }?>" />
               <span class="input-group-addon">%</span>
            </div>
         </div>
      </div>
   </div>
   <!--End trigger event-->
   <br />
   <div class="row">
      <!--Display frequency-->
      <div class="col-md-4">
         <h5><strong><?php echo $repeat_text;?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $repeat_text_help;?></span>
      </div>
      <div class="col-md-3">
         <select name="<?php echo $popup_name; ?>[repeat]" class="form-control repeatSelect">
            <option value="0" <?php echo (!empty($popup_data['repeat']) && $popup_data['repeat'] == '0') ? 'selected=selected' : '' ?>><?php echo $show_always_text;?></option>
            <option value="1" <?php echo (!empty($popup_data['repeat']) && $popup_data['repeat'] == '1') ? 'selected=selected' : '' ?>><?php echo $show_once_text;?></option>
            <option value="2" <?php echo (!empty($popup_data['repeat']) && $popup_data['repeat'] == '2') ? 'selected=selected' : '' ?>><?php echo $show_after_text;?></option>
         </select>
         <div class="daysPicker">
            <br/>
            <div class="input-group">
               <input type="number" min="1" class="form-control" name="<?php echo $popup_name; ?>[days]" value="<?php if (!empty($popup_data['days'])) {
             echo $popup_data['days'];
         } else {
             echo"1";
         } ?>" />
               <span class="input-group-addon">days</span>
            </div>
         </div>
      </div>
   </div>
   <!-- End display frequency-->
    <!-- Start days frequency-->
    <br />
   <div class="row">
       <label class="col-md-4" for="input-weekday-interval">
           <h5><strong><?php echo $entry_weekday_interval; ?></strong></h5>
           <span class="help"><i class="fa fa-info-circle"></i> <?php echo $help_weekday_text; ?></span>
       </label>
       <div class="col-md-3">
           <select name="<?php echo $popup_name; ?>[weekday_interval]" id="input-weekday-interval" class="form-control">
               <option value="disabled" <?php echo (empty($popup_data['weekday_interval']) || $popup_data['weekday_interval'] == 'disabled') ? 'selected=selected' : '' ?>><?php echo $text_disabled; ?></option>
               <option value="enable" <?php echo (!empty($popup_data['weekday_interval']) && $popup_data['weekday_interval'] == 'enable') ? 'selected=selected' : '' ?>><?php echo $text_enabled; ?></option>
           </select>
           <div id="weekday_input_<?php echo $popup['id']; ?>">
           <br>
               <?php echo $entry_pick_weekday; ?>
               <br/>
               <div class="input-group days">
                   <ul class="list-unstyled">
                       <?php foreach ($weekdays_array as $index => $day) {
                            ?>
                           <li class="col-sm-4">
                               <input type="checkbox" value="<?php echo $index; ?>" name="<?php echo $popup_name; ?>[weekdays][]" id="<?php echo $index; ?>_day"  <?php if (isset($popup_data['weekdays']) && is_array($popup_data['weekdays'])) {
                                     echo in_array($index, $popup_data['weekdays']) ? 'checked="checked"' : '';
                                 } ?>/>
                               <label for='<?php echo $index; ?>_day'><?php echo $day; ?></label>
                           </li>
                       <?php
                    } ?>
                   </ul>
               </div>
           </div>
       </div>
   </div>
   <!-- End days frequency-->
   <br />
   <div class="row">
      <!-- Hours frequency-->
      <div class="col-md-4">
         <h5><strong><?php echo $hours_interval_text; ?>:</strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $hours_interval_text_help; ?></span>
      </div>
      <div class="col-md-2">
         <select name="<?php echo $popup_name; ?>[time_interval]" class="form-control timeIntervalSelect">
            <option value="0" <?php echo (empty($popup_data['time_interval']) || $popup_data['time_interval'] == '0') ? 'selected=selected' : '' ?>><?php echo $text_disabled; ?></option>
            <option value="1" <?php echo (!empty($popup_data['time_interval']) && $popup_data['time_interval'] == '1') ? 'selected=selected' : '' ?>><?php echo $text_enabled; ?></option>
         </select>
         <div class="timeInterval">
            <br/>
            <?php echo $starttime_text; ?>
            <div class='input-group date startTime'>
               <input type='text' class="form-control" name="<?php echo $popup_name; ?>[start_time]" value="<?php if (!empty($popup_data['start_time'])) {
             echo $popup_data['start_time'];
         } else {
             echo"00:00";
         } ?>" />
               <span class="input-group-addon"><span class="fa fa-clock-o"></span>
            </span>
         </div>
         <br/><?php echo $endtime_text; ?>
         <div class='input-group date endTime'>
            <input type='text' class="form-control" name="<?php echo $popup_name; ?>[end_time]" value="<?php if (!empty($popup_data['end_time'])) {
             echo $popup_data['end_time'];
         } else {
             echo"00:00";
         } ?>" />
            <span class="input-group-addon"><span class="fa fa-clock-o"></span>
         </span>
      </div>
   </div>
</div>
</div>
<!-- End hours frequency-->
<br />
<div class="row">
<!-- Date interval-->
    <div class="col-md-4">
       <h5><strong><?php echo $date_interval_text;?>:</strong></h5>
       <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $date_interval_text_help; ?></span>
    </div>
    <div class="col-md-2">
       <select name="<?php echo $popup_name; ?>[date_interval]" class="form-control dateIntervalSelect">
          <option value="0" <?php echo (empty($popup_data['date_interval']) || $popup_data['date_interval'] == '0') ? 'selected=selected' : '' ?>><?php echo $text_disabled; ?></option>
          <option value="1" <?php echo (!empty($popup_data['date_interval']) && $popup_data['date_interval'] == '1') ? 'selected=selected' : '' ?>><?php echo $text_enabled; ?></option>
       </select>
       <div class="dateInterval">
          <br/>
          <?php echo $startdate_text; ?>
          <div class="input-group date startDate">
             <input type="text" name="<?php echo $popup_name; ?>[start_date]" value="<?php if (!empty($popup_data['start_date'])) {
             echo $popup_data['start_date'];
         } else {
             echo"";
         } ?>" placeholder="YYYY-MM-DD" data-date-format="YYYY-MM-DD" class="form-control" />
             <span class="input-group-btn">
                <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
             </span>
          </div>
          <br/><?php echo $enddate_text; ?>
          <div class="input-group date endDate">
             <input type="text" name="<?php echo $popup_name; ?>[end_date]" value="<?php if (!empty($popup_data['end_date'])) {
             echo $popup_data['end_date'];
         } else {
             echo"";
         } ?>" placeholder="YYYY-MM-DD" data-date-format="YYYY-MM-DD" class="form-control" />
             <span class="input-group-btn">
                <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
             </span>
          </div>
       </div>
    </div>
</div>
<hr>
<!--End Date interval-->
<br />
<div class="row">
<!-- Seconds interval-->
<div class="col-md-4">
   <h5><strong><?php echo $delay_text; ?>:</strong></h5>
   <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $delay_text_help; ?></span>
</div>
<div class="col-md-2">
   <div class="input-group">
      <input type="number" min="0" class="form-control" name="<?php echo $popup_name; ?>[seconds]" value="<?php if (!empty($popup_data['seconds'])) {
             echo $popup_data['seconds'];
         } else {
             echo"0";
         } ?>" />
      <span class="input-group-addon">secs</span>
   </div>
</div>
</div>
<!-- End seconds interval-->
<br />
<div class="row">
<!-- Close after x seconds-->
<div class="col-md-4">
   <h5><strong><?php echo $close_after_text; ?>:</strong></h5>
   <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $close_after_text_help; ?></span>
</div>
<div class="col-md-2">
   <div class="input-group">
      <input type="number" min="0" class="form-control" name="<?php echo $popup_name; ?>[close_after]" value="<?php if (!empty($popup_data['close_after'])) {
             echo $popup_data['close_after'];
         } else {
             echo"0";
         } ?>" />
      <span class="input-group-addon">secs</span>
   </div>
</div>
</div>
<!-- End close after -->
<br />
<div class="row">
<!-- Prevent closing -->
<div class="col-md-4">
   <h5><strong><?php echo $prevent_closing_text; ?>:</strong></h5>
   <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $prevent_closing_text_help; ?></span>
</div>
<div class="col-md-2">
   <select name="<?php echo $popup_name; ?>[prevent_closing]" class="form-control">
      <option value="0" <?php echo (empty($popup_data['prevent_closing']) || $popup_data['prevent_closing'] == '0') ? 'selected=selected' : '' ?>><?php echo $text_disabled; ?></option>
      <option value="1" <?php echo (!empty($popup_data['prevent_closing']) && $popup_data['prevent_closing'] == '1') ? 'selected=selected' : '' ?>><?php echo $text_enabled; ?></option>
   </select>
</div>
</div>
<!--End Prevent closing -->
<br />
<div class="row">
<!-- Customer Groups -->
<div class="col-md-4">
   <h5><span class="required">*</span><strong><?php echo $cutomergroups_text; ?></strong></h5>
   <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $cutomergroups_text_help; ?></span>
</div>
<div class="col-md-3">
   <div class="checkbox">
      <label>
         <input type="checkbox" name="<?php echo $popup_name ?>[customerGroups][0]" <?php echo !isset($popup_data['customerGroups']) || (isset($popup_data['customerGroups'][0]) && $popup_data['customerGroups'][0] == 'on') ? 'checked="checked"' : ''; ?>/> Guest
      </label>
   </div>
   <?php foreach ($customerGroups as $customerGroup) {
             ?>
   <div class="checkbox">
      <label>
         <input type="checkbox" name="<?php echo $popup_name ?>[customerGroups][<?php echo $customerGroup['customer_group_id']?>]" <?php echo !isset($popup_data['customerGroups']) || (isset($popup_data['customerGroups'][$customerGroup['customer_group_id']]) && $popup_data['customerGroups'][$customerGroup['customer_group_id']] == 'on') ? 'checked="checked"' : ''; ?>/> <?php echo $customerGroup['name'] ?>
      </label>
   </div>
   <?php
         } ?>
</div>
</div>
<br>
<div class="row" >
      <div class="col-md-4">
         <h5><strong><?php echo $customcss_text; ?></strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $customcss_text_help; ?></span>
      </div>
      <div class="col-md-3">
         <textarea cols="300" rows="5" class="form-control" name="<?php echo $popup_name; ?>[custom_css]"?><?php if (!empty($popup_data['custom_css'])) {
             echo $popup_data['custom_css'];
         } else {
             echo '.popup-id-'.$popup['id'].'{}';
         }?>
         </textarea>
      </div>
</div>
<!--End Customer Groups -->
<br>
<div class="row">
       <div class="col-md-4">
         <h5><span class="required">* </span><strong>Content type</strong></h5>
      </div>
      <div class="col-md-3">
         <select id="Checker" name="<?php echo $popup_name; ?>[content_type]" class="form-control">
            <option value="html" <?php echo (empty($popup_data['content_type']) || $popup_data['content_type'] == 'html') ? 'selected=selected' : '' ?>><?php echo $hmtlcontent_text; ?></option>
            <option value="youtube"  <?php echo (!empty($popup_data['content_type']) && $popup_data['content_type']== 'youtube') ? 'selected=selected' : '' ?>><?php echo $youtubecontent_text; ?></option>
         </select>
      </div>
</div>
<br/>
<div class="row" id="showHideYtdLink_<?php echo $popup['id']; ?>">
      <div class="col-md-4">
         <h5><strong><?php echo $video_link_text; ?></strong></h5>
         <span class="help"><i class="fa fa-info-circle"></i>&nbsp;<?php echo $video_link_text_help;?></span>
      </div>
      <div class="col-md-3">
         <input placeholder="video link" type="text" class="form-control" name="<?php echo $popup_name; ?>[video_link]" value="<?php if (!empty($popup_data['video_link'])) {
             echo $popup_data['video_link'];
            } else {
                echo"";
            } ?>" />
      </div>
</div>
<br/>
<div id="showHideHtmlContent_<?php echo $popup['id']; ?>">
    <?php if (isset($popup_data['weekday_interval']) && $popup_data['weekday_interval'] == 'enable') {
             ?>
        <h5><?php echo $multilang_text; ?>:</h5>
        <div class="col-sm-10 extra_fields">
            <div class="tabbable boxed parentTabs">
                <ul class="nav nav-tabs ">
                    <?php $i=0; foreach ($languages as $language) : ?>
                        <li <?php echo $language['language_id'] == 1 ? "class=\"active\"" : '' ?>><a href="#language<?php echo $language['language_id']; ?>"data-toggle="tab"><img src="<?php echo $language['flag_url']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a></li>
                    <?php $i++; endforeach; ?>
                </ul>
                <div class="tab-content">
                    <?php $i=0; foreach ($languages as $language) : ?>
                    <div class="tab-pane fade in <?php echo $language['language_id'] == 1 ? "active" : '' ?>" id="language<?php echo $language['language_id']?>">
                        <div class="tabbable">
                            <ul class="nav nav-tabs">
                                <?php foreach ($popup_data['weekdays'] as $index => $day) : ?>
                                    <li <?php echo $index == 0 ? 'class="active"' : '' ?>><a href="#message_language<?php echo $language['language_id'] . '_day' . $day; ?>" data-toggle="tab"> <?php if ((array_key_exists($day, $weekdays_array) == true)) {
                                     echo $weekdays_array[$day];
                                 } ?></a></li>
                                <?php endforeach; ?>
                            </ul>
                           <h5><strong><?php echo $popupcontent_text; ?>:</strong></h5>
                            <div class="tab-content">
                                <?php foreach ($popup_data['weekdays'] as $index => $day) : ?>
                                    <div class="tab-pane fade in <?php echo $index == 0 ? 'active' : '' ?>" id="message_language<?php echo $language['language_id'] . '_day' . $day; ?>">
                                        <textarea class="form-control summernote" id="message_<?php echo $popup['id']; ?>_language<?php echo $language['language_id'] . '_day' . $day; ?>" placeholder="<?php echo $placeholder_text; ?>" name="<?php echo $popup_name; ?>[content][<?php echo 'language' . $language['language_id']. '_day' . $day; ?>]">
                                            <?php if (!empty($popup_data['content']['language' . $language['language_id']. '_day' . $day])) {
                                                 echo $popup_data['content']['language' . $language['language_id']. '_day' . $day];
                                             } else {
                                                 echo '';
                                             } ?>
                                        </textarea>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    </div>
                    <?php $i++; endforeach; ?>
                </div>
            </div>
        </div>
        <script>
        $("ul.nav-tabs a").click(function (e) {
            e.preventDefault();
            $(this).tab('show');
            });
        </script>
    <?php
         } else {
             ?>
   <ul class="nav nav-tabs popup_tabs">
         <h5><?php echo $multilang_text; ?>:</h5>
         <?php $i=0;
             foreach ($languages as $language) {
                 ?>
         <li <?php if ($i==0) {
                     echo 'class="active"';
                 } ?>><a href="#tab-<?php echo $popup['id']; ?>-<?php echo $language['language_id']; ?>" data-toggle="tab"><img src="<?php echo $language['flag_url'] ?>"/> <?php echo $language['name']; ?></a></li>
         <?php $i++;
             } ?>
   </ul>
   <div class="tab-content">
   <?php $i=0;
             foreach ($languages as $language) {
                 ?>
   <div id="tab-<?php echo $popup['id']; ?>-<?php echo $language['language_id']; ?>" language-id="<?php echo $language['language_id']; ?>" class="row-fluid tab-pane language <?php if ($i==0) {
                     echo 'active';
                 } ?>">
      <div class="row">
         <div class="col-md-2">
            <h5><strong><?php echo $popupcontent_text; ?>:</strong></h5>
         </div>
         <div class="col-md-9">
            <textarea class="form-control summernote" id="message_<?php echo $popup['id']; ?>_<?php echo $language['language_id']; ?>" placeholder="<?php echo $placeholder_text; ?>" name="<?php echo $popup_name; ?>[content][<?php echo $language['language_id']; ?>]">
            <?php if (!empty($popup_data['content'][$language['language_id']])) {
                     echo $popup_data['content'][$language['language_id']];
                 } else {
                     echo '';
                 } ?>
            </textarea>
         </div>
      </div>
   </div>
   <?php $i++;
             } ?>
   </div>
   <?php
         } ?>
</div>
</div>
<script>
showHideStuff($('select[name="<?php echo $popup_name; ?>[content_type]"]'),$('#showHideHtmlContent_<?php echo $popup['id']; ?>'), 'html');
showHideStuff($('select[name="<?php echo $popup_name; ?>[content_type]"]'),$('#showHideYtdLink_<?php echo $popup['id']; ?>'), 'youtube');
showHideStuff($('select[name="<?php echo $popup_name; ?>[weekday_interval]"'),$('#weekday_input_<?php echo $popup['id']; ?>'), 'enable');
   function showHideStuff($typeSelector, $toggleArea, $selectStatus) {
       if ($typeSelector.val() === $selectStatus) {
           $toggleArea.show();
       } else {
           $toggleArea.hide();
       }
       $typeSelector.change(function(){
            if ($typeSelector.val() === $selectStatus) {
               $toggleArea.show(300);
            }
           else {
               $toggleArea.hide(300);
            }
       });
   }
</script>
