zoOmer,
<script>
function add(id, login, sex, pass, acs, rrr) {
var cont = '';
if (!login) login = "";
if (!sex) sex = "";
if (!pass) pass = "";
if (!acs) acs = "";
if (!rrr) rrr = "0";
var select = '',
obj = {
1: "мужской",
2: "женский"
};
for (i = 2; i > 0; i--) {
if (i == sex) select += "<option selected='selected' value='"+i+"'>" + obj[i] + "</option>";
else select += "<option value='"+i+"'>" + obj[i] + "</option>";
}
var rsex = "<input id='sex' type='hidden' value='" + sex + "'>";
if (rrr == "0") rsex = "<br>Пол<select id='sex' value='" + sex + "'>" + select + "</select><br>";
if (!id) cont = "<div id='content'></div> <form id='adduser'><br>Логин:<input id='login' type='text' size='20'><br>пароль<input id='password' type='text' size='20'><br>Права<select id='access'><option>3</option><option>2</option><option>1</option></select>" + rsex + "<input id='id' type='hidden' value=''> <input type='submit' value='Отправить'></form>";
else {
var select = '';
for (i = 3; i > 0; i--) {
if (i == acs) select += "<option selected='selected'>" + i + "</option>";
else select += "<option>" + i + "</option>";
}
var prvv = "<input id='access' type='hidden' value='" + acs + "'>";
if (rrr == "0") prvv = "<br>Права<select id='access' value='" + acs + "'>" + select + "</select>";
cont = "<div id='content'></div> <form id='adduser'><br>Логин:<input id='login' type='text' size='20' value='" + login + "'><br>пароль<input id='password' type='text' size='20' value='" + pass + "'>" + prvv + rsex + "<input id='id' type='hidden' value='" + id + "'> <input type='submit' value='Отправить'></form>";
}
return cont
}
document.write(add(15, 'rx','1',123))
</script>