
var agt = navigator.userAgent.toLowerCase();
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var pauseScroll = false;

function init()
{
	scrollDiv = document.getElementById('smsChatHolder');
	scrollDiv.scrollTop = 0;
	currentScroll = 0;
	currentRow = 0;
	rowCount = 10;
	setTimeout("scrollPage()", 6000);
}

function togglePauseSmsChat(bValue)
{
	pauseScroll = bValue;
}

function scrollPage()
{
		scrollDiv = document.getElementById('smsChatHolder');
		
		if (pauseScroll != true)
		{
			scrollDiv.scrollTop += 1;
			currentScroll += 1;
		}
	
		if (currentScroll >= scrollDiv.clientHeight)
		{ 
			if (scrollDiv.scrollTop >= ((rowCount) * scrollDiv.clientHeight))
			{
				scrollDiv.scrollTop = 0;
				currentRow = 0;
			}
			currentRow += 1;
			currentScroll = 0;
			setTimeout("scrollPage()", 6000);
		}
		else
		{
			setTimeout("scrollPage()", 25);
		}

}