function ShowBlock(strIdOfBlockToShow, arrIdsOfAllBlocks) {
	for(i=0;i<arrIdsOfAllBlocks.length;i++) {
		document.getElementById(arrIdsOfAllBlocks[i]).style.display='none';
	}
	document.getElementById(strIdOfBlockToShow).style.display='block';
}

function MenuSelect(strIdOfItemToToggleOn, arrIdsOfAllItems) {

	for(i=0;i<arrIdsOfAllItems.length;i++) {
		itm = document.getElementById(arrIdsOfAllItems[i]);
		itm.className = itm.className.replace(/current/g,'');
	}

	itm = document.getElementById(strIdOfItemToToggleOn);
	itm.className = itm.className  + " current";

}


var currentFoto = 1;
var oldcurrentFoto = 0;
var currentVideo = 1;
var oldcurrentVideo = 0;

function MoveToPhoto(nr) {

	if(currentFoto == 0) {
		// Switch from Video view to Image view.
		//toggleOff(document.getElementById('video'+currentVideo));
		document.getElementById('imageBlock').style.display = 'block';
		document.getElementById('videoBlock').style.display = 'none';
		// nr = oldcurrentFoto;
		currentFoto = oldcurrentFoto;
		oldcurrentFoto = 0;
	}

	//toggleOff(document.getElementById('v'+currentVideo));
	document.getElementById('img'+currentFoto).style.display = 'none';
	document.getElementById('img'+nr).style.display = 'block';

	if (document.getElementById('i'+currentFoto)) {
		toggleOff(document.getElementById('i'+currentFoto));
		toggleOn(document.getElementById('i'+nr));
	}

	currentFoto = nr;
}

function ShowVideo(nv) {

	// Switch from Image view to Video view.
	if(currentFoto != 0) {
		document.getElementById('img'+currentFoto).style.display = 'none';
	}

	toggleOff(document.getElementById('i'+currentFoto));
	document.getElementById('imageBlock').style.display = 'none';
	document.getElementById('videoBlock').style.display = 'block';

	//document.getElementById('video'+currentVideo).style.display = 'none';
	//document.getElementById('video'+nv).style.display = 'block';
	
	//if (document.getElementById('v'+currentVideo)) {
	//	toggleOff(document.getElementById('v'+currentVideo));
	//	toggleOn(document.getElementById('v'+nv));
	//}	
	
	//currentVideo=nv;
	
	oldcurrentFoto = currentFoto;
	currentFoto = 0;		// video
}


function toggleOn(img) {
	img.src = img.getAttribute('onsrc');
}

function toggleOff(img) {
	img.src = img.getAttribute('offsrc');
}