// gallery & slide show
var itemNum = 8;
var itemCurrent = 1;
function gallery_go(step) {
	itemCurrent += step;
	if (itemCurrent<=0) {
		itemCurrent = 1;
	} else if (itemCurrent>itemNum) {
		itemCurrent = 1;
	}
	
	// update the image
	gObj_2 = document.getElementById("gallery_item_" + itemCurrent);
	gObj_1 = document.getElementById("gallery_main");
	if (gObj_2 && gObj_1) {
		gObj_1.innerHTML = gObj_2.innerHTML;
	}
}

var kkl_slideshow = false;
function slideShow() {
	if (!kkl_slideshow) {
		return;
	}
	gallery_go(1);
	kkl_slideshow_timer = setTimeout("slideShow()", 2000);
}

function slideShow_start(wait) {
	if (!wait)
		wait = 2000;
	kkl_slideshow = true;
	kkl_slideshow_timer = setTimeout("slideShow()", wait);
}

function slideShow_stop() {
	kkl_slideshow = false;
}


// gallery & slide show 2
var itemNum2 = 8;
var itemCurrent2 = 1;
function gallery_go2(step2) {
	itemCurrent2 += step2;
	if (itemCurrent2<=0) {
		itemCurrent2 = 1;
	} else if (itemCurrent2>itemNum2) {
		itemCurrent2 = 1;
	}
	
	// update the image
	gObj_22 = document.getElementById("gallery_item2_" + itemCurrent);
	gObj_12 = document.getElementById("gallery_main2");
	if (gObj_22 && gObj_12) {
		gObj_12.innerHTML = gObj_22.innerHTML;
	}
}

var kkl_slideshow2 = false;
function slideShow2() {
	if (!kkl_slideshow2) {
		return;
	}
	gallery_go2(1);
	kkl_slideshow_timer2 = setTimeout("slideShow2()", 2000);
}

function slideShow_start2(wait2) {
	if (!wait2)
		wait2 = 2000;
	kkl_slideshow2 = true;
	kkl_slideshow_timer2 = setTimeout("slideShow2()", wait2);
}

function slideShow_stop2() {
	kkl_slideshow2 = false;
}


