
//News Bar script- By Premshree Pillai (premshree@hotmail.com)
//http://www.qiksearch.com/javascripts.htm
//Enhancements by Dynamic Drive
//Visit http://www.dynamicdrive.com for this script

 var msgs = new Array(
     "104民宿查號台的網頁更新了，更多資訊等著您探索哦!!........",
     "JavaScript Kit- free scripts and tutorials",
     "Freewarejava.com",
     "Wired News- Technology and beyond",
     "Qiksearch.com" ); // No comma after last ticker msg

 var msg_url = new Array(
     "http://www.104inn.com.tw",
     "http://www.javascriptkit.com",
     "http://freewarejava.com",
     "http://www.wired.com",
     "http://www.qiksearch.com" ); // No comma after last ticker url

var barwidth='350px' //Enter main bar width in px or %
var setdelay=3000 //Enter delay between msgs, in mili-seconds
var mouseover_color='#00f2F0' //Specify highlight color
var mouseout_color='#000000' //Specify default color
/////////////////////////////////////////////////////////////////////

var count=0;
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1



function init_news_bar(){
if (ie4||ns6){
document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="text-align:left;color:#000000;background:transparent; width:'+barwidth+'; height:14px; border-width:0; border-color:#000000; cursor:hand" onmouseover="this.style.color=mouseover_color" onmouseout="this.style.color=mouseout_color">');
}
else{

if (navigator.userAgent.indexOf("Opera")!=-1)
document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="width:'+barwidth+'" border="0">')
else
document.write('<input type="button" name="news_bar_but" onclick="goURL();" width="'+barwidth+'" border="0">')

}

  document.all.news_bar_but.value=msgs[count];
}
//moveit function by Dynamicdrive.com
function moveit(how){
if (how==1){ //cycle foward
if (count<msgs.length-1)
count++
else
count=0
}
else{ //cycle backward
if (count==0)
count=msgs.length-1
else
count--
}
document.all.news_bar_but.value=msgs[count];
}

setInterval("moveit(1)",setdelay)

function goURL(){
 location.href=msg_url[count];
}


