<!--

var all;
var MaxAlbumDisplay;

if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

function SetAndGo() {
	if(document.getElementById('album_max') && MaxAlbumDisplay>=0) {
		document.getElementById('album_max').innerHTML=MaxAlbumDisplay+"";
	}
}

function alternate() {
	if(document.getElementById('older')) {
		if(document.getElementById('older').style.display=="block") {
			document.getElementById('older').style.display="none";
			document.getElementById('album_max').innerHTML=MaxAlbumDisplay+"";
			document.getElementById('showtag').innerHTML="Show all album(s)";
		}
		else {
			document.getElementById('older').style.display="block";
			document.getElementById('album_max').innerHTML=all+"";
			document.getElementById('showtag').innerHTML="Hide old album(s)";
		}
	}
}

function ImageResizeIf(Percentage,ImageOuterSpace) {
	if(document.images && document.images['cImage']) {
		var width=document.images['cImage'].width;
		var height=document.images['cImage'].height;

		if(Percentage==999) {
			if(width >= (screen.width-ImageOuterSpace)) {
				var widthFactor=width-(screen.width-ImageOuterSpace);
				Percentage=parseInt((100/width)*(screen.width-ImageOuterSpace));
			}
			else {
				Percentage=100;
			}
		}
		document.images['cImage'].width=(width/100)*Percentage;
		document.images['cImage'].height=(height/100)*Percentage;
	}
}

function JumpToPicture(MainFile, CurrentPicture, DirectoryName, maxid) {
	var id;
	id=parseInt(window.prompt("Enter Picture ID: ",(CurrentPicture+1)));

	if(id>0) {
		id=parseInt(id);
		--id;
		if(id < 0 || id >= parseInt(maxid)) {
			alert("Image Id: " + (id+1) + " not within boundary limits");
		}
		else return(MainFile + "?dir=" + DirectoryName + "&id=" + parseInt(id));
	}
	return 'javascript://';
}

function GetEmail(link) {
	var addr;
	if((addr=window.prompt("Enter e-mail address: ",''))!=null) {
		window.location.href="mailto:"+addr+"?subject=" + document.title + "&body=See this picture: "+link;
	}
	return 'javascript://';
}

function ExecuteAction(Object) {
	var url;
	if((url=Object[Object.selectedIndex].value)!="0") {
		if(url.indexOf("javascript:")!=-1) {
			window.location.href=eval(url);
		}
		else {
			window.location.href=url;
		}
	}
}

function ConfirmChecked() {
	if(document.thumbnail.rand.checked) {
		document.thumbnail.prv[2].checked=true;
		return;
	}
	document.thumbnail.prv[0].checked=true;
}

function ChangeStatus(With) {
	window.status=With;
}

function AlbumClicked(Name) {
	document.thumbnail.dir.value=Name;
	document.thumbnail.submit();
}

function Over() {
	window.event.srcElement.style.filter = "alpha(opacity=50)";
}

function Out() {
	window.event.srcElement.style.filter = "alpha(opacity=100)";
}

function RunSlideShow(){
	if (document.all) {
		document.images.SlideShow.style.filter=rand_anim[(Math.round(Math.random()*10)%rand_anim_len)];
		document.images.SlideShow.filters[0].Apply();
	}
	document.images.SlideShow.src = preLoad[j].src
	if (document.all) {
		document.images.SlideShow.filters[0].Play();
	}
	j = ((j+1)%(length))?j+1:0;
	t = setTimeout('RunSlideShow()', slideShowSpeed);
}
//-->