﻿ 
var moveObject;
var targetObject;
function waitSongTitle(title,addScript)
{
	document.write("<div style=\"margin:5px auto 4px auto;width:100%;height:14;overflow-x:hidden;cursor:hand;background-color:transparent\" onmouseover=\"scrollStart(this.firstChild)\" onmouseout=\"scrollStop(this.firstChild)\" onClick=\""+addScript+"\"><div style=\"position:absolute;white-space:nowrap;height:14;background-color:transparent\">"+"<img src=\"/img/wssf/indexhyico.png\" />"+title+"</div></div>");
}
function scrollStart(obj)
{  
	if(targetObject==obj)
	return;
	if(moveObject!=null)
	clearInterval(moveObject);  
	targetObject = obj;
	moveObject = setInterval("objectScroll()",40);
}
function objectScroll(){
    var posx = targetObject.style.posLeft;
    posx= posx-1;
    var w = targetObject.offsetWidth;
    if((posx+w)<0)
    posx = 100;
    targetObject.style.posLeft = posx;
}
function scrollStop(obj)
{  
	if(targetObject!=obj)    return; 
	//alert(event.toElement);
	if(event.toElement== obj || event.toElement == obj.parentElement) return;

	clearInterval(moveObject);
	obj.style.posLeft = 0;
	targetObject = null;
}
 
