<!--
var imgname=new Array()
var imgurl=new Array()
var imgtarget=new Array()


imgname[0]="http://www.jtf.org.tw/nutrition/banner/vitality.gif";
imgurl[0]="http://www.jtf.org.tw/vitality";
imgtarget[0]="_blank";

imgname[1] = "/nutrition/banner/weight-banner.gif";
imgurl[1] = "http://www.jtf.org.tw/weight/";
imgtarget[1] = "_blank";


var pause=5000
var imgwidth=460
var imgheight=60

var pos_left=10
var pos_top=10

var imgpreload=new Array()

for (i=0;i<=imgname.length-1;i++) {
	imgpreload[i]=new Image()
	imgpreload[i].src=imgname[i]
}

var speed=20
var step=10

var i_loop=0
var i_image1=0
var i_image2=1

function stretchimage() {
	if (i_loop<=imgwidth) {
		if (document.all) {
			imgcontainer1.innerHTML="<a href='"+imgurl[i_image1]+"' target='"+imgtarget[i_image1]+"'><img width='"+i_loop+"' height='"+imgheight+"' src='"+imgname[i_image1]+"' border='0'></a>"
			document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft+i_loop
			
			imgcontainer2.innerHTML="<a href='"+imgurl[i_image2]+"' target='"+imgtarget[i_image2]+"'><img width='"+(imgwidth-i_loop)+"' height='"+imgheight+"' src='"+imgname[i_image2]+"' border='0'></a>"
		}
		i_loop=i_loop+step
		var timer=setTimeout("stretchimage()",speed)
  	}
	else {
		clearTimeout(timer)
		changeimage()
	}
}

function changeimage() {
	i_loop=0
	i_image1++
	if (i_image1>imgname.length-1) {i_image1=0}
	i_image2=i_image1-1
	if (i_image2>imgname.length-1) {i_image2=0}
	if (i_image2<0) {i_image2=imgname.length-1}
	
	document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft
   	var timer=setTimeout("stretchimage()",pause)
}

function initiate() {
	if (document.all) {
		document.all.imgcontainer1.style.posLeft=pos_left
		document.all.imgcontainer2.style.posLeft=pos_left
		document.all.imgcontainer1.style.posTop=pos_top
		document.all.imgcontainer2.style.posTop=pos_top
		changeimage()
	}
	if (document.layers) {
		document.imgcontainer1.left=pos_left
		document.imgcontainer2.left=pos_left
		document.imgcontainer1.top=pos_top
		document.imgcontainer2.top=pos_top
		rotatenetscape()
	}
}

function rotatenetscape() {
	document.imgcontainer1.document.write("<a href='"+imgurl[i_image1]+"' target='"+imgtarget[i_image1]+"'><img src='"+imgname[i_image1]+"' border='0'></a>")	
	document.imgcontainer1.document.close()	
	i_image1++
	if (i_image1>imgname.length-1) {i_image1=0}
   	var timer=setTimeout("rotatenetscape()",pause*2)
}

//-->



 













