var imgIndex = 0;

function switchImg(option) {
	imgObj = document.getElementById('headerimg');
	imgNumObj = document.getElementById('imgNum');

	if(option == 1){
		if (imgIndex == 0) imgIndex = imgNames.length-1;
		else imgIndex-- ;
		imgObj.src = imgNames[imgIndex];
		imgNumObj.innerHTML = imgIndex + 1;
	}	else if(option == 2){
		if (imgIndex == imgNames.length-1) imgIndex = 0;
		else imgIndex++ ;
		imgObj.src = imgNames[imgIndex];
		imgNumObj.innerHTML = imgIndex + 1;
	}
	
	return false;
}