<table border="0" align="center" width="90%" cellpadding="0" cellspacing="0">
<tr><td bgcolor=@@@TITLEBAR@@@>
<font color=@@@TITLEBAR_TEXT@@@ face=@@@FONTFACE@@@ size="3">
<b>Urejanje pravil odstranjevanja oglasne pošte</b></font>
</td></tr>
<tr><td bgcolor=@@@MENUBAR@@@>
@@@MENUBARLINKS@@@
</td></tr>
<tr><td>&nbsp;</td></tr>

<tr><td>

<table bgcolor=@@@TABLEROW_DARK@@@ border="0" cellspacing="1" cellpadding="2" align="center" width="100%">
@@@STARTADDTESTFORM@@@
<tr><td><B>Ime poskusa:</B></td>
<td colspan="2">@@@TESTNAMEFIELD@@@&nbsp;(samo črke, številke in podčrtaj)</td></tr>
<tr><td><B>Opis:</B></td>
<td colspan="2">@@@TESTDESCFIELD@@@</td></tr>

<tr><td><B>Vrsta poskusa:</B></td>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td>@@@TESTTYPEMENU@@@</td>
<td>
<div id="headerdiv" style="position:relative; visibility:visible;" width="100%" height="100%">
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td>Attr&nbsp;</td><td>@@@HEADERATTRMENU@@@</td><td>@@@HEADERATTRFIELD@@@</td><td>@@@OPMENU@@@</td>
</tr></table>
</div>
</td>
</tr></table>
</td></tr>

<tr><td><B>Izraz:</B></td>
<td colspan="2">@@@PATTERNFIELD@@@ &nbsp; Prezrij velikost črk@@@IGNORECASECHECKBOX@@@ &nbsp; Enakost enojne vrstice@@@SINGLELINECHECKBOX@@@</td></tr>
<tr><td><B>Točke:</B></td>
<td>@@@SCOREMENU@@@  (nastavi točke>0 za oglasno pošto, točke<0 za uporabno pošto)</td><td align="right">@@@ADDBUTTON@@@ &nbsp; </td></tr>
@@@ENDFORM@@@
</table>

</td></tr>

<tr><td>&nbsp;</td></tr>

<tr><td>

<table border="0" align="center" width="100%" cellpadding="1" cellspacing="2">
@@@TESTS@@@
</table>

</td></tr>
</table>

<script language="JavaScript">
<!--
   function setheaderattrfield ()
   {
      var s=document.addtest.testheaderattr_sel.value;
      if (s=='User Define') {
         document.addtest.testheaderattr.value='';
      } else {
         document.addtest.testheaderattr.value=s;
      }
   }

   function sethheaderdivvisibility()
   {
      var div=document.getElementById('headerdiv');
      if (document.addtest.testtype.value == "header") {
         div.style.visibility='visible';
      } else {
	 div.style.visibility='hidden';
      }
   }
	
   function update (testname, desc, type, headerattr, op, pattern, ignorecase, singleline, score)
   {
      var e;

      document.addtest.testname.value = testname;
      document.addtest.testdesc.value = desc;

      selectoption(document.addtest.testtype, type);

      if (type=='header') {
         document.addtest.testheaderattr.value = headerattr;
         selectoption(document.addtest.testheaderattr_sel, headerattr);
         selectoption(document.addtest.testop, op);
      }

      document.addtest.pattern.value = pattern;

      document.addtest.ignorecase.checked = (ignorecase==1)?true:false;
      document.addtest.singleline.checked = (singleline==1)?true:false;

      e=document.addtest.score;

      for (var i=0; i<e.length; i++) {
         if (e.options[i].value<=score) {
            e.options[i].selected=true;
            break;
         }
      }

      setheaderattrfield();
      sethheaderdivvisibility();
   }

   function addcheck()
   {
      if (document.addtest.testname.value  == "") {
         alert("Prosim, določite poskusno ime.");
         return false;
      }
      if (document.addtest.pattern.value  == "") {
         alert("Prosim, določite poskusni izraz.");
         return false;
      }
      return true;
   }

   function selectoption (menu, value)
   {
      var i_default=0;

      for (var i=0; i<menu.length; i++) {
         if (menu.options[i].value==value) {
            menu.options[i].selected=true;
            return i;
         }
         if (menu.options[i].defaultSelected) {
            i_default=i;
         }
      }
      menu.options[i_default].selected=true;
      return i_default;
   }
//-->
</script>
