var slidedescription
var coll
var i
var thispic
var imgct



function openslideshow(slideList,descriptions){
	slidewin = window.open("slideshow.html?list=" + slideList + "&desc="+descriptions , "Slides", "width=430, height=600, resizable=yes,scrollbars=no,top=20")
	slidewin.focus()	
}

function chgSlide(direction){

	thispic = thispic + direction
	if(thispic > imgct){
		thispic=0
	}
	if(thispic < 0){
		thispic = imgct
	}
	document.getElementById("mytitle").innerHTML = "Slide #"+(thispic+1)+" of " + (imgct + 1)

	document.mypicture.src = "photos/slideshow/" + mypix[thispic];
	
	window.location="#top";
	window.descframe.location.href = "photos/slideshow/" +slidedescription+"#"+ mypix[thispic];
	 coll =window.descframe.document.getElementsByTagName("Span");
	for(i=0; i<mypix.length; i++){
		coll[i].style.display = "none";
	}
	coll[thispic].style.display = "block";
	window.location="#top"
}

function inilist(loadlist){
	var iniwork = "" + loadlist
	thispic = 0
	var temp = new Array();
	temp = iniwork.split("=")
	slidedescription =temp[2]
	iniwork =temp[1]
	temp=iniwork.split("&")
	mypix=temp[0].split("|")
	imgct=mypix.length-1
	resetshow()
}

function resetshow(){
	thispic=0
	document.mypicture.src = "photos/slideshow/" + mypix[0] 
	document.getElementById("mytitle").innerHTML = "Slide #1 of " + (imgct + 1)
	window.frames.descframe.location.href= "photos/slideshow/" +slidedescription
}

function autoplay(){
	window.settimeout(chgSlide(1),1000)
}

function enlargepic(){
	picwin = window.open("photos/slideshow/" + mypix[thispic], "pix", "resizable=yes,scrollbars=yes,top=10")
}
