var current_image;
var play_mode=0;
var oldIndex=0;
function GoToImage(number,headText){
	play_mode=0;
	viewPic(number);
	writeHeading(headText);
	document.control_form.SekvensForm.value=nameSekvens;
}
function animate_fwd(){
	if(play_mode==0){return;}
	if(current_image>last_pict){
		current_image=first_pict;
		setTimeout("animate_fwd()",1000);
	} else {
		viewPic(current_image);
		current_image++;
		setTimeout("animate_fwd()",300);
	}	
}
function viewPic(nr){
	document.imageform.animation.src=theImages[nr].src;
	document.anchors[oldIndex].style.textDecoration='none';
	document.anchors[nr].style.textDecoration='underline';
	oldIndex=nr;
}
function writeHeading(headText){

if(document.getElementById)
{document.getElementById('fcsthead').innerHTML= headText}

}
function startAnimation(){
	if(play_mode==0){
		document.control_form.SekvensForm.value=nameStopp;
		play_mode=1;
		current_image=first_pict;
		animate_fwd();
	} else {GoToImage(0)}
}
