var popUpWin = null;
function OpenPopup(Title,Width,Height,URL)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  var left = 50;
  var top = 50;
  popUpWin = window.open(URL, Title, ',resizable=yes,scrollbars=yes,toolbar=no,menubar=no,width='+Width+',height='+Height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function ReloadParent(ParentURL)
{
	window.opener.location.href = ParentURL;
}


function SparkText(text,color1,color2,fontSize)
{
	ptext = " Text='"+text+"'";
	ptext += " Color1="+color1;
	ptext += " Color2="+color2;
	ptext += " FontSize="+fontSize;
	if (navigator.appName == "Netscape")
	{
		document.write("<layer id=a visibility=show"+ptext+"></layer><br><br><br>");
	}
	else
	{
		document.write("<div id=a"+ptext+"></div>");
	}
}

function changeCharColor()
{
	if (document.a==null)
	{
		return;
	}
	
	text = document.a.Text; //显示的文字
	color1 = document.a.Color1; //文字的颜色
	color2 = document.a.Color2; //转换的颜色
	fontsize = document.a.Fontsize; //字体大小
	
	if (navigator.appName == "Netscape")
	{
		document.a.document.write("<center><font face=arial size =" + fontsize + "><font color=" + color1 + ">");
		for (var j = 0; j < text.length; j++)
		{
			if(j == i)
			{
				document.a.document.write("<font face=arial color=" + color2 + ">" + text.charAt(i) + "</font>");
			}
			else
			{
				document.a.document.write(text.charAt(j));
			}
		}
		document.a.document.write('</font></font></center>');
		document.a.document.close();
	}
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		str = "<center><font face=arial size=" + fontsize + "><font color=" + color1 + ">";
		for (var j = 0; j < text.length; j++)
		{
			if( j == i)
			{
				str += "<font face=arial color=" + color2 + ">" + text.charAt(i) + "</font>";
			}
			else
			{
				str += text.charAt(j);
			}
		}
		str += "</font></font></center>";
		a.innerHTML = str;
	}
	(i == text.length) ? i=0 : i++;
}

speed = 100; //转换速度 (1000 = 1 秒) 
i = 0;
//setInterval("changeCharColor()", speed);
