{ if $myobj->isShowPageBlock('block_list_advertisement')}
<div id="selMsgConfirm" class="clsPopupConfirmation"  style="display:none;position:absolute;">
  <form name="deleteForm" id="deleteForm" method="post" action="{$myobj->getCurrentUrl()}">
	<table class="clsCommonTable">
		<tr>
		  <td colspan="2"> <h3 id="confirmation_msg"></h3></td>
		</tr>
		<tr>
		  <td>
			 <input type="submit" class="clsSubmitButton" name="delete_add" id="delete_add" value="{$LANG.common_yes_option}" tabindex="{smartyTabIndex}" />
			 <input type="button" class="clsCancelButton" name="cancel" id="cancel1" value="{$LANG.common_no_option}" tabindex="{smartyTabIndex}" onclick="return hideAllBlocks('selListAdvertisementForm');" />
		  </td>
		  <td>{$myobj->populateHidden($myobj->deleteForm_hidden_arr)}
		  </td>
		</tr>
	</table>
 </form>
</div>
<div id="selCodeForm" class="clsAdminPopUpWindow" style="display:none;position:absolute;">
	<div class="clsClosePopUp"> <p class="clsPopupClose"><a href="{$myobj->getCurrentUrl()}" onClick="return hideAllBlocks();" title="{$LANG.manage_banner_close}">{$LANG.manage_banner_close}</a></p></div>
  <h2 id="codeTitle"></h2>
  <form name="codeForm" id="codeForm" method="post" action="{$myobj->getCurrentUrl()}">
        <!-- clsFormSection - starts here -->
    {include file='../general/box.tpl' opt='form_top'}
    <div class="clsFormSection">

      <div class="clsFormRow">
        <div class="clsFormFieldCellDefault">
          <textarea name="addCode" id="addCode" rows="2" cols="50"  onfocus="this.select()" onclick="this.select()" readonly></textarea>
        </div>
      </div>
      <div class="clsFormRow">
        <div class="clsFormLabelCellDefault">
          <p>{$LANG.manage_banner_code_instruction}</p>
        </div>
      </div>
    </div>
    {include file='../general/box.tpl' opt='form_bottom'}
    <!-- clsFormSection - ends here -->
  </form>
</div>
{/if}
{ if $myobj->isShowPageBlock('block_list_advertisement') or $myobj->isShowPageBlock('block_add_advertisement')}
<div id="selMsgPreviewWindow" class="clsAdminPopUpWindow selMsgConfirm" style="display:none;position:absolute;">
 <div class="clsClosePopUp" style="width:60px;height:30px;">
	 <p class="clsPopupClose" >
	 <a href="{$myobj->getCurrentUrl()}" onClick="return hideAllBlocks();" title="{$LANG.manage_banner_close}">{$LANG.manage_banner_close}</a>
	 </p>
 </div>
  <form name="previewForm" id="previewForm" method="post" action="{$myobj->getCurrentUrl()}">
	<p id="selPreviewBanner">sadfjksdafjlhsdfh sadfjhsd fkjsdfh sdfkhjkh</p>
  </form>
</div>
{/if}
<div id="selAdvertisement">
  <h2><span>{$LANG.manage_banner_title}</span></h2>
  {include file='../general/information.tpl'}
  { if $myobj->isShowPageBlock('block_add_advertisement')}
  <h3>{$myobj->manage_banner_title}</h3>
  <div id="selAddAdvertisementBlock">
    <form name="selAddAdvertisementForm" id="selAddAdvertisementForm" method="post" action="{$myobj->getCurrentUrl($myobj->getFormField('act'))}">
          <!-- clsFormSection - starts here -->
    {include file='../general/box.tpl' opt='form_top'}
    <table class="clsFormSection">

        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('block')}">
            <label for="block">{$LANG.manage_banner_banner_position}<span>*</span></label>{$myobj->ShowHelpTip('banner_block', 'block')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('block')}">
            <input type="text" class="clsTextBox" name="block" id="block" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('block')}" />{$myobj->getFormFieldElementErrorTip('block')}
            <p class="clsHelpBanner"><a href="#" onclick="return popupWindow('{$CFG.site.url}bannerPosition.php', '600', '500')">{$LANG.manage_banner_banner_position}</a></p>
            <p>{$LANG.manage_banner_default_postion}&nbsp;{$myobj->populatePosition($LANG_LIST_ARR.banner_list)}</p>
          </td>
        </tr>
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('source')}">
            <label for="source">{$LANG.manage_banner_label_source}<span>*</span></label>{$myobj->ShowHelpTip('banner_html_source', 'source')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('source')}">
            <textarea name="source" id="source" tabindex="{smartyTabIndex}">{$myobj->getFormField('source')}</textarea> {$myobj->getFormFieldElementErrorTip('source')}
            <p><a href="javascript:void(0)" onclick="{$myobj->confrimation_preview_onclick}">{$LANG.manage_banner_preview}</a></p>
          </td>
        </tr>
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('about')}">
            <label for="about">{$LANG.manage_banner_label_about}<span>*</span></label>{$myobj->ShowHelpTip('banner_about_advertisement', 'about')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('about')}">
            <textarea name="about" id="about" tabindex="{smartyTabIndex}">{$myobj->getFormField('about')}</textarea> {$myobj->getFormFieldElementErrorTip('about')}
          </td>
        </tr>
        {if $CFG.admin.banner.impressions_date}
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('start_date')}">
            <label for="start_date">{$LANG.manage_banner_label_start_date}<span>*</span></label>{$myobj->ShowHelpTip('banner_start_date', 'start_date')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('start_date')}">
            <input type="text" class="clsTextBox" name="start_date" id="start_date" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('start_date')}" readonly /> &nbsp;<button class="clsSubmitButton" type="reset" id="f_trigger_start_date">...</button>
            {$myobj->populateCalendar('start_date', 'f_trigger_start_date', true)}{$myobj->getFormFieldElementErrorTip('start_date')} </td>
        </tr>
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('end_date')}">
            <label for="end_date">{$LANG.manage_banner_label_end_date}<span>*</span></label>{$myobj->ShowHelpTip('banner_end_date', 'end_date')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('end_date')}">
            <input type="text" class="clsTextBox" name="end_date" id="end_date" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('end_date')}" readonly />            &nbsp;<button class="clsSubmitButton" type="reset" id="f_trigger_end_date">...</button>
            {$myobj->populateCalendar('end_date', 'f_trigger_end_date', true)} {$myobj->getFormFieldElementErrorTip('end_date')}</td>
       </tr>
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('allowed_impressions')}">
            <label for="allowed_impressions">{$LANG.manage_banner_label_allowed_impressions}</label>{$myobj->ShowHelpTip('banner_allowed_impressions', 'allowed_impressions')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('allowed_impressions')}">
            <input type="text" class="clsTextBox" name="allowed_impressions" id="allowed_impressions" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('allowed_impressions')}" />{$myobj->getFormFieldElementErrorTip('allowed_impressions')}
          	<p>{$LANG.manage_banner_impression_note}</p>
          </td>
        </tr>
        {/if}
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('status')}">
            <label for="status1">{$LANG.common_status}</label> {$myobj->ShowHelpTip('status', 'status')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('status')}">
            <input type="radio" class="clsRadioButton" name="status" id="status_opt_1" tabindex="{smartyTabIndex}" value="activate"{$myobj->isCheckedRadio('status', 'activate')} />
            <label for="status_opt_1">{$LANG.common_activate}</label>
            <input type="radio" class="clsRadioButton" name="status" id="status_opt_2" tabindex="{smartyTabIndex}" value="toactivate"{$myobj->isCheckedRadio('status', 'toactivate')} />
            <label for="status_opt_2">{$LANG.common_inactivate}</label>{$myobj->getFormFieldElementErrorTip('status')}
          </td>
       </tr>
        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('default')}">
          <td class="{$myobj->getCSSFormFieldCellClass('default')}">
            { if $myobj->isShowPageBlock('block_edit_advertisement')}
            {$myobj->populateHidden($myobj->selAddAdvertisementForm_hidden_arr1)}
            <input type="submit" class="clsSubmitButton" name="update_submit" id="update_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_update}" />
            <input type="submit" class="clsSubmitButton" name="cancel_submit" id="cancel_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_cancel}" />
            {else}
            <input type="submit" class="clsSubmitButton" name="add_submit" id="add_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_add}" />
            {/if} </td>
		 </tr>
        </table>
     {$myobj->populateHidden($myobj->selAddAdvertisementForm_hidden_arr)}
    {include file='../general/box.tpl' opt='form_bottom'}
    <!-- clsFormSection - ends here -->
    </form>
  </div>
    	    	   {literal}
			    	   <script language="javascript" type="text/javascript">
					needLiveValidation('block',Array('Presence'));
					needLiveValidation('source',Array('Presence'));
					needLiveValidation('about',Array('Presence'));
					needLiveValidation('allowed_impressions',Array('Numericality'));
				   </script>
  		   {/literal}
  {/if}
  { if $myobj->isShowPageBlock('block_search')}
  <div id="selSearchBlock">
   <h3>{$LANG.manage_banner_page_search_title}</h3>
  <form name="selSearchForm" id="selSearchForm" method="post" action="{$myobj->getCurrentUrl()}">
          <!-- clsFormSection - starts here -->
    {include file='../general/box.tpl' opt='form_top'}
    <table id="search_banner" class="clsFormSection">

        <tr class="clsFormRow">
          <td class="{$myobj->getCSSFormLabelCellClass('name')}">
            <label for="name">{$LANG.manage_banner_label_user_name}</label> {$myobj->ShowHelpTip('banner_post_by', 'name')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('name')}">
            <input type="text" class="clsTextBox" name="name" id="name" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('name')}" /> {$myobj->getFormFieldElementErrorTip('name')}
          </td>

		  </tr>
          <tr class="clsFormRow">
        <td class="{$myobj->getCSSFormLabelCellClass('block_search')}">
            <label for="block_search">{$LANG.manage_banner_banner_position}</label>{$myobj->ShowHelpTip('banner_block', 'block_search')}
          </td>
          <td class="{$myobj->getCSSFormFieldCellClass('block_search')}">
            <input type="text" class="clsTextBox" name="block_search" id="block_search" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('block_search')}" /> {$myobj->getFormFieldElementErrorTip('block_search')}
          </td>

	 </tr>
	 <tr class="clsFormRow"> <td>&nbsp;</td>    <td class="{$myobj->getCSSFormFieldCellClass('default')}">
            <input type="submit" class="clsSubmitButton" name="search_submit" id="search_submit" tabindex="{smartyTabIndex}" value="{$LANG.search}" />
			<input type="reset" class="clsCancelButton" name="reset_submit" id="reset_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_reset}" />
          </td>
        </tr>
      </table>
     {include file='../general/box.tpl' opt='form_bottom'}
    <!-- clsFormSection - ends here -->
   </form>
  </div>
  {/if}
  { if $myobj->isShowPageBlock('block_list_advertisement')}
  <div>
  {if $CFG.admin.navigation.top}
    {include file='../general/pagination.tpl'}
    {/if}
    <form name="selListAdvertisementForm" id="selListAdvertisementForm" method="post" action="{$myobj->getCurrentUrl()}">
          <!-- clsDataDisplaySection - starts here -->
	{include file='../general/box.tpl' opt='data_top'}
    <table class="clsDataDisplaySection">

            <tr>
