<!--
if (top.location != location) top.location.href = location.href;
//-->

document.write('<script language="JavaScript1.2" src="http://www.cwb.gov.tw/V6/js/s3p_val.js"><\/script>');
document.write('<script language="JavaScript1.2" src="http://www.cwb.gov.tw/V6/js/sbo_val.js" defer="defer"><\/script>');
document.write('<script language="JavaScript1.2" src="http://www.cwb.gov.tw/V6/js/s3o_val.js" defer="defer"><\/script>');
document.write('<script language="JavaScript1.2" src="http://www.cwb.gov.tw/V6/js/s3q_val.js" defer="defer"><\/script>');

var image_file=new Array(48);
var total=9;
var now_image=0;
var id;
var type='s3p_val';

function init(ty)
{
	document.getElementById("im").src='http://www.cwb.gov.tw'+ty[0][1];
}

function inits(ty)
{
	stop_image();
	type=ty;

	if(type=='sbo_val'){
		document.getElementById("im").src='http://www.cwb.gov.tw'+sbo_val[0][1];
	}else if(type=='s3p_val'){
		document.getElementById("im").src='http://www.cwb.gov.tw'+s3p_val[0][1];
	}else if(type=='s3q_val'){
		document.getElementById("im").src='http://www.cwb.gov.tw'+s3q_val[0][1];
	}else if(type=='s3o_val'){
		document.getElementById("im").src='http://www.cwb.gov.tw'+s3o_val[0][1];
	}
}

function stop_image()
{
	if(id)
		clearTimeout(id);

	for(i=0;i<20;i++)
		delete(image_file[i]);
}

function change_image(ty)
{
	stop_image();
	ii=0;
	for(i=total-1;i>=0;i--) {
			a = new Image();
			a.src='http://www.cwb.gov.tw'+ty[i][1];
			image_file[ii]= a;
			ii=ii+1;
	} 
	if(total>1) Loop();
	else
		document.getElementById("im").src=image_file[0].src;
}

function Loop() {
		document.getElementById("im").src=image_file[now_image].src;
		now_image=(now_image+1)%total;
		id = setTimeout('Loop()',1000);
}

function ShowMore()
{
	if(type=='sbo_val'){
		change_image(sbo_val);
	}else if(type=='s3p_val'){
		change_image(s3p_val);
	}else if(type=='s3q_val'){
		change_image(s3q_val);
	}else if(type=='s3o_val'){
		change_image(s3o_val);
	}
}

function SideDivShow(obj)
{
    if(obj.style.display == 'none')
        obj.style.display = 'inline';
    else
        obj.style.display = 'none';
}

function SideDivShows(obj,obj1)
{
    if(obj.style.display == 'none')
        obj.style.display = 'inline';
    else
        obj.style.display = 'none';

    if(obj1.style.display == 'none')
        obj1.style.display = 'inline';
    else
        obj1.style.display = 'none';
}

function showTrackbackurl() {
	prompt("此文章的引用連結:", document.location.href+'/trackback');
}

