Павел Пичужкин,
если id не число
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<p id="year2007"></p>
<p id="year2008"></p>
<script type="text/javascript">
Shkolyar = new Array(
{"AbsNumber":"1", "ID":"01", "Text":"№1 (10 октября)", "Year":"year2007", "Pages":"2"},
{"AbsNumber":"2", "ID":"02", "Text":"№2 (11 ноября)", "Year":"year2007", "Pages":"4"},
{"AbsNumber":"3", "ID":"03", "Text":"№3 (25 декабря)", "Year":"year2007", "Pages":"2"},
{"AbsNumber":"4", "ID":"04", "Text":"№4 (январь)", "Year":"year2008", "Pages":"4"},
{"AbsNumber":"5", "ID":"05", "Text":"№5 (февраль)", "Year":"year2008", "Pages":"4"},
{"AbsNumber":"6", "ID":"sv01", "Text":"СВ №1 (март)", "Year":"year2008", "Pages":"2"},
{"AbsNumber":"7", "ID":"sv02", "Text":"СВ №2 (апрель)", "Year":"year2008", "Pages":"4"}
);
for (itemNumper = Shkolyar.length-1; itemNumper >= 0; itemNumper--)
{
var paperLink = document.createElement('a');
paperLink.id = 'link'+(Shkolyar[itemNumper].ID);
paperLink.href = 'javascript:location.hash=\'#'+(Shkolyar[itemNumper].ID)+'\'; location.reload()';
paperLink.title = 'Школяр '+(Shkolyar[itemNumper].Text);
paperLink.appendChild(document.createTextNode(Shkolyar[itemNumper].Text));
window[Shkolyar[itemNumper].Year].appendChild(paperLink);
}
</script>
</body>
</html>