{include file="../head.tpl"}
<script language="javascript" type="text/javascript">
{literal}
<!--

function redirtodel(area){
	var theid = document.getElementById('thegal').value;
	if(theid!=0){
		var theurl = 'gallery.php?del=1&area=' + area +'&galid=' + theid;
		
		if(confirm('{/literal}{$lang.confirmdelgal}{literal}')){
		
			location.href = theurl;
		}
	} else {
		alert('{/literal}{$lang.pselgal}{literal}');
	}
}

function redirtoedit(area){
	var theid = document.getElementById('thegal').value;
	if(theid!=0){
		var theurl = 'gallery.php?edit=1&area=' + area +'&galid=' + theid;
		location.href = theurl;
	}
}
//-->
{/literal}
   </script>

<form action="" method="post" enctype="multipart/form-data" name="gals">
  <table width="100%"  border="0" cellpadding="4" cellspacing="1" class="tableborder">
    <tr>
      <td colspan="2" class="header">{$lang.adnewgal}</td>
    </tr>
    <tr>
      <td width="5%" nowrap class="firstrow">{$lang.thegalname}</td>
      <td class="secondrow"><input name="title" type="text" id="title" size="35">
      </td>
    </tr>
	  <tr>
      <td class="firstrow">{$lang.product}<br>
      {$lang.ortext} {$lang.matchword}</td>
      <td class="secondrow">
	  <select style="width:50%" name="product" id="product">
      <option value="">- - -</option>
      {foreach from=$products item=pro} 
       <option value="{$pro->id}" {if $row->product==$pro->id}selected="selected"{/if}>{$pro->title}</option>
      {/foreach}
      
        
      </select>
	  <br>
	  <input name="matchword" type="text" id="matchword" value="{$row->matchword}" size="35" maxlength="200"></td>
    </tr>
    <tr>
      <td nowrap class="firstrow"> {$lang.selgal} </td>
      <td class="secondrow"><select name="thegal" id="thegal">
          <option value="0"> {$lang.selnewgal} </option>
          
          
   {$galdropdown}
  
        
        </select>
      </td>
    </tr>
    <tr>
      <td nowrap class="firstrow">{$lang.thegaldescr}</td>
      <td class="secondrow"><textarea name="descr" cols="75" rows="8" id="descr">{$descr}</textarea></td>
    </tr>
    <tr>
      <td nowrap class="firstrow">{$lang.autobr}</td>
      <td class="secondrow"><input name="autobr" type="checkbox" id="autobr" value="1"></td>
    </tr>
    <tr>
      <td nowrap class="firstrow">{$lang.cancomment_gal}</td>
      <td class="secondrow"><input name="cancomment" type="checkbox" value="1" checked></td>
    </tr>
    <tr>
      <td nowrap class="firstrow">{$lang.max_width_thumb2}</td>
      <td class="secondrow"><select name="maxwidth" id="maxwidth">
        <option value="320">320</option>
        <option value="480" selected>480 (Standard)</option>
        <option value="640">640</option>
        <option value="800">800</option>
      </select></td>
    </tr>
    <tr>
      <td nowrap class="firstrow">{$lang.active}</td>
      <td class="secondrow"><input name="active" type="checkbox" id="active" value="1" {if $active == 1}checked="checked"{else}disabled="disabled"{/if}>
     {if $active != 1}{$lang.messagegalinactive}{/if}
	  </td>
    </tr>
    <tr>
      <td colspan="2" class="firstrow"><input name="send" type="hidden" id="send" value="1">
        <input name="area" type="hidden" id="area" value="{$area}">
        <input name="Senden" type="submit" class="button" value="{$lang.adnewgal}">
      </td></tr>
  </table>
</form>
