rem: if(position >= docheight - frameheight) { if(document.body.offsetHeight) {     position = document.body.offsetHeight; } else if(document.offsetHeight) { position = document.offsetHeight; } else if(document.height) { position = document.height; } } window.scrollTo(0, position); 
add: var objDiv = document.getElementById("chatListWrapper"); objDiv.scrollTop = objDiv.scrollHeight;  
context: function appendMessage(uname, uid, removeable, pdate, ptime, msg, msgId){	var undefined;	var position = 100000, docheight = 0, frameheight = 300;	  	var chatList = document.getElementById("chatList");	// The JSF refactor has to put an additional form on the page, so the id needs to be augmented.	chatList = (chatList == null) ? document.getElementById("monitorForm:chatList") : chatList;	var transcript = (document.all) ? document.all.transcript : chatList;		// compose the time/date according to user preferences for this session	var msgTime = "";	if(window.display_date && window.display_time)	{		msgTime = " (" + pdate + " " + ptime + ") " ;	}	else if (window.display_date)	{		msgTime = " (" + pdate + ") " ;	}	else if(window.display_time)	{		msgTime = " (" + ptime + ") " ;	}		// find the user's current scroll-position within the chat log	if(navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Win") > -1 )	{		// WIN_IE 		position = document.documentElement.scrollTop;	}	else if(navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Mac") > -1 )	{		// MAC_IE 		position = document.body.scrollTop ;	}	else if(window.pageYOffset != undefined)	{		// WIN_MZ 		// WIN_NN		position = window.pageYOffset;	}	else if(document.documentElement)	{		position = document.documentElement.scrollTop;	}	else if(document.body.scrollTop != undefined)	{		position = document.body.scrollTop;	}		// find the height of the frame containing the chat log	if(navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Win") > -1 )	{		// WIN_IE		if(document.documentElement && document.documentElement.clientHeight)		{			frameheight = document.documentElement.clientHeight;		}		else if(window.contentDocument && window.contentDocument.clientHeight)		{			frameheight = window.contentDocument.clientHeight;		}	}	else if(navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Mac") > -1 )	{		// MAC_IE		frameheight = document.body.clientHeight ;	}	else if(window.innerHeight != undefined)	{		// WIN_MZ 		// WIN_NN		frameheight = window.innerHeight;	}	else if(document.body.parentNode != undefined && document.body.parentNode.clientHeight != undefined)	{		frameheight = document.body.parentNode.clientHeight;	}		// find the overall size (height) of the chat log	if(document.body.offsetHeight)	{		// MAC_IE		// WIN_IE		// WIN_MZ		// WIN_NN		docheight = document.body.offsetHeight;	}	else if(document.offsetHeight)	{		docheight = document.offsetHeight;	}	else if(document.height)	{		docheight = document.height;	}		var newDiv = document.createElement('li');	var color = ColorMap[uid];	if(color == null)	{		color = Colors[nextColor++];		ColorMap[uid] = color;		if(nextColor >= numColors)		{			nextColor = 0;		}	}		var deleteHtml = "";	if (removeable == "true")	{		var builtId = "monitorForm:chatList:" + msgId + ":deleteMessage";		deleteUrl = "document.forms['monitorForm']['monitorForm:_idcl'].value='" + builtId + "'; document.forms['monitorForm'].submit(); return false;";		deleteHtml = 			" <a id=\"" + builtId + "\" href=\"#\" onclick=\"" + deleteUrl + "\" title=\"" + deleteMsg + "\" >" +			"<img src=\"/library/image/sakai/delete.gif\" border=\"0\" alt=\"" + deleteMsg + "\" /></a>";	}	newDiv.innerHTML = '<span style="color: ' + color + '">' + uname + '</span>'		+ deleteHtml		+ '<span class="chatDate">' + msgTime + '</span>'		+ escapeHTML(msg);	transcript.appendChild(newDiv);	// adjust scroll	if(position >= docheight - frameheight)	{		if(document.body.offsetHeight)		{			// MAC_IE			// WIN_IE			// WIN_MZ			// WIN_NN			position = document.body.offsetHeight;		}		else if(document.offsetHeight)		{			position = document.offsetHeight;		}		else if(document.height)		{			position = document.height;		}	}	window.scrollTo(0, position);}
meta: 1235	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1235/e168bd45e4885cc7fa6cd21daaf8fc8948566928/chatscript.js/clean/chat/chat-tool/tool/src/webapp/js/chatscript.js