document.write('<link rel="stylesheet" href="/welcome/2007wel/wel_banner.css" type="text/css" />');
var imgWidth=560;
var imgHeight=155;
var _timeOut_=5000;
var timeOut=_timeOut_;
var timeOut2=_timeOut_/2;
var adNum=0; var target="_blank"; var button_Texton='#000000'; var button_Textoff='#ffffff';
var buttonLineOn="#005bac"; var buttonLineOff="#333333"; 
var imgUrl=new Array();
var imgText=new Array();
var imgLink=new Array();
var imgAlt=new Array();

var ver=2; var firstTime=true;
document.write('<div id="ad_pic" class="block02">');
document.write('<div id="f_div">');
document.write('<div id="f_imgDiv">');
imgUrl[1]='../IMG/banner_1.jpg?20100804';
imgText[1]='存摺貸10-50萬？';
imgLink[1]='http://www.okbank.com.tw/counter/gc.asp?g_id=18&c_id=492&s_id=2'; 
imgUrl[2]='../IMG/banner_2.jpg?20100902';
imgText[2]='好車貸回家！';
imgLink[2]='http://www.okbank.com.tw/counter/gc.asp?g_id=18&c_id=493&s_id=2'; 
imgUrl[3]='../IMG/banner_3.jpg?20100805';
imgText[3]='生命OK．一塊送愛';
imgLink[3]='http://www.okbank.com.tw/counter/gc.asp?g_id=18&c_id=494&s_id=2'; 
imgUrl[4]='../IMG/banner_4.jpg?20100625';
imgText[4]='房貸整合1.98％起';
imgLink[4]='http://www.okbank.com.tw/counter/gc.asp?g_id=18&c_id=495&s_id=2'; 
imgUrl[5]='../IMG/banner_5.jpg?20100730';
imgText[5]='165萬0利率？';
imgLink[5]='http://www.okbank.com.tw/counter/gc.asp?g_id=18&c_id=496&s_id=2'; 
function b_change(n){
adNum=n; window.clearInterval(theTimer);  adNum=adNum-1; change();
}

//計算筆數
var count=0;
for (var i=0;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgText[i]!="")&& (imgLink[i]!="")) {
count++;
} else {
break;
}
}
//重寫css的寬
var each_width=Math.ceil((imgWidth-(count-1))/count);
var last_width=imgWidth-each_width*(count-1)-(count)+1;
function change(){
if(adNum<(imgUrl.length-1))adNum++;
else adNum=1;
theTimer=setTimeout("change()", timeOut);
document.getElementById("f_img").src=imgUrl[adNum];
//var f_img=document.getElementById("f_img");
//f_img.src=imgUrl[adNum];
document.getElementById("f_imgLink").href=imgLink[adNum];
for (var i=1;i< count;i++){
 if (i !=adNum){
 document.getElementById('b'+i).className="button";
 }
 document.getElementById('b'+adNum).className="on"; }
}
document.write('<a id="f_imgLink" href="'+imgLink[adNum]+'" target=_blank><img id="f_img" src="" width='+imgWidth+' height='+imgHeight+' border="0"></a>');
document.write('</div>');
document.write('<div id="f_infoDiv">');
document.write('<div id="f_buttonDiv">');
for (var i=count-1;i>=1;i--){
document.write('<div id="div_bg'+i+'" class="bg"><a id="b'+i+'" href="javascript:b_change('+i+')" class="button">'+imgText[i]+'</a></div>');
}
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</div>'); change(); 