/*　*/
var id = "img_index_topbanner";
var timerId;
var index = 0;

function gid(tagId) {
	return document.getElementById(tagId);
}

function setFade(){
	setFadeIn();
}

function setFadeIn(){
	setImage();
	clearTimeout(timerId);
	opacity(id, 0, 100, 2000);
	timerId = setTimeout("setFadeOut()", 5000);
}

function setFadeOut(){
	clearTimeout(timerId);
	opacity(id, 100, 0, 2000);
	timerId = setTimeout("setFadeIn()", 2000);
}

function setImage(){
	var path = "images/new/";
	var image = Array("003.jpg", "001.jpg", "002.jpg");
	index++;
	if(index >= image.length) index = 0;
	gid(id).style.backgroundImage = "url(\"" + path + image[index] + "\")";
}