<th class="clsSelectColumn"><input type="checkbox" class="clsCheckBox" name="check_all" onclick= "CheckAll(document.selListAdvertisementForm.name, document.selListAdvertisementForm.check_all.name)" tabindex="{smartyTabIndex}" /></th>
            <th class="clsBanner{$myobj->getOrderCss('block')}"><a href="#" onclick="return changeOrderbyElements('selListAdvertisementForm','block')">{$LANG.manage_banner_banner_position}</a></th>
            <th class="clsBannerDescription{$myobj->getOrderCss('about')}"><a href="#" onclick="return changeOrderbyElements('selListAdvertisementForm','about')">{$LANG.manage_banner_th_about}</a></th>
            {if $CFG.admin.banner.impressions_date}
            <th><span>{$LANG.manage_banner_allowed_impressions}</span> / <span>{$LANG.manage_banner_completed_impressions}</span></th>
            {/if}
            <th>{$LANG.manage_banner_th_added_by}</a></th>
            <th class="clsBannerDescription{$myobj->getOrderCss('status')}"><a href="#" onclick="return changeOrderbyElements('selListAdvertisementForm','status')">{$LANG.common_status}</a></th>
             <th class="clsDateColumn"><p>{$LANG.manage_banner_th_start_date}</p>
            <p>{$LANG.manage_banner_th_end_date}</p>
           <p>{$LANG.common_date_added}</p></th>
            <th>{$LANG.common_action}</th>
</tr>

       {foreach key=inc item=value from=$populateAdds_arr}
          <tr class="clsDataRow {$myobj->getCSSRowClass()}">

 <td class="clsSelectColumn">
              <input type="checkbox" class="clsCheckBox" name="aid[]" value="{$populateAdds_arr.$inc.add_id}"  onClick="disableHeading('selListAdvertisementForm');"  tabindex="{smartyTabIndex}" />
            </td>
            <td>{$populateAdds_arr.$inc.block}</td>
            <td class="clsBannerDescription">{$populateAdds_arr.$inc.about}</td>
            {if $CFG.admin.banner.impressions_date}
            <td><span>{$populateAdds_arr.$inc.allowed_impressions}</span> /
            <span>{$populateAdds_arr.$inc.completed_impressions}</span></td>
            {/if}
            <td><a href="{$populateAdds_arr.$inc.profile_link}">{$populateAdds_arr.$inc.name}</a></td>
            <td>{$populateAdds_arr.$inc.status}</td>
            <td class="clsDateColumn">            <p>{$populateAdds_arr.$inc.start_date}</p>
            <p>{$populateAdds_arr.$inc.end_date}</p>
<p>{$populateAdds_arr.$inc.date_added}</p></td>
            <td> <a href="{$populateAdds_arr.$inc.edit_link}">{$LANG.common_edit}</a>
              <div class="clsPreviewBanner" id="selPreview{$populateAdds_arr.$inc.add_id}" style="display:none;position:absolute">{$populateAdds_arr.$inc.source}</div>
              <a href="#" onClick="{$populateAdds_arr.$inc.preview_onclick}">{$LANG.manage_banner_preview}</a> <a href="#" onclick="return populateCode('{$populateAdds_arr.$inc.block}')">{$LANG.manage_banner_code}</a> </td>

          </tr>
          {/foreach}
        <tr class="clsDataRow clsBottomDataRow">

            <td colspan="8" class="clsButtonAlignment"><input type="button" class="clsCancelButton" name="delete_submit" id="delete_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_delete}" onclick="{$delete_submit_onclick}" />
            <input type="button" class="clsSubmitButton" name="activate_submit" id="activate_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_activate}" onclick="{$activate_submit_onclick}" />
            <input type="button" class="clsSubmitButton" name="toactivate_submit" id="toactivate_submit" tabindex="{smartyTabIndex}" value="{$LANG.common_inactivate}" onclick="{$inactivate_submit_onclick}" /></td>
          </tr>

	 </table>
	 	 {$myobj->populateHidden($myobj->selAddAdvertisementForm_hidden_arr)}
	{include file='../general/box.tpl' opt='data_bottom'}
        <!-- clsDataDisplaySection - ends here -->
    </form>
    {if $CFG.admin.navigation.bottom}
    {include file='../general/pagination.tpl'}
    {/if}

    </div>
  {/if}

  </div>
