function OpenCam(IDspot)
{
	helpPage = document.getElementById('helppage');
	if (helpPage)
		helpPage.style.display = 'none'; 
	if(editor == 0 && HotSpot[IDspot].visflag & C_DELETED){
		return;
	}
		photosOpen++;	
		HideEnlargementPrompt();
		if (photosOpen == 4 && enlargements == 0 && nHotSpots > 4){
			ShowEnlargementPrompt();
		}
		photoSeq = photoSeq + IDspot +',';
	// hide old actvive and new green or red
		document.getElementById(newpref + IDspot).style.display = 'none'; 
		document.getElementById(vispref+ IDspot).style.display = 'none'; 
		document.getElementById(actpref + ActiveHotSpot).style.display = 'none';
		BlinkOff(IDspot);
		
	// show new active
	if((HotSpot[IDspot].visflag & C_ICONINVISIBLE) == 0){
		if(!InfoOpen()){
			window.status=actpref+" opencam "+IDspot;
			document.getElementById(actpref + IDspot).style.display = 'block';	
		}
	}

	// show old active	
		if (levelChange == 0 )
			document.getElementById(vispref + ActiveHotSpot).style.display = 'block';
		if(!slideTimeoutID)
			levelChange = 0;
		ActiveHotSpot = IDspot;
		document.getElementById('DescriptionHeader').innerHTML = HotSpot[ActiveHotSpot].Note;
		document.getElementById('DescriptionBody').innerHTML = HotSpot[ActiveHotSpot].LongDescr;
		
		OldPhotoH =  document.getElementById('Photograph').height;
		changePhoto('PhotographTmp');
		Fade ('PhotographTmp', 0.05, 0, 1, 40, "changePhoto('Photograph')");

		var SizeButton = document.getElementById("PhotoSizeButton");
		if (SizeButton){
		if(HotSpot[IDspot].visflag & C_NOENLARGEMENT)
			SizeButton.style.visibility="hidden";
		else
			SizeButton.style.visibility="visible";
			}
	if (editor){
		var inHtml = document.getElementById('PhotoButtonPrintable').innerHTML;
		var photoNameRegex= new RegExp("\\w+.jp\\w+");
		document.getElementById('PhotoButtonPrintable').innerHTML = inHtml.replace(photoNameRegex, photoNameRegex.exec(HotSpot[ActiveHotSpot].OrigSrc));;
	}
	return;
	
}


function changePhoto(phtg)
{
	var pht = document.getElementById(phtg);
	HotSpot[ActiveHotSpot].visited = true;
	if( HotSpot[ActiveHotSpot].Loaded || phtg == "PhotographTmp")
		if (enlarged)
			pht.src =  HotSpot[ActiveHotSpot].OrigSrc;
		else 
			pht.src =  HotSpot[ActiveHotSpot].ImgSrc;
	else{
		pht.src = supportPath+'/'+loading;
		if (enlarged)
			LoadActivePhotoHi(phtg);
		else
			LoadActivePhotoLow(phtg);
	}
}

function HotSpotObj(id, note, longDescr, ex, ey, ordinal, visflag, imgsrc, dir){
	this.id = id;
	this.ordinal = ordinal;
	this.Note = note;
	this.LongDescr = longDescr;
	this.Loaded = 0;

	var curLevel = levels[levels.length - 1];
	this.Level = curLevel;
	curLevel.AddHotSpot(this);

if ((visflag & C_DELETED) == 0){
   alert (id);
	var left=document.getElementById("r"+id).style.left;
	var pix = left.indexOf('p');
	this.NX = left.substring(0, pix);
	var top= document.getElementById("r"+id).style.top;
	pix = top.indexOf('p');
	this.NY = top.substring(0, pix);
}
	this.EX = ex;
	this.EY = ey;

if (visflag & C_GENERICIMAGE ){
// non -enlargeable too
	this.ImgSrc =  supportPath + '/' + imgsrc;
	this.OrigSrc = supportPath + '/' + imgsrc;
} else {
	this.ImgSrc = pathImgsSourceLoRes +'/'+ imgsrc;
	this.OrigSrc = pathImgsSourceHiRes + '/'+imgsrc;
}
	this.visited = false;
	this.visflag = visflag;
	this.dir = dir;
	nHotSpots++;
}

function togglePhotoSize()
{
	var Photograph = document.getElementById("Photograph");
	var PhotographTmp = document.getElementById("PhotographTmp");
	var Photo = document.getElementById("Photo");
	var PhotoTmp = document.getElementById("PhotoTmp");
	var PhotoCage = document.getElementById("PhotoContainer");
	var SizeButton = document.getElementById("PhotoSizeButton");
	var plan = document.getElementById("plan");
	var base = document.getElementById("base");
 	var	oldH = Photograph.height;
	HideEnlargementPrompt();
	enlarged = 1 - enlarged;
	if (enlarged){
		enlargements++;
		Photograph.src = HotSpot[ActiveHotSpot].OrigSrc; 
		PhotographTmp.src =	HotSpot[ActiveHotSpot].OrigSrc;
	//	Photo.width = Photograph.width;
		SizeButton.className = "PhotoButtonReduce";
		Photo.className = "PhotoLarge";
		PhotoTmp.className = "PhotoLargeTmp";
		document.getElementById(actpref + ActiveHotSpot).style.display = 'block';
		zoom_out();
		panEnabled = 1;

	}
	else {
		Photograph.src = HotSpot[ActiveHotSpot].ImgSrc; 
		PhotographTmp.src =	HotSpot[ActiveHotSpot].ImgSrc;
		var newH = Photograph.height;
		SizeButton.className = "PhotoButtonEnlarge";	
		Photo.className = "PhotoSmall";
		PhotoTmp.className = "PhotoSmallTmp";
		document.getElementById(vispref + ActiveHotSpot).style.display = 'none';
		panEnabled = 0;

	}	  
	setTimeout("moveElementsForSizeToggle("+enlarged+", "+oldH+")", 500);

}


function SlideShowNext()
{
	window.status="Slide show next clicked";
	var newHS = (ActiveHotSpot+1)%nHotSpots;
	while (HotSpot[newHS].visflag & C_DELETED)
		newHS = (newHS+1)%nHotSpots;
	var phtg = document.getElementById('Photograph');
	if (HotSpot[newHS].Level.ordinal == activeLevel){
		OpenCam(newHS);	
		moveElementsForSlideShow (enlarged, phtg.height);
	}
	else {
		ChangeLevel(HotSpot[newHS].Level.ordinal);
		moveElementsForSlideShow (enlarged, phtg.height);
		levelChange = 0;
	}
	if (slideTimeoutID)
		clearTimeout (slideTimeoutID);
	slideTimeoutID = setTimeout("SlideShowNext()", 4000);
}
function SlideShowToggle()
{
	slideshow = 1;
	window.status="Slide show "+SlideShowStatus[SlideShowCurrentStat] + " clicked";
	SlideShowCurrentStat= 1 - SlideShowCurrentStat; 
	document.getElementById('showplay').src = supportPath + "/round_button_"+SlideShowStatus[SlideShowCurrentStat]+".gif";
	if (SlideShowCurrentStat)
		SlideShowNext();
	else
		clearTimeout(slideTimeoutID);
	
}
function SlideShowRewind()
{
	if (SlideShowCurrentStat){
		window.status="Slide show rewind clicked";
		OpenCam(0);	
		SlideShowNext();
	}
}

<!-- 
 --><!-- 
 -->
