function onThumb() {
	for(i=0;i<photoCnt;i++) {
		document.getElementById('thumbs'+i).nextSibling.className='';
		document.getElementById('thumbs'+i).childNodes[0].className='imgf';
	}
	document.getElementById('thumbs'+picNo).nextSibling.className='borders';
	document.getElementById('thumbs'+picNo).childNodes[0].className='imgf';
}

function nowPic() {
	var pg=Math.floor(picNo/(photoCnt/2));
	togPicBox(pg);
	for(i=0;i<photoCnt;i++) {
		if(i==picNo) document.getElementById('photoBox'+i).style.display = '';
		else  document.getElementById('photoBox'+i).style.display = 'none';
	}
	document.getElementById('photoTitle').innerHTML= gs_title[picNo];
	onThumb();
}

function overPic(thumbNo,type) {
	if(type!='auto') clearTimeout(slideTid);
	picNo = thumbNo;
	nowPic();
}

function initPhoto() {
	if(picNo>photoCnt-1) picNo = 0;
	overPic(picNo,'auto');
	picNo ++;
	slideTid = setTimeout('initPhoto()',delay);
}

function togPicBox(type) {
	if(type==1) {
		no=1;
		no1=2;
	}else if(type==0) {
		no=2;
		no1=1;
	}
	document.getElementById('thumbBox'+no).style.display='none';
	document.getElementById('thumbBox'+no1).style.display='';
}
