﻿var tID     = null;
var getObj	= null;
var mq = new classMQ();

function classMQ() 
{
} 

classMQ.prototype.set = function( obj )
{
    getObj	= obj;
    this.BLANK     = "  ";
    this.CONTENT = getObj.value;
    this.SCROLL    = this.BLANK + this.CONTENT + this.BLANK + this.CONTENT+ this.BLANK + this.CONTENT+ this.BLANK + this.CONTENT;
    getObj.style.textDecoration = 'underline';
    getObj.style.color = "#000000";
}

classMQ.prototype.scroll = function( ) 
{
    if (!getObj)	return;	
    var value = getObj.value;
    getObj.value = value.substring(1);
    if ("" == getObj.value.length)
    {
    	getObj.value = this.SCROLL;
    }			
}

classMQ.prototype.init = function(  ) 
{
    if (!getObj)	return;
    getObj.value = this.CONTENT;
    getObj.style.textDecoration = 'none';
    getObj.style.color = "";
}

String.prototype.LW = function()
{
	return this.replace(/[^\x00-\xff]/g,"**").length;
}

function MA(surl,word,tw,cl)
{
	if (surl==""){
		surlb="<span>"
		surle="</span>"
	}else{
		surlb="<a href='"+surl+"' title='"+word+"' target='_blank'>"
		surle="</a>"
	}
	wl=word.LW();
	if (word!=""){
		if (wl<=tw){
			document.write(surlb+word+surle);
		}
		else{
			document.write(surlb+"<input type=text value='"+word+"' class=MA"+cl+" onMouseOver=mq.set(this);tID=setInterval('mq.scroll()',200); onMouseOut=clearInterval(tID);mq.init(this); readonly>"+surle);
//			document.write(surlb+"<input type=text value='"+word+"' class=MA"+cl+" readonly>"+surle);
		}
	}else{document.write("")}
}
