<?PHP
include("../../../configuration/database.inc.php");                  // connecting to database
mysql_connect("$db_server", "$db_username", "$db_password");
mysql_select_db("$db_name");

$query = "SELECT config_value FROM $table_configuration where config_key='language'";
$result = mysql_query($query) or die_script(mysql_error());
$language = mysql_result($result,0);
include("../../../languages/$language/$language.php"); 
unset($query);
unset($result);
?>

<html style="width: 320; height: 188">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?PHP echo $lang['lang_charset'] ?>">
<title><?PHP echo $lang['insert_rule'] ?></title>

<script type="text/javascript" src="popup.js"></script>

<script type="text/javascript">

function Init() {
  __dlg_init();
  window.focus();
};

function onOK() {

var fields = ["f_height", "f_unit", "f_width", "f_shade", "f_align"];
  var param = new Object();
  for (var i in fields) {
    var id = fields[i];
    var el = document.getElementById(id);
    param[id] = el.value;
  }
  __dlg_close(param);
  return false;
};

function onCancel() {
  __dlg_close(null);
  return false;
};

</script>

<style type="text/css">
html, body {
  background: ButtonFace;
  color: ButtonText;
  font: 11px Tahoma,Verdana,sans-serif;
  margin: 0px;
  padding: 0px;
}
body { padding: 5px; }
table {
  font: 11px Tahoma,Verdana,sans-serif;
}
form p {
  margin-top: 5px;
  margin-bottom: 5px;
}
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
fieldset { padding: 0px 10px 5px 5px; }
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }

.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }
</style>

</head>

<body onload="Init()">

<div class="title"><?PHP echo $lang['insert_rule'] ?></div>

<form action="" method="get">
<table border="0" style="padding: 0px; margin: 0px">
  <tbody>
  <tr>
    <td style="width: 4em; text-align: right"><?PHP echo $lang['width'] ?></td>
    <td><input type="text" name="width" id="f_width" size="4" value="100" />
        <select size="1" name="unit" id="f_unit" title="Width unit">
      <option value="%" selected="1"  >%</option>
      <option value="px"              >Pt</option>
    </select></td>
    <td>&nbsp;</td>
    <td style="width: 4em; text-align: right"><?PHP echo $lang['outline'] ?></td>
    <td>
    <select size="1" name="align" id="f_align" >
  <option value="left"  selected="1"           ><?PHP echo $lang['left'] ?></option>
  <option value="right"                        ><?PHP echo $lang['right'] ?></option>
  <option value="center"                       ><?PHP echo $lang['middle'] ?></option>
</select>
    </td>
  </tr>
  <tr>
  <td style="width: 4em; text-align: right"><?PHP echo $lang['height'] ?></td>
  <td>
  <SELECT style="LEFT: 58px; WIDTH: 68px; TOP: 29px" name="height" id="f_height">
 <option value=1>1 pt</option>
 <option selected value=2>2 pt</option>
 <option value=3>3 pt</option>
 <option value=4>4 pt</option>
 <option value=5>5 pt</option>
 <option value=6>6 pt</option> 
 <option value=7>7 pt</option>
 <option value=8>8 pt</option>
 <option value=9>9 pt</option>
 <option value=10>10 pt</option>
</SELECT>
  </td>
  <td>&nbsp;</td>
  <td style="width: 4em; text-align: right"><?PHP echo $lang['shade'] ?></td>
  <td><SELECT name="shade" id="f_shade" style="LEFT: 59px; TOP: 64px""> 
   <option value=shade "selected"><?PHP echo $lang['yes'] ?></option>
   <option value=noshade "selected"><?PHP echo $lang['no'] ?></option>
   </SELECT>
   </td>
  </tr>
  </tbody>
</table>

<div style="margin-top: 10px; text-align: right;">
<hr />
<button type="button" name="cancel" onclick="return onCancel();"><?PHP echo $lang[cancel] ?></button>
&nbsp;<button type="button" name="ok" onclick="return onOK();">OK</button>
</div>

</form>

</body>
</html>