var message= new Array()
message[0]="<table width='100%' border='0' class='main'><tr><td><div align='center'><a href='ProductList.asp?FID=1'><img src='images/1-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=2'><img src='images/2-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=20'><img src='images/3-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=18'><img src='images/4-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td></tr></table>"


message[1]="<table width='100%' border='0' class='main'><tr><td><div align='center'><a href='ProductList.asp?FID=22'><img src='images/5-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=3'><img src='images/6-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=17'><img src='images/7-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=16'><img src='images/8-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td></tr></table>"

message[2]="<table width='100%' border='0' class='main'><tr><td><div align='center'><a href='ProductList.asp?FID=50'><img src='images/9-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=59'><img src='images/10-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=60'><img src='images/11-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td><td><div align='center'><a href='ProductList.asp?FID=61'><img src='images/12-1.jpg' width='165' height='120' border='0' class='sampleborder'></a></div></td></tr></table>"

// 卷轴的高
var scrollerheight=125
// 距离窗口顶
var scrollertop=10
// 距离窗口左
var scrollerleft=6
// 停顿时间
var standstill=3000

var cliptop=0
var clipbottom=0
var clipleft=0
var clipright=800-scrollerleft

var i_message=0
var mes_joined
var contenttext

var step=2
var pause=20

function initiate() {
		mes_joined=message[i_message]
		contenttext=mes_joined
		
	if (document.all) {
		scrollertext.innerHTML=contenttext
		document.all.scrollertext.style.posTop=scrollertop+scrollerheight
		document.all.scrollertext.style.posLeft=scrollerleft
		document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		scrollin()
	}
	if (document.layers) {
		document.scrollertext.document.write(contenttext)
		document.scrollertext.document.close()
		document.scrollertext.top=scrollertop+scrollerheight
		document.scrollertext.left=scrollerleft
		document.scrollertext.clip.left=clipleft
        document.scrollertext.clip.right=clipright
        document.scrollertext.clip.top=cliptop
        document.scrollertext.clip.bottom=clipbottom
		scrollin()
	}
}

function scrollin(){
	if (document.all){
		if (document.all.scrollertext.style.posTop>scrollertop) {
			clipbottom+=step
			document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			document.all.scrollertext.style.posTop-=step
			var timer=setTimeout("scrollin()",pause)
		}
		else {
			clearTimeout(timer)
			var timer=setTimeout("scrollout()",standstill)
		}
	}
	if (document.layers){
		if (document.scrollertext.top>scrollertop) {
			clipbottom+=step
			document.scrollertext.clip.left=clipleft
        	document.scrollertext.clip.right=clipright
        	document.scrollertext.clip.top=cliptop
        	document.scrollertext.clip.bottom=clipbottom
			document.scrollertext.top-=step
			var timer=setTimeout("scrollin()",pause)
		}
		else {
			clearTimeout(timer)
			var timer=setTimeout("scrollout()",standstill)
		}
	}
}

function scrollout(){
	if (document.all){
		if (document.all.scrollertext.style.posTop>(scrollertop-scrollerheight)) {
			cliptop+=step
			document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			document.all.scrollertext.style.posTop-=step
			var timer=setTimeout("scrollout()",pause)
		}
		else {
			clearTimeout(timer)
			changemessage()
		}
	}
	if (document.layers){
		if (document.scrollertext.top>(scrollertop-scrollerheight)) {
			cliptop+=step
			document.scrollertext.clip.left=clipleft
        	document.scrollertext.clip.right=clipright
        	document.scrollertext.clip.top=cliptop
        	document.scrollertext.clip.bottom=clipbottom
			document.scrollertext.top-=step
			var timer=setTimeout("scrollout()",pause)
		}
		else {
			clearTimeout(timer)

			changemessage()
		}
	}
}

function changemessage(){
		i_message++
		if (i_message>message.length-1) {i_message=0}
		mes_joined=message[i_message]
		contenttext=mes_joined
		cliptop=0
		clipbottom=0
		
	if (document.all) {
		scrollertext.innerHTML=contenttext
		document.all.scrollertext.style.posTop=scrollertop+scrollerheight
		document.all.scrollertext.style.posLeft=scrollerleft
		document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		scrollin()
	}
	if (document.layers) {
		document.scrollertext.document.write(contenttext)
		document.scrollertext.document.close()
		document.scrollertext.top=scrollertop+scrollerheight
		document.scrollertext.left=scrollerleft
		document.scrollertext.clip.left=clipleft
        document.scrollertext.clip.right=clipright
        document.scrollertext.clip.top=cliptop
        document.scrollertext.clip.bottom=clipbottom
		scrollin()
	}
}
