Помогите найти ошибку
<html>
<script type="text/javascript">
function look(lst)
{
lst = new Array();
for(var i=1;i<=2;i++)
{
lst[i] = document.getElementById('lst'+i);
alert("lst[i]");// Проверка
}
lst[i].style.display = lst[i].style.display == "block"?"none":"block";
}
var lnk1 = "<h4>";
var lnk2 = "<a href=javascript:look('lst');>";
var lnk3 = "";
var lnk4 = "</a>";
var lnk5 = "</h4>";
var lnk6 = "<input type=checkbox>";
var div1 = "<div>";
var div2 = "</div>";
var div3 = "<div id='lst1' style='display:none'>";
var div4 = "</div>";
var div5 = "<div id='lst2' style='display:block'>";
var div6 = "</div>";
list = new Array();
list[0] = new Array("Учебники","Поэты");
list[1] = new Array("Алгебра","Физика","Химия","Геометрия");
list[2] = new Array("А.С.Пушин","М.Ю.Лермонтов","Л.Н.Толстой");
//УЧЕБНИКИ
document.write(div1+lnk1+lnk2+list[0][0]+lnk3+lnk4+lnk5+div2);
document.writeln(div3 + "<ul><li>" + lnk6 + list[1][0] + "</li>")
document.writeln("<li>" + lnk6 + list[1][1] + "</li>")
document.writeln("<li>" + lnk6 + list[1][2] + "</li>")
document.writeln("<li>" + lnk6 + list[1][3] + "</li></ul>" + div4)
//ПОЭТЫ
document.write(div1+lnk1+lnk2+list[0][1]+lnk3+lnk4+lnk5+div2);
document.writeln(div5 + "<ul><li>" + lnk6 + list[2][0] + "</li>")
document.writeln("<li>" + lnk6 + list[2][1] + "</li>")
document.writeln("<li>" + lnk6 + list[2][2] + "</li></ul>" + div6)
</script>
<body>
<form>
</form>
</body>
</html>