<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
    <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/module.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_back; ?></span></a><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a></div>
    </div>
    <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
          <div class="vtabs">
          <?php $module_row = 1; ?>
          <?php foreach ($modules as $module) { ?>
          <a class="title" title="<?php echo $module['title'][(int)$this->config->get('config_language_id')]; ?>
                    <?php foreach ($layouts as $layout) { ?>
                    <?php if ($layout['layout_id'] == $module['layout_id']) { ?>
             | <b><?php echo $entry_layout; ?> <?php echo $layout['name']; ?></b>
                    <?php } ?>
                    <?php } ?>
             <br />
             " href="#tab-module-<?php echo $module_row; ?>" id="module-<?php echo $module_row; ?>"><?php echo mb_substr(strip_tags(html_entity_decode($module['title'][(int)$this->config->get('config_language_id')], ENT_QUOTES, 'UTF-8')), 0, 18); ?>&nbsp;<img src="view/image/delete.png" alt="" onclick="$('#cluetip').css('display','none'); $('.vtabs a:first').trigger('click'); $('#module-<?php echo $module_row; ?>').remove(); $('#tab-module-<?php echo $module_row; ?>').remove(); return false;" /></a>
          <?php $module_row++; ?>
          <?php } ?>
          <span id="module-add"><?php echo $button_add_module; ?>&nbsp;<img src="view/image/add.png" alt="" onclick="addModule();" /></span> </div>
          <?php $module_row = 1; ?>
          <?php foreach ($modules as $module) { ?>
          <div id="tab-module-<?php echo $module_row; ?>" class="vtabs-content">
          <div id="language-<?php echo $module_row; ?>" class="htabs">
              
            <?php foreach ($languages as $language) { ?>
            <a href="#tab-language-<?php echo $module_row; ?>-<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
            <?php } ?>
          </div>
              
              
          <?php foreach ($languages as $language) { ?>
          <div id="tab-language-<?php echo $module_row; ?>-<?php echo $language['language_id']; ?>">
            <table class="form">
            <tr>
              <td><?php echo $entry_title; ?></td>
              <td><input type="text" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][title][<?php echo $language['language_id']; ?>]" value="<?php echo isset($module['title'][$language['language_id']]) ? $module['title'][$language['language_id']] : ''; ?>" size="80"  id="title-<?php echo $module_row; ?>-<?php echo $language['language_id']; ?>"/></td>
              <td>
                  &nbsp;
              </td>
            </tr>
            </table>
          </div>
          <?php } ?>
          <table class="form">
            <tr>
              <td><?php echo $entry_enabled; ?></td>
              <td>
                <input type="hidden" class="id" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][id]" value="<?php echo $module_row; ?>" />
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][status]">
                  <?php if ($module['status'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['status'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#enabled" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_layout; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][layout_id]">
                    <?php foreach ($layouts as $layout) { ?>
                    <?php if ($layout['layout_id'] == $module['layout_id']) { ?>
                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
                    <?php } ?>
                    <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#layout" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_initial_view; ?></td>
              <td><select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][initial_view]">
                  <?php if ($module['initial_view'] == 'list') { ?>
                  <option value="list" selected="selected"><?php echo $text_list; ?></option>
                  <?php } else { ?>
                  <option value="list"><?php echo $text_list; ?></option>
                  <?php } ?>
                  <?php if ($module['initial_view'] == 'grid') { ?>
                  <option value="grid" selected="selected"><?php echo $text_grid; ?></option>
                  <?php } else { ?>
                  <option value="grid"><?php echo $text_grid; ?></option>
                  <?php } ?>
              </select></td>
              <td align="left"><img src="view/image/info101.png" class="info" rel="#initial_view" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_view; ?></td>
              <td><select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][view]">
                  <?php if ($module['view'] == 'none') { ?>
                  <option value="none" selected="selected"><?php echo $text_none; ?></option>
                  <?php } else { ?>
                  <option value="none"><?php echo $text_none; ?></option>
                  <?php } ?>
                  <?php if ($module['view'] == 'grid') { ?>
                  <option value="grid" selected="selected"><?php echo $text_grid; ?></option>
                  <?php } else { ?>
                  <option value="grid"><?php echo $text_grid; ?></option>
                  <?php } ?>
                  <?php if ($module['view'] == 'list') { ?>
                  <option value="list" selected="selected"><?php echo $text_list; ?></option>
                  <?php } else { ?>
                  <option value="list"><?php echo $text_list; ?></option>
                  <?php } ?>
              </select></td>
              <td align="left"><img src="view/image/info101.png" class="info" rel="#view" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_wishlist; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][wishlist]">
                  <?php if ($module['wishlist'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['wishlist'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#wishlist" />
              </td>
            </tr>
            
            
            
            <tr>
              <td colspan="3"><h1><?php echo $title_group_label; ?></h1></td>
            </tr>
            <tr>
              <td><?php echo $entry_color; ?></td>
              <td><input type="text" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][group_label_color]" class="color" value="<?php echo $module['group_label_color']; ?>" style="background-color:<?php echo '#' .$module['group_label_color']; ?>;cursor:pointer;" /></td>
              <td><img src="view/image/info101.png" class="info" rel="#color" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_weight; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][group_label_weight]">
                  <?php if ($module['group_label_weight'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_normal; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_normal; ?></option>
                  <?php } ?>
                  <?php if ($module['group_label_weight'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_bold; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_bold; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_size; ?></td>
              <td>
                <div class="slide30 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 300px;">
                    <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b>px</span>
                    <a href="javascript:void(0)">
                        <div class="ui-slider-handle" style="left: 150px;"></div>
                    </a>
                    <input type="hidden" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][group_label_size]" value="<?php echo $module['group_label_size']; ?>" />
                </div>
              </td>
              <td align="left">
                  &nbsp;
              </td>
            </tr>
            
            
            
            
            <tr>
              <td colspan="3"><h1><?php echo $title_label; ?></h1></td>
            </tr>
            <tr>
              <td><?php echo $entry_color; ?></td>
              <td><input type="text" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][label_color]" class="color" value="<?php echo $module['label_color']; ?>" style="background-color:<?php echo '#' .$module['label_color']; ?>;cursor:pointer;" /></td>
              <td><img src="view/image/info101.png" class="info" rel="#color" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_weight; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][label_weight]">
                  <?php if ($module['label_weight'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_normal; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_normal; ?></option>
                  <?php } ?>
                  <?php if ($module['label_weight'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_bold; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_bold; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_size; ?></td>
              <td>
                <div class="slide30 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 300px;">
                    <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b>px</span>
                    <a href="javascript:void(0)">
                        <div class="ui-slider-handle" style="left: 150px;"></div>
                    </a>
                    <input type="hidden" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][label_size]" value="<?php echo $module['label_size']; ?>" />
                </div>
              </td>
              <td align="left">
                  &nbsp;
              </td>
            </tr>
            
            
            
            <tr>
              <td colspan="3"><h1><?php echo $title_value; ?></h1></td>
            </tr>
            <tr>
              <td><?php echo $entry_color; ?></td>
              <td><input type="text" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][value_color]" class="color" value="<?php echo $module['value_color']; ?>" style="background-color:<?php echo '#' .$module['value_color']; ?>;cursor:pointer;" /></td>
              <td><img src="view/image/info101.png" class="info" rel="#color" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_weight; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][value_weight]">
                  <?php if ($module['value_weight'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_normal; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_normal; ?></option>
                  <?php } ?>
                  <?php if ($module['value_weight'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_bold; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_bold; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_size; ?></td>
              <td>
                <div class="slide30 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 300px;">
                    <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b>px</span>
                    <a href="javascript:void(0)">
                        <div class="ui-slider-handle" style="left: 150px;"></div>
                    </a>
                    <input type="hidden" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][value_size]" value="<?php echo $module['value_size']; ?>" />
                </div>
              </td>
              <td align="left">
                  &nbsp;
              </td>
            </tr>
            
            
            
            <tr>
              <td colspan="3"><h1><?php echo $title_list; ?></h1></td>
            </tr>
            <tr>
              <td><?php echo $entry_position; ?></td>
              <td class="left"><select class="select_position" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_position]">
                <?php if ($module['list_position'] == 'name') { ?>
                <option value="name" selected="selected"><?php echo $text_name; ?></option>
                <?php } else { ?>
                <option value="name"><?php echo $text_name; ?></option>
                <?php } ?>
                <?php if ($module['list_position'] == 'description') { ?>
                <option value="description" selected="selected"><?php echo $text_description; ?></option>
                <?php } else { ?>
                <option value="description"><?php echo $text_description; ?></option>
                <?php } ?>
                <?php if ($module['list_position'] == 'price') { ?>
                <option value="price" selected="selected"><?php echo $text_price; ?></option>
                <?php } else { ?>
                <option value="price"><?php echo $text_price; ?></option>
                <?php } ?>
                <?php if ($module['list_position'] == 'rating') { ?>
                <option value="rating" selected="selected"><?php echo $text_rating; ?></option>
                <?php } else { ?>
                <option value="rating"><?php echo $text_rating; ?></option>
                <?php } ?>
                <?php if ($module['list_position'] == 'button') { ?>
                <option value="button" selected="selected"><?php echo $text_button; ?></option>
                <?php } else { ?>
                <option value="button"><?php echo $text_button; ?></option>
                <?php } ?>
                <?php if ($module['list_position'] == 'after_button') { ?>
                <option value="after_button" selected="selected"><?php echo $text_after_button; ?></option>
                <?php } else { ?>
                <option value="after_button"><?php echo $text_after_button; ?></option>
                <?php } ?>
              </select></td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#position" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_description; ?></td>
              <td>
                <div class="slide800 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 400px;">
                    <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b></span>
                    <a href="javascript:void(0)">
                        <div class="ui-slider-handle" style="left: 150px;"></div>
                    </a>
                    <input type="hidden" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_description]" value="<?php echo $module['list_description']; ?>" />
                </div>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#description" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_group_label; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_group_label]">
                  <?php if ($module['list_group_label'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['list_group_label'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#label" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_label; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_label]">
                  <?php if ($module['list_label'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['list_label'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#label" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_brand; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_brand]">
                  <?php if ($module['list_brand'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['list_brand'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_model; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_model]">
                  <?php if ($module['list_model'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['list_model'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_available; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][list_available]">
                  <?php if ($module['list_available'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['list_available'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            
            
            
            <tr>
              <td colspan="3"><h1><?php echo $title_grid; ?></h1></td>
            </tr>
            <tr>
              <td><?php echo $entry_position; ?></td>
              <td class="left"><select class="select_position" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_position]">
                <?php if ($module['grid_position'] == 'name') { ?>
                <option value="name" selected="selected"><?php echo $text_name; ?></option>
                <?php } else { ?>
                <option value="name"><?php echo $text_name; ?></option>
                <?php } ?>
                <?php if ($module['grid_position'] == 'description') { ?>
                <option value="description" selected="selected"><?php echo $text_description; ?></option>
                <?php } else { ?>
                <option value="description"><?php echo $text_description; ?></option>
                <?php } ?>
                <?php if ($module['grid_position'] == 'price') { ?>
                <option value="price" selected="selected"><?php echo $text_price; ?></option>
                <?php } else { ?>
                <option value="price"><?php echo $text_price; ?></option>
                <?php } ?>
                <?php if ($module['grid_position'] == 'rating') { ?>
                <option value="rating" selected="selected"><?php echo $text_rating; ?></option>
                <?php } else { ?>
                <option value="rating"><?php echo $text_rating; ?></option>
                <?php } ?>
                <?php if ($module['grid_position'] == 'button') { ?>
                <option value="button" selected="selected"><?php echo $text_button; ?></option>
                <?php } else { ?>
                <option value="button"><?php echo $text_button; ?></option>
                <?php } ?>
                <?php if ($module['grid_position'] == 'after_button') { ?>
                <option value="after_button" selected="selected"><?php echo $text_after_button; ?></option>
                <?php } else { ?>
                <option value="after_button"><?php echo $text_after_button; ?></option>
                <?php } ?>
              </select></td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#position" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_description; ?></td>
              <td>
                <div class="slide800 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 400px;">
                    <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b></span>
                    <a href="javascript:void(0)">
                        <div class="ui-slider-handle" style="left: 150px;"></div>
                    </a>
                    <input type="hidden" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_description]" value="<?php echo $module['grid_description']; ?>" />
                </div>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#description" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_group_label; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_group_label]">
                  <?php if ($module['grid_group_label'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['grid_group_label'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#label" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_label; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_label]">
                  <?php if ($module['grid_label'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['grid_label'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#label" />
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_brand; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_brand]">
                  <?php if ($module['grid_brand'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['grid_brand'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_model; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_model]">
                  <?php if ($module['grid_model'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['grid_model'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_available; ?></td>
              <td>
                <select name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][grid_available]">
                  <?php if ($module['grid_available'] == '1') { ?>
                  <option value="1" selected="selected"><?php echo $text_true; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_true; ?></option>
                  <?php } ?>
                  <?php if ($module['grid_available'] == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_false; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_false; ?></option>
                  <?php } ?>
                </select>
              </td>
              <td align="left">
              </td>
            </tr>
            
            
            <tr>
              <td colspan="3"><h1><?php echo $title_attributes; ?></h1></td>
            </tr>
            <tr>
              <td><?php echo $entry_attributes; ?></td>
              <td><input type="text" name="attribute_group" rel="grid" value="" /></td>
              <td align="left">
              </td>
            </tr>
            <tr>
              <td><?php $cnt = 0; ?></td>
              <td><div class="scrollbox" id="attribute_group_box">
                  <?php $class = 'odd'; ?>
                  <?php foreach ($module['attribute_groups'] as $attribute_group) { ?>
                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                  <div id="attribute_group<?php echo $cnt; ?>" class="<?php echo $class; ?>"> <?php echo urldecode($attribute_group['label']); ?> ( <?php echo $attribute_group['value']; ?> )<img src="view/image/delete.png" />
                    <input type="hidden" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][attribute_groups][]" value="<?php echo $attribute_group['value']; ?>" />
                  </div>
                  <?php $cnt++; } ?>
                </div>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#attribute_group" />
              </td>
            </tr>
            <tr>
              <td><?php echo $title_attributes; $cnt = 0; ?></td>
              <td><div class="scrollbox" id="attributes_box">
                  <?php $class = 'odd'; ?>
                  <?php foreach ($module['attributes'] as $attribute) { ?>
                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                  <div id="attributes<?php echo $cnt; ?>" class="<?php echo $class; ?>">
                      <?php if (in_array($attribute[0], $module['attribute'])) { ?>
                        <input checked="checked" type="checkbox" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][attribute][]" value="<?php echo $attribute[0]; ?>" /> <?php echo urldecode($attribute[1]); ?>
                      <?php } else { ?>
                        <input type="checkbox" name="<?php echo $module_name; ?>[<?php echo $module_row; ?>][attribute][]" value="<?php echo $attribute[0]; ?>" /> <?php echo urldecode($attribute[1]); ?>
                      <?php } ?>
                  </div>
                  <?php $cnt++; } ?>
                </div>
              </td>
              <td align="left">
                  <img src="view/image/info101.png" class="info" rel="#attribute" />
              </td>
            </tr>
          </table>
          </div>
        <?php $module_row++; ?>
        <?php } ?>
      </form>
    </div>
  </div>
</div>
<?php foreach ($description as $key => $val) {?>
    <div id="<?php echo $key; ?>" style="display:none;"><?php echo $val; ?></div>
<?php } ?>
<?php $module_row = sizeof($modules) + 1; ?> 
<script type="text/javascript"><!--
var module_row = <?php echo $module_row; ?>;
//--></script>
<script type="text/javascript"><!--
$(document).ready(function() {
    var href = $('.vtabs .selected').attr('href');
    var pass = $('#form').find(href);
    addFunctions(pass);
});

$('.vtabs a').mousedown(function() {
    var href = $(this).attr('href');
    var pass = $('#form').find(href);
    addFunctions(pass);
});

$('.info_button').cluetip({showTitle:false,local:true,truncate:0,width:450,sticky:false,clickThrough:true,arrows:true,hideLocal:true,positionBy:'auto'});
$('a.title').cluetip({splitTitle: '|'});

function addFunctions (where) {
    $('.slide10',where).slider({ step: .1, min: 0, max: 1,
        create: function(event, ui) { 
            var val = $('input', this).val();
            $(this).slider( "option", "value", val );
            $('span b', this).html(val);
        },
        slide: function(event, ui) {
            $('span b', this).html(ui.value);
            $('input', this).val(ui.value); } 
    });
    
    $('.slide30',where).slider({ step: 1, min: 0, max: 30,
        create: function(event, ui) { 
            var val = $('input', this).val();
            $(this).slider( "option", "value", val );
            $('span b', this).html(val);
        },
        slide: function(event, ui) {
            $('span b', this).html(ui.value);
            $('input', this).val(ui.value); } 
    });
    
    $('.slide100',where).slider({ step: 1, min: 0, max: 100,
        create: function(event, ui) { 
            var val = $('input', this).val();
            $(this).slider( "option", "value", val );
            $('span b', this).html(val);
        },
        slide: function(event, ui) {
            $('span b', this).html(ui.value);
            $('input', this).val(ui.value); } 
    });
    
    $('.slide200',where).slider({ step: 1, min: 0, max: 200,
        create: function(event, ui) { 
            var val = $('input', this).val();
            $(this).slider( "option", "value", val );
            $('span b', this).html(val);
        },
        slide: function(event, ui) {
            $('span b', this).html(ui.value);
            $('input', this).val(ui.value); } 
    });
    
    $('.slide400',where).slider({ step: 1, min: 0, max: 400,
        create: function(event, ui) { 
            var val = $('input', this).val();
            $(this).slider( "option", "value", val );
            $('span b', this).html(val);
        },
        slide: function(event, ui) {
            $('span b', this).html(ui.value);
            $('input', this).val(ui.value); } 
    });
    
    $('.slide800',where).slider({ step: 2, min: 0, max: 800,
        create: function(event, ui) { 
            var val = $('input', this).val();
            $(this).slider( "option", "value", val );
            $('span b', this).html(val);
        },
        slide: function(event, ui) {
            $('span b', this).html(ui.value);
            $('input', this).val(ui.value); } 
    });

    $('.color',where).ColorPicker({
            onSubmit: function(hsb, hex, rgb, el) {
                    $(el).val(hex);
                    $(el).css("background-color", "#" + hex);
                    $(el).ColorPickerHide();
            },
            onBeforeShow: function () {
                    $(this).ColorPickerSetColor(this.value);
            }
    })
    .bind('keyup', function(){
            $(this).ColorPickerSetColor(this.value);
    });
    
    $('input[name=\'attribute_group\']', where).autocomplete({
	delay: 0,
	source: function(request, response) {
		$.ajax({
			url: 'index.php?route=module/<?php echo $module_name; ?>/autocompleteAttr&token=<?php echo $token; ?>&filter=' +  encodeURIComponent(request.term),
			dataType: 'json',
			success: function(json) {		
				response($.map(json, function(item) {
					return {
						label: item.name,
                                                value: item.attribute_group_id,
                                                attributes: item.attributes
					}
				}));
			}
		});
		
	}, 
	select: function(event, ui) {
		$('#attribute_group' + ui.item.value, where).remove();
		var this_module_row = where.find('.id').val();
		$('#attribute_group_box', where).append('<div id="attribute_group' + ui.item.value + '">' + ui.item.label + ' ( ' + ui.item.value + ' )<img src="view/image/delete.png" style="cursor:pointer;" /><input type="hidden" name="<?php echo $module_name; ?>[' + this_module_row + '][attribute_groups][]" value="' + encodeURIComponent(ui.item.value) + '" /></div>');

		$('#attribute_group_box div:odd', where).attr('class', 'odd');
		$('#attribute_group_box div:even', where).attr('class', 'even');
		
                $(ui.item.attributes).each(function(k,v) {
                    $('#attributes_box', where).append('<div id="attributes' + v[1] + '"><input type="checkbox" name="<?php echo $module_name; ?>[' + this_module_row + '][attribute][]" value="' + encodeURIComponent(v[1]) + '" /> ' + v[2] + '</div>');
                });
                
		return false;
	}
    });

    $('#attribute_group_box div img',where).live('click', function() {
	$(this).parent().remove();
	
	$(this).parent().find('div:odd').attr('class', 'odd');
	$(this).parent().find('div:even').attr('class', 'even');	
    });

    $('img.info',where).cluetip({showTitle:false,local:true,truncate:0,width:450,sticky:false,clickThrough:false,arrows:true,hideLocal:true,positionBy:'auto'});
    $('a.title',where).cluetip({splitTitle: '|'});
    
    var background = '';
    $('tbody tr:not(.filter)',where).unbind('mouseenter').bind('mouseenter', function() {
    background = $("td",this).css("background-color");
    $("td",this).css("background-color", "#EFEFEF");
    }).unbind('mouseleave').bind('mouseleave', function(){
    $("td",this).css("background-color", background);
    });
    
    where.unbind('mousedown');
}

function addModule() {	
	html  = '<div id="tab-module-' + module_row + '" class="vtabs-content">';
	html += '  <div id="language-' + module_row + '" class="htabs">';
        <?php foreach ($languages as $language) { ?>
        html += '    <a href="#tab-language-'+ module_row + '-<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>';
        <?php } ?>
	html += '  </div>';
	<?php foreach ($languages as $language) { ?> 
	html += '    <div id="tab-language-'+ module_row + '-<?php echo $language['language_id']; ?>">';
	html += '      <table class="form">';
	html += '        <tr>';
	html += '          <td><?php echo $entry_title; ?></td>';
	html += '          <td><input type="text" name="<?php echo $module_name; ?>[' + module_row + '][title][<?php echo $language['language_id']; ?>]" value="" size="80"  id="title-' + module_row + '-<?php echo $language['language_id']; ?>"/></td>';
        html += '      <td align="left">&nbsp;</td>';
        html += '        </tr>';
	html += '      </table>';
	html += '    </div>';
	<?php } ?>
	html += '  <table class="form">';
        html += '    <tr>';
	html += '      <td><?php echo $entry_enabled; ?></td>';
        html += '      <td><input class="id" type="hidden" name="<?php echo $module_name; ?>[' + module_row + '][id]" value="' + module_row + '" /><select name="<?php echo $module_name; ?>[' + module_row + '][status]">';
	html += '           <option value="1"><?php echo $text_true; ?></option>';
        html += '           <option value="0" selected="selected"><?php echo $text_false; ?></option>';
	html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#enabled" /></td>';
	html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_layout; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][layout_id]">';
	<?php foreach ($layouts as $layout) { ?>
	html += '      <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>';
	<?php } ?>
	html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#layout" /></td>';
	html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_initial_view; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][initial_view]">';
        html += '           <option value="list"><?php echo $text_list; ?></option>';
        html += '           <option value="grid"><?php echo $text_grid; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#initial_view" /></td>';
        html += '    </tr>';
        html += '      <td><?php echo $entry_view; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][view]">';
        html += '           <option value="none" selected="selected"><?php echo $text_none; ?></option>';
        html += '           <option value="grid"><?php echo $text_grid; ?></option>';
        html += '           <option value="list"><?php echo $text_list; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#view" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_wishlist; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][wishlist]">';
        html += '           <option value="1"><?php echo $text_true; ?></option>';
        html += '           <option value="0" selected="selected"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#wishlist" /></td>';
        html += '    </tr>';
        
        
        
        html += '    <tr>';
        html += '      <td colspan="3"><h1><?php echo $title_group_label; ?></h1></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_color; ?></td>';
        html += '      <td><input type="text" name="<?php echo $module_name; ?>[' + module_row + '][group_label_color]" class="color" value="606175" style="background-color:#606175;cursor:pointer;" /></td>';
        html += '      <td><img src="view/image/info101.png" class="info" rel="#color" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_weight; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][group_label_weight]">';
        html += '           <option value="1" selected="selected"><?php echo $text_normal; ?></option>';
        html += '           <option value="0"><?php echo $text_bold; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_size; ?></td>';
        html += '      <td>';
        html += '        <div class="slide30 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 300px;">';
        html += '            <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b>px</span>';
        html += '            <a href="javascript:void(0)">';
        html += '                <div class="ui-slider-handle" style="left: 150px;"></div>';
        html += '            </a>';
        html += '           <input type="hidden" name="<?php echo $module_name; ?>[' + module_row + '][group_label_size]" value="16" />';
        html += '        </div>';
	html += '      </td>';
        html += '      <td align="left">&nbsp;</td>';
	html += '    </tr>';
        
        
        
        html += '    <tr>';
        html += '      <td colspan="3"><h1><?php echo $title_label; ?></h1></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_color; ?></td>';
        html += '      <td><input type="text" name="<?php echo $module_name; ?>[' + module_row + '][label_color]" class="color" value="606175" style="background-color:#606175;cursor:pointer;" /></td>';
        html += '      <td><img src="view/image/info101.png" class="info" rel="#color" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_weight; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][label_weight]">';
        html += '           <option value="1" selected="selected"><?php echo $text_normal; ?></option>';
        html += '           <option value="0"><?php echo $text_bold; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_size; ?></td>';
        html += '      <td>';
        html += '        <div class="slide30 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 300px;">';
        html += '            <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b>px</span>';
        html += '            <a href="javascript:void(0)">';
        html += '                <div class="ui-slider-handle" style="left: 150px;"></div>';
        html += '            </a>';
        html += '           <input type="hidden" name="<?php echo $module_name; ?>[' + module_row + '][label_size]" value="16" />';
        html += '        </div>';
	html += '      </td>';
        html += '      <td align="left">&nbsp;</td>';
	html += '    </tr>';
        
        
        
        html += '    <tr>';
        html += '      <td colspan="3"><h1><?php echo $title_value; ?></h1></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_color; ?></td>';
        html += '      <td><input type="text" name="<?php echo $module_name; ?>[' + module_row + '][value_color]" class="color" value="606175" style="background-color:#606175;cursor:pointer;" /></td>';
        html += '      <td><img src="view/image/info101.png" class="info" rel="#color" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_weight; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][value_weight]">';
        html += '           <option value="1" selected="selected"><?php echo $text_normal; ?></option>';
        html += '           <option value="0"><?php echo $text_bold; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_size; ?></td>';
        html += '      <td>';
        html += '        <div class="slide30 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 300px;">';
        html += '            <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b>px</span>';
        html += '            <a href="javascript:void(0)">';
        html += '                <div class="ui-slider-handle" style="left: 150px;"></div>';
        html += '            </a>';
        html += '           <input type="hidden" name="<?php echo $module_name; ?>[' + module_row + '][value_size]" value="16" />';
        html += '        </div>';
	html += '      </td>';
        html += '      <td align="left">&nbsp;</td>';
	html += '    </tr>';
        
        
        
        html += '    <tr>';
        html += '      <td colspan="3"><h1><?php echo $title_list; ?></h1></td>';
        html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_position; ?></td>';
        html += '      <td><select class="select_position" name="<?php echo $module_name; ?>[' + module_row + '][list_position]">';
	html += '       <option value="name"><?php echo $text_name; ?></option>';
	html += '       <option value="description"><?php echo $text_description; ?></option>';
	html += '       <option value="price"><?php echo $text_price; ?></option>';
        html += '       <option value="rating"><?php echo $text_rating; ?></option>';
        html += '       <option value="button"><?php echo $text_button; ?></option>';
        html += '       <option value="after_button"><?php echo $text_after_button; ?></option>';
	html += '       </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#position" /></td>';
	html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_description; ?></td>';
        html += '      <td>';
        html += '        <div class="slide800 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 400px;">';
        html += '            <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b></span>';
        html += '            <a href="javascript:void(0)">';
        html += '                <div class="ui-slider-handle" style="left: 150px;"></div>';
        html += '            </a>';
        html += '           <input type="hidden" name="<?php echo $module_name; ?>[' + module_row + '][list_description]" value="150" />';
        html += '        </div>';
	html += '      </td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#description" /></td>';
	html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_group_label; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][list_group_label]">';
        html += '           <option value="1"><?php echo $text_true; ?></option>';
        html += '           <option value="0" selected="selected"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#label" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_label; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][list_label]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#label" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_brand; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][list_brand]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_model; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][list_model]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_available; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][list_available]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        
        
        
        html += '    <tr>';
        html += '      <td colspan="3"><h1><?php echo $title_grid; ?></h1></td>';
        html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_position; ?></td>';
        html += '      <td><select class="select_position" name="<?php echo $module_name; ?>[' + module_row + '][grid_position]">';
	html += '       <option value="name"><?php echo $text_name; ?></option>';
	html += '       <option value="description"><?php echo $text_description; ?></option>';
	html += '       <option value="price"><?php echo $text_price; ?></option>';
        html += '       <option value="rating"><?php echo $text_rating; ?></option>';
        html += '       <option value="button"><?php echo $text_button; ?></option>';
        html += '       <option value="after_button"><?php echo $text_after_button; ?></option>';
	html += '       </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#position" /></td>';
	html += '    </tr>';
        html += '    <tr>';
	html += '      <td><?php echo $entry_description; ?></td>';
        html += '      <td>';
        html += '        <div class="slide800 ui-slider-1 ui-slider" style="margin: 15px 50px; width: 400px;">';
        html += '            <span style="position: relative; left: -50px; bottom: 5px;"><b>0</b></span>';
        html += '            <a href="javascript:void(0)">';
        html += '                <div class="ui-slider-handle" style="left: 150px;"></div>';
        html += '            </a>';
        html += '           <input type="hidden" name="<?php echo $module_name; ?>[' + module_row + '][grid_description]" value="20" />';
        html += '        </div>';
	html += '      </td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#description" /></td>';
	html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_group_label; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][grid_group_label]">';
        html += '           <option value="1"><?php echo $text_true; ?></option>';
        html += '           <option value="0" selected="selected"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#label" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_label; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][grid_label]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"><img src="view/image/info101.png" class="info" rel="#label" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_brand; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][grid_brand]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_model; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][grid_model]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '      <td><?php echo $entry_available; ?></td>';
        html += '      <td><select name="<?php echo $module_name; ?>[' + module_row + '][grid_available]">';
        html += '           <option value="1" selected="selected"><?php echo $text_true; ?></option>';
        html += '           <option value="0"><?php echo $text_false; ?></option>';
        html += '      </select></td>';
        html += '      <td align="left"></td>';
        html += '    </tr>';
        
        html += '    <tr>';
        html += '      <td colspan="3"><h1><?php echo $title_attributes; ?></h1></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '          <td><?php echo $entry_attributes; ?></td>';
        html += '          <td><input type="text" name="attribute_group" rel="grid" value="" /></td>';
        html += '          <td></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '          <td></td>';
        html += '          <td><div class="scrollbox" id="attribute_group_box">';
        html += '            </div></td>';
        html += '          <td><img src="view/image/info101.png" class="info" rel="#attribute_group" /></td>';
        html += '    </tr>';
        html += '    <tr>';
        html += '          <td><?php echo $title_attributes; ?></td>';
        html += '          <td><div class="scrollbox" id="attributes_box">';
        html += '            </div></td>';
        html += '          <td><img src="view/image/info101.png" class="info" rel="#attribute" /></td>';
        html += '    </tr>';
        
        
        
	html += '  </table>'; 
	html += '</div>';
	
	$('#form').append(html);
	
	$('#language-' + module_row + ' a').tabs();
	
	$('#module-add').before('<a href="#tab-module-' + module_row + '" id="module-' + module_row + '"><?php echo $tab_module; ?> ' + module_row + '&nbsp;<img src="view/image/delete.png" alt="" onclick="$(\'.vtabs a:first\').trigger(\'click\'); $(\'#module-' + module_row + '\').remove(); $(\'#tab-module-' + module_row + '\').remove(); return false;" /></a>');
	
	$('.vtabs a').tabs();
	
	$('#module-' + module_row).trigger('click');
	
        var pass = $('#form').find('#tab-module-' + module_row);
        addFunctions(pass);
        
	module_row++;
}
//--></script> 
<script type="text/javascript"><!--
$('.vtabs a').tabs();
//--></script> 
<script type="text/javascript"><!--
<?php $module_row = 1; ?>
<?php foreach ($modules as $module) { ?>
$('#language-<?php echo $module_row; ?> a').tabs();
<?php $module_row++; ?>
<?php } ?> 
//--></script> 
<?php echo $footer; ?>