- "<a href=\"javascript:forum_readmessages('" + new_new_div_name + "', " + newgt + ", 9999999999);\">" +
- "link to msgs greater than " + newgt + "</a></div>" ;
+ "<a href=\"javascript:forum_readmessages('" + new_new_div_name + "', " + newgt + ", 9999999999);\">"
+ + "link to msgs greater than " + newgt + "</a></div>" ;
+ }
+
+ // Now figure out where to scroll to after rendering.
+ if (gt_msg > 0)
+ {
+ scroll_to = msgs[0];
+ }
+ else if (lt_msg < 9999999999)
+ {
+ scroll_to = msgs[msgs.length-1];
+ }
+ else if ( (logged_in) && (gt_msg == 0) && (lt_msg == 9999999999) )
+ {
+ scroll_to = msgs[msgs.length-1];
+ }
+ else
+ {
+ scroll_to = msgs[0]; // FIXME this is too naive