﻿<!--
//跑馬燈設定
var isIE = navigator.userAgent.search("MSIE") > -1;
var isIE7 = navigator.userAgent.search("MSIE 7") > -1;
var isFirefox = navigator.userAgent.search("Firefox") > -1;
var isSafari = navigator.userAgent.search("Safari") > -1;//Safari,google
var scrollerwidth=800;
var scrollerheight=45;
var scrollerbgcolor='';
var chTime=6;
var totalMsg = 5;//messages[n]+1訊息數量;
chTime=chTime*1000;
if(isFirefox){
	leftIs=-400;
	topIs=-15;
}else if(isSafari){
	leftIs=60;
	topIs=-20;
}else{
	leftIs=0;
	topIs=0;
}
var messages=new Array()

messages[2]="<a href=http://www.oceanstar.com.tw/area/inside_island.php><B>《帛琉4/5日》最佳玩水天堂，多樣的水底景觀。</B><br>浮潛、潛水最佳首選! 只要24,900起</a>";
messages[1]="<a href=http://www.oceanstar.com.tw/area/inside_island.php><B>《關島5/6日》渡假天堂～關島享受頂級假期!!</B><Br>自由行輕鬆玩遍關島只要16,500起</a>";
messages[0]="<a href=http://www.oceanstar.com.tw/area/inside_china.php><B>《直航大陸》直飛北京、上海、東北、貴林等等...超值優惠!</B><br>直飛省時快速，硬是比別人玩的充實!</a>";
messages[3]="<a href=http://www.oceanstar.com.tw/area/inside_island.php><B>《沙巴5日》神山遊蹤、刺激泛舟、頂級渡假、高爾夫假期、登神山探險</B><br>，沙巴讓你體驗陽光假期與多樣玩法。</a>";
messages[4]="<B>熱情春暉　雲遊四海</B><br>　服務專線：(02)2542-0888　傳真號碼：(02)2522-3177　服務信箱：service@oceanstar.com.tw";


if (messages.length>1){
i=totalMsg;
}else{
i=0;
}

function move1(whichlayer){
	tlayer=eval(whichlayer);
	if (tlayer.top>0&&tlayer.top<=5){
		tlayer.top=0;
		setTimeout("move1(tlayer)",chTime);
		setTimeout("move2(document.main2.document.second2)",chTime);
		return;
	}
	if (tlayer.top>=tlayer.document.height*-1){
		tlayer.top-=5;
		setTimeout("move1(tlayer)",100);
	}else{
		tlayer.top=scrollerheight;
		tlayer.document.write(messages[i]);
		tlayer.document.close();
		if (i==messages.length-1){
			i=0;
		}else{
			i++;
		}
	}
}

function move2(whichlayer){
	tlayer2=eval(whichlayer);
	if (tlayer2.top>0&&tlayer2.top<=5){
		tlayer2.top=0;
		setTimeout("move2(tlayer2)",chTime);
		setTimeout("move1(document.main2.document.first2)",chTime);
		return;
	}
	if (tlayer2.top>=tlayer2.document.height*-1){
		tlayer2.top-=5;
		setTimeout("move2(tlayer2)",100);
	}else{
		tlayer2.top=scrollerheight;
		tlayer2.document.write(messages[i]);
		tlayer2.document.close();
		if (i==messages.length-1){
			i=0;
		}else{
			i++;
		}
	}
}

function move3(whichdiv){
	tdiv=eval(whichdiv);
	if(isFirefox==true){
		TDtop=parseInt(tdiv.style.top);
		if (TDtop>0&&TDtop<=5){
			tdiv.style.top=0;
			setTimeout("move3(tdiv)",chTime);
			setTimeout("move4(second2)",chTime);
			return;
		}
		if (TDtop>=tdiv.offsetHeight*-1){
			tdiv.style.top=parseInt(tdiv.style.top)-5;
			setTimeout("move3(tdiv)",100);
		}else{
			tdiv.style.top=scrollerheight;
			tdiv.innerHTML=messages[i];
			if (i==messages.length-1){
				i=0;
			}else{
				i++;
			}
		}
	}else{
		if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
			tdiv.style.pixelTop=0;
			setTimeout("move3(tdiv)",chTime);
			setTimeout("move4(second2)",chTime);
			return;
		}
		if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
			tdiv.style.pixelTop-=5;
			setTimeout("move3(tdiv)",100);
		}else{
			tdiv.style.pixelTop=scrollerheight;
			tdiv.innerHTML=messages[i];
			if (i==messages.length-1){
				i=0;
			}else{
				i++;
			}
		}
	}
}

function move4(whichdiv){
	tdiv2=eval(whichdiv);
	if(isFirefox==true){
		TD2top=parseInt(tdiv2.style.top);
		if (TD2top>0&&TD2top<=5){
			tdiv2.style.top=0;
			setTimeout("move4(tdiv2)",chTime);
			setTimeout("move3(first2)",chTime);
			return;
		}
		if (TD2top>=tdiv2.offsetHeight*-1){
			tdiv2.style.top=parseInt(tdiv2.style.top)-5;
			setTimeout("move4(second2)",100);
		}else{
			tdiv2.style.top=scrollerheight;
			tdiv2.innerHTML=messages[i];
			if (i==messages.length-1){
				i=0;
			}else{
				i++;
			}
		}
	}else{
		if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
			tdiv2.style.pixelTop=0;
			setTimeout("move4(tdiv2)",chTime);
			setTimeout("move3(first2)",chTime);
			return;
		}
		if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
			tdiv2.style.pixelTop-=5;
			setTimeout("move4(second2)",100);
		}else{
			tdiv2.style.pixelTop=scrollerheight;
			tdiv2.innerHTML=messages[i];
			if (i==messages.length-1){
				i=0;
			}else{
				i++;
			}
		}
	}
}

function startscroll(){
	if (isFirefox|isIE|isIE7|isSafari){
		move3(first2);
		if(isFirefox==true){
			second2.style.top=scrollerheight;
		}else{
			second2.style.top=scrollerheight;
		}
	}else if (document.layers){
		move1(document.main2.document.first2);
		document.main2.document.second2.top=scrollerheight+5;
		document.main2.document.second2.visibility='show';
	}
}

window.onload=startscroll;
-->