function MmScroll()
{
	this.name = "kumi";
	this.msgcount = messages.length;
	this.currentspeed = 0;
	this.scrollspeed = 30;
	this.pausedelay = 3000;
	this.pausemouseover = true;
	this.width = 820;
	this.height = 230;
	this.stop = false;
	this.scrollheight = 3;

	this.start = function()
	{
		this.message();
		this.currentspeed = this.scrollspeed;
		setTimeout(this.name + ".scroll()",this.pausedelay);
	};

	this.message = function()
	{
		document.writeln('<div id="' + this.name + '" style="z-index:0;height:' + this.height + '; width:' + this.width + '; position:relative; overflow:hidden;" OnMouseOver="' + this.name + '.onmouseover();" OnMouseOut="' + this.name + '.onmouseout();">');
		for(var i = 0; i < this.msgcount; i++){
			document.writeln('<div id="' + this.name + 'msg' + i + '" style="z-index:0;left:0px; width:' + this.width + ';position:absolute;top:' + (this.height * (i + 0)) + 'px;">');
			document.writeln(messages[i]);
			document.writeln('</div>');
		}
		document.writeln('</div>');
	};

	this.scroll = function()
	{
		if(this.msgcount < 2) return false;
		this.currentspeed = this.scrollspeed;
		if(!this.stop){
			for (var i = 0; i < this.msgcount; i++) {
				obj = document.getElementById(this.name + 'msg' + i).style;
				obj.top = parseInt(obj.top) - this.scrollheight;
				if(parseInt(obj.top) <= this.height * (-1)) obj.top = this.height * (this.msgcount-1);
				if(parseInt(obj.top) > 0 && parseInt(obj.top) <= this.scrollheight) this.currentspeed = this.pausedelay;
			}
		}
		setTimeout(this.name+".scroll()",this.currentspeed);
	};

	this.onmouseover = function()
	{
		if(this.pausemouseover){
			this.stop = true;
		}
	};

	this.onmouseout = function()
	{
		if(this.pausemouseover){
			this.stop = false;
		}
	};
}

function MmScroll1(nm)
{
	this.name = nm;
	this.msgcount = messages.length;
	this.currentspeed = 0;
	this.scrollspeed = 30;
	this.pausedelay = 3000;
	this.pausemouseover = true;
	this.width = 820;
	this.height = 230;
	this.stop = false;
	this.scrollheight = 2;

	this.start = function()
	{
		this.message();
		this.currentspeed = this.scrollspeed;
		setTimeout(this.name + ".scroll()",this.pausedelay);
	};

	this.message = function()
	{
		document.writeln('<div id="' + this.name + '" style="z-index:0;height:' + this.height + '; width:' + this.width + '; position:relative;overflow:hidden;" OnMouseOver="' + this.name + '.onmouseover();" OnMouseOut="' + this.name + '.onmouseout();">');
		for(var i = 0; i < this.msgcount; i++){
			document.writeln('<div id="' + this.name + 'msg' + i + '" style="z-index:0;left:0px; width:' + this.width + ';position:absolute;top:' + ((this.height/5) * (i + 0)) + 'px;">');
			document.writeln(messages[i]);
			document.writeln('</div>');
		}
		document.writeln('</div>');
	};

	this.scroll = function()
	{
		if(this.msgcount < 2) return false;
		this.currentspeed = this.scrollspeed;
		if(!this.stop){
			for (var i = 0; i < this.msgcount; i++) {
				obj = document.getElementById(this.name + 'msg' + i).style;
				obj.top = parseInt(obj.top) - this.scrollheight;
				if(parseInt(obj.top) <= (this.height/5) * (-1)) obj.top = (this.height/5) * (this.msgcount-1);
				if(parseInt(obj.top) > 0 && parseInt(obj.top) <= this.scrollheight) this.currentspeed = this.pausedelay;
			}
		}

		setTimeout(this.name+".scroll()",this.currentspeed);
	};

	this.onmouseover = function()
	{
		if(this.pausemouseover){
			this.stop = true;
		}
	};

	this.onmouseout = function()
	{
		if(this.pausemouseover){
			this.stop = false;
		}
	};
}
