//滾動新聞內容
var marqueeContent=new Array();

marqueeContent[0]='<b>繁體館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_1&url=http://www.books.com.tw/exep/prod/booksfile.php?item=0010482021">雙生石</a><br>';

marqueeContent[1]='<b>簡體館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_2&url=http://www.books.com.tw/exep/prod/china/chinafile.php?item=CN10698543">農歷使用手冊︰李居明2011兔年運程（升級版）</a><br>';

marqueeContent[2]='<b>外文館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_3&url=http://www.books.com.tw/exep/prod/booksfile.php?item=F010000028">Word Power Made Easy</a><br>';

marqueeContent[3]='<b>CD館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_4&url=http://www.books.com.tw/exep/cdfile.php?item=0020118226">The Shins / Wincing The Night Away</a><br>';

marqueeContent[4]='<b>DVD館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_5&url=http://www.books.com.tw/exep/prod/dvd/dvdfile.php?item=D020035568">暮光之城：蝕(雙碟精裝版) DVD</a><br>';

marqueeContent[5]='<b>雜誌館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_6&url=http://www.books.com.tw/exep/prod/magazine/mag_retail.php?item=R030032389">贏家時代：民國100年投資藏寶圖 特刊</a><br>';

marqueeContent[6]='<b>MOOK館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_7&url=http://www.books.com.tw/exep/prod/magazine/magfile.php?item=M020017166">魔法少女奈葉遊戲收藏卡</a><br>';

marqueeContent[7]='<b>美妝館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_8&url=http://www.books.com.tw/exep/prod/newprod_file.php?item=N000036673">白蘭氏傳統雞精6入</a><br>';

marqueeContent[8]='<b>衣飾精品 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_9&url=http://www.books.com.tw/exep/prod/newprod_file.php?item=N000114316">[OPEN! KIDS]OPEN海洋藍滾邊T-OPEN小將-120</a><br>';

marqueeContent[9]='<b>創意生活 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_10&url=http://www.books.com.tw/exep/prod/newprod_file.php?item=N000138097">【真心良品】璀璨閃耀鎖頭式包包掛勾 1入 -幻惑迷紫</a><br>';

marqueeContent[10]='<b>玩藝館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_11&url=http://www.books.com.tw/exep/prod/newprod_file.php?item=N000081508">日本河田積木 nanoblock系列 東京鐵塔</a><br>';

marqueeContent[11]='<b>美食館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_12&url=http://www.books.com.tw/exep/prod/newprod_file.php?item=N010097726">《起士公爵》朱古力圓舞曲乳酪蛋糕(6吋)</a><br>';

marqueeContent[12]='<b>3C館 | </b><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=wel_middle_05_13&url=http://www.books.com.tw/exep/prod/newprod_file.php?item=N000132324">創見 SJ25M2 320G 2.5吋微型防震硬碟</a><br>';


//定義常用變量
var marqueeInterval=new Array();
var marqueeId=0;
var marqueeDelay=3000;
var marqueeHeight=20;

//定義函數
function initMarquee() {
var str=marqueeContent[0];
document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" width:300px; onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)" width="100%"><div>'+str+'</div></div>');
marqueeId++;
marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {

var str=marqueeContent[marqueeId];
marqueeId++;
if(marqueeId>=marqueeContent.length) marqueeId=0;
//if(marqueeBox.childNodes.length==1) {
if (document.getElementById('marqueeBox').childNodes.length==1){
var nextLine=document.createElement('DIV');
nextLine.innerHTML=str;
//marqueeBox.appendChild(nextLine);
document.getElementById('marqueeBox').appendChild(nextLine);
}
else {
//marqueeBox.childNodes[0].innerHTML=str;
document.getElementById('marqueeBox').childNodes[0].innerHTML=str;
//marqueeBox.appendChild(marqueeBox.childNodes[0]);
//marqueeBox.scrollTop=0;
document.getElementById('marqueeBox').appendChild(document.getElementById('marqueeBox').childNodes[0]);
document.getElementById('marqueeBox').scrollTop=0;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",20);
}
function scrollMarquee() {
//marqueeBox.scrollTop++;
document.getElementById('marqueeBox').scrollTop++;
//if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
if(document.getElementById('marqueeBox').scrollTop%marqueeHeight==(marqueeHeight-1)){
clearInterval(marqueeInterval[1]);
}
}
initMarquee();
