<script type="text/javascript">
function deleteBanner(Type,ID) {
  if(confirm("<?php echo L_G_CONFIRMDELETEBANNER?>"))
   	document.location.href = "index.php?md=Affiliate_Merchants_Views_Banner"+Type+"&bid="+ID+"&action=delete"+"&<?php echo SID?>";
}
function addBanner(Type) {
	document.location.href = "index.php?md=Affiliate_Merchants_Views_Banner"+Type+"&campaign=<?php echo $campaignid?>&<?php echo SID?>";
}
function editBanner(Type, ID) {
	document.location.href = "index.php?md=Affiliate_Merchants_Views_Banner"+Type+"&action=edit&bid="+ID+"&<?php echo SID?>";
}

function addBannerCategory() {
    document.location.href = "index.php?md=Affiliate_Merchants_Views_BannerCategory&action=add&<?php echo SID?>";
}

function addBannersForCampaign() {
	document.location.href = "index.php?md=Affiliate_Merchants_Views_BannerManager&action=show&campid=<?php echo $campaignid?>"+"&<?php echo SID?>";
}

function backToCampaigns(ID) {
	document.location.href = "index.php?md=Affiliate_Merchants_Views_CampaignManager&action=addbanners&cid="+ID+"&<?php echo SID?>";
}

function showPopupPopunder(banner_content, btype, rwidth, rheight, rresizable, rstatus, rtoolbar, rlocation, rdirectories, rmenubar, rscrollbars) {
  var TheNewWindow = window.open("<?php echo $this->a_Auth->getSetting('Aff_scripts_url')?>testPop.php?banner_content="+banner_content,'ThePop',
        'top=0,left=0,width='+rwidth+',height='+rheight+',toolbar='+rtoolbar+',location='+rlocation+',directories='+rdirectories+',status='+rstatus+',menubar='+rmenubar+',scrollbars='+rscrollbars+',resizable='+rresizable);

  if(btype == '<?php echo BANNERTYPE_POPUNDER; ?>')
    TheNewWindow.blur();
  else
    TheNewWindow.focus();
}
function showTearpage(id) {
  var TheNewWindow = window.open("<?php echo $this->a_Auth->getSetting('Aff_scripts_url')?>testTearpage.php?id="+id,'Tearpage Test','top=0,left=0,width=500,height=500');
  TheNewWindow.focus();
}

function showLightbox(id) {
  var TheNewWindow = window.open("<?php echo $this->a_Auth->getSetting('Aff_scripts_url')?>testLightbox.php?id="+id,'Tearpage Test','top=0,left=0,width=850,height=650');
  TheNewWindow.focus();
}

</script>


<!-- add & edit form start -->
<form enctype="multipart/form-data" action=index.php method=post>
<table border=0 cellspacing=0 cellpadding=3 width="780">
<tr><td><?php echo $this->a_hlp?></td></tr>
</table>
<table class="listing mt10" border=0 cellspacing=0 cellpadding=3 width="780">
<?php QUnit_Templates::printFilter(2, $_POST['header']); ?>
<tr>
  <td width="5%" class=formText nowrap>&nbsp;<?php echo L_G_BANNERNAME?>&nbsp;&nbsp;<?php showQuickHelp(L_G_HLP_BANNERNAME); ?></td>
  <td>
    <input type=text name=name size=100 maxlength="100" value="<?php echo $_POST['name']?>">
  </td>
</tr>
<?php  if ($this->a_hide_banner_size != '1') { ?>
<tr>
  <td class=formText nowrap>&nbsp;<?php echo L_G_BANNERSIZE;?>&nbsp;&nbsp;<?php showQuickHelp(L_G_HLP_BANNERSIZE); ?></td>
  <td class=formText nowrap>
    <input type="hidden" name="window_size_type" value='<?php echo WINDOWSIZE_OWN; ?>' />
    <?php echo L_G_WIDTH?>&nbsp;<input type=text name=rwidth size=2 value="<?php echo $_POST['rwidth']?>">
      &nbsp;x&nbsp;<?php echo L_G_HEIGHT?>&nbsp;<input type=text name=rheight size=2 value="<?php echo $_POST['rheight']?>">
  </td>
</tr>
<?php } ?>
<tr>
  <td class="formText" nowrap>&nbsp;<?php echo L_G_DESTURL;?>&nbsp;&nbsp;<?php showQuickHelp(L_G_HLP_DESTINATIONURL); ?></td>
  <td>
    <input type=text name=desturl size=100 value="<?php echo $_POST['desturl']?>">&nbsp;*
  </td>
</tr>
     <?php QUnit_Global::includeTemplate($this->a_bannertemplate); ?>
<tr>
  <td class="formText" colspan="2" align="left">&nbsp;
  <input type="hidden" name="md" value="<?php echo $this->a_md?>" />
  <input type="hidden" name="commited" value="yes" />
  <input type="hidden" name="action" value="<?php echo $_REQUEST['action']?>" />
  <input type="hidden" name="cid" value="<?php echo $_REQUEST['cid']?>" />
  <input type="hidden" name="bid" value="<?php echo $_REQUEST['bid']?>" />
  <input type="hidden" name="campaign" value="cliksale" />
  <input type="hidden" name="bannercategory" value="_" />
  <input type="hidden" name="hidden" value="0" />
  <input class="formbutton" type="submit" value="<?php echo L_G_SUBMIT; ?>" />
  </td>
</tr>
</table>
</form>
<?php if($this->a_example != '') { ?>
<table border=0 cellspacing=0 cellpadding=3 width="780">
<tr>
  <td align=left><?php echo $this->a_example?></td>
</tr>
</table>
<?php } ?>
<!-- add & edit form end -->

<?php if($_REQUEST['action']!='edit') { ?>
<form name="FilterForm" action="index.php">
<input type="hidden" name="md" value="<?php echo $_REQUEST['md']; ?>" />
<input type="hidden" name="list_page" value="<?php echo $_REQUEST['list_page']; ?>" />
<table class="tblist mt10" border=0 cellspacing=0 cellpadding=2 width="780">
<tr class="header">
    <?php $this->a_this->printListHeader();?>
</tr>

<?php if(!$this->a_allcount) {?>
<tr>
    <td colspan="<?php echo $this->a_list_cols; ?>"><?php echo L_G_NORESULTS; ?></td>
</tr>
<?php } else {
    $this->a_this->printListData();
?>
<tr>
    <td colspan="<?php echo $this->a_list_cols; ?>" align="center" ><?php QUnit_Templates::printPaging($this->a_list_page, $this->a_list_pages, $this->a_allcount);?></td>
</tr>
<?php } ?>

</table>
</form>
<?php } ?>
