<!--
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) || height >= (screen.height-ImageOuterSpace)) {
				var widthFactor=width-(screen.width-ImageOuterSpace);
				var heightFactor = height-(screen.height-ImageOuterSpace);
				var x;
				if(heightFactor>widthFactor) {
					Percentage=(screen.height-ImageOuterSpace);
					x=height;
				}
				else {
					Percentage=(screen.width-ImageOuterSpace);
					x=width;
				}
				Percentage=parseInt((100/x)*Percentage);
			}
			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=100)";
}
function Out() {
	window.event.srcElement.style.filter = "alpha(opacity=50)";
}
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);
}
//-->
