// JavaScript Document
var interval = 5000; //切り替わる時間（1000=1秒）
var imgs = new Array(); var hrefs = new Array(); var targets = new Array();
//５７６×２９６の画像を使用する
imgs[0] = new Image(); imgs[0].src = "http://jcom-net.co.jp/images/common/topimage_cloud.jpg"; hrefs[0] = "http://jcom-net.co.jp/cloud/"; targets[0] = "_self";
imgs[1] = new Image(); imgs[1].src = "http://jcom-net.co.jp/images/common/topimage_jcom.jpg"; hrefs[1] = "http://jcom-net.co.jp/outline/"; targets[1] = "_self";
imgs[2] = new Image(); imgs[2].src = "http://jcom-net.co.jp/images/common/topimage_pc.jpg"; hrefs[2] = "http://jcom-net.co.jp/bi/"; targets[2] = "_self";
imgs[3] = new Image(); imgs[3].src = "http://jcom-net.co.jp/images/common/topimage_simple.gif"; hrefs[3] = "http://jcom-net.co.jp/package/"; targets[3] = "_self";
// imgs[4] = new Image(); imgs[4].src = "http://jcom-net.co.jp/images/common/topimage_kikin.gif"; hrefs[4] = "http://jcom-net.co.jp/kikin/"; targets[4] = "_self";
var num = Math.floor(Math.random()*imgs.length);
document.write('<a href="'+hrefs[num]+'" id="cth" target="'+targets[num]+'"><img src="'+imgs[num].src+'" id="cti" style="border:0" /></a>');
var cti = document.getElementById("cti"); var cth = document.getElementById("cth");
setInterval(function(){
num += Math.floor(Math.random()*(imgs.length-1))+1;
if(num>=imgs.length) num -= imgs.length;
cti.src = imgs[num].src;
cth.href = hrefs[num];
cth.target = targets[num];
},interval);

