<!--
///*
//Pausing updown message scroller- 
//Last updated: 99/07/05 (Bugs fixed, ability to specify background image for scroller)
//?Dynamic Drive (www.dynamicdrive.com)
//For full source code, installation instructions,
//100's more DHTML scripts, and Terms Of
//Use, visit dynamicdrive.com
//*/

//configure the below five variables to change the style of the scroller

var scrollertopwidth=201;
var scrollertopheight=25;
var scrollertopbgcolor='';
//set below to '' if you don't wish to use a background image
var scrollerbackground=''
var scrolltopdelay = 3000

var toptimerID1
var toptimerID2
var toptimerID3

var topflag1 = 0
var topnewsource

//configure the below variable to change the contents of the scroller
var lasttopnews=new Array()
var ii = 0;
lasttopnews[ii++]='<a href="cgsdi/20070703.php"><img src="images/20070703.gif" alt="美國民眾對於核能發電可減少溫室氣體排放量之認知仍有限" name="20070703" width="201" height="25" border="0"></a>'
lasttopnews[ii++]='<a href="cgsdi/20070713_1.php"><img src="images/20070713_1.gif" alt="美國總統布希呼籲國會通過能源法案擴大核能的使用" name="20070713_1" width="201" height="25" border="0"></a>'
lasttopnews[ii++]='<a href="cgsdi/20070713_2.php"><img src="images/20070713_2.gif" alt="英國新任首相Gordon Brown支持興建新一代核能電廠" name="20070713_2" width="201" height="25" border="0"></a>'

if (lasttopnews.length > 1)
  ii = 2
else
  ii = 0

function topmove3(whichdiv)
{
	tdtopiv1=eval(whichdiv)
	if (tdtopiv1.style.pixelTop > 0 && tdtopiv1.style.pixelTop <= 20)
	{
		tdtopiv1.style.pixelTop = 0
		toptimerID1 = setTimeout("topmove3(tdtopiv1)",scrolltopdelay)
		toptimerID2 = setTimeout("topmove4(topmsg02)",scrolltopdelay)
		tdtopiv1.style.visibility = 'visible';
		topmsg02.style.visibility = 'hidden';
		return
	}
	if (tdtopiv1.style.pixelTop >= tdtopiv1.offsetHeight * -1)
	{
		tdtopiv1.style.pixelTop-=20
		setTimeout("topmove3(tdtopiv1)",100)
	}
	else
	{
		tdtopiv1.style.pixelTop = scrollertopheight
		tdtopiv1.innerHTML = lasttopnews[ii]
		if (ii == lasttopnews.length - 1)
			ii = 0
		else
			ii++
	}
}

function topmove4(whichdiv)
{
	tdtopiv2=eval(whichdiv)
	if (tdtopiv2.style.pixelTop > 0 && tdtopiv2.style.pixelTop <= 20)
	{
	tdtopiv2.style.pixelTop = 0
	toptimerID3 = setTimeout("topmove4(tdtopiv2)",scrolltopdelay)
	toptimerID4 = setTimeout("topmove3(topmsg01)",scrolltopdelay)
	tdtopiv2.style.visibility = 'visible';
	topmsg01.style.visibility = 'hidden';
	return
}
	if (tdtopiv2.style.pixelTop >= tdtopiv2.offsetHeight * -1)
	{
		tdtopiv2.style.pixelTop-=20
		setTimeout("topmove4(topmsg02)",100)
	}
	else
	{
		tdtopiv2.style.pixelTop = scrollertopheight
		tdtopiv2.innerHTML = lasttopnews[ii]
		if (ii == lasttopnews.length - 1)
			ii = 0
		else
			ii++
	}
}

function Starttopscroll()
{
	if (document.all)
	{
		topmove3(topmsg01)
		topmsg02.style.top = scrollertopheight
		//topmsg02.style.visibility = 'visible'
	}
}

function aaa1aa()
{
	if (topflag1 == 0)
	{
		clearTimeout(toptimerID1)
		clearTimeout(toptimerID2)
		clearTimeout(toptimerID3)
		clearTimeout(toptimerID4)
		topnewsource = topmain2.innerHTML
		topflag1 = 1
		topmain2.innerHTML = "<DIV>"
		for(jj = 0;jj < lasttopnews.length;jj++)
			topmain2.innerHTML+=lasttopnews[jj]+"<BR>"
			topmain2.innerHTML+="</DIV>"
			zoomnews.src = "newimage/zoomup.gif"
	}
	else
	{
		topmain2.innerHTML = topnewsource
		document.body.scrollTop = 200
		zoomnews.src = "newimage/zoomdn.gif"
		topflag1 = 0
		setTimeout("topmove3(topmsg01)",scrolltopdelay)
		setTimeout("topmove4(topmsg02)",scrolltopdelay)
	}
}

if (document.all)
{
	document.writeln('<span id="topmain2" style="position:relative;width:'+scrollertopwidth+';height:'+scrollertopheight+';overflow:hiden;background-color:'+scrollertopbgcolor+' ;background-image:url('+scrollerbackground+')">')
	document.writeln('<div style="position:absolute;width:'+scrollertopwidth+';height:'+scrollertopheight+';clip:rect(0 '+scrollertopwidth+' '+scrollertopheight+' 0);left:0;top:0">')
	document.writeln('<div id="topmsg01" style="position:absolute;width:'+scrollertopwidth+';left:3;top:1;">')
	document.write(lasttopnews[0])
	document.writeln('</div>')
	document.writeln('<div id="topmsg02" style="position:absolute;width:'+scrollertopwidth+';left:3;top:0;visibility:hidden">')
	document.write(lasttopnews[1])
	document.writeln('</div>')
	document.writeln('</div>')
	document.writeln('</span>')
}
Starttopscroll();
//-->
