<!--
var imgWindow = null;

function openIcon (dir,name) {
	var props = "directories=0,menubar=0,status=0,toolbar=0,location=0,height=325,width=300,resizable=0,scrollbars=0,screenX=0,screenY=0";
	imgWindow = window.open("./popup.php?dir=" + dir + "&V_name=" + V_NAME + "&name=" + name, "popUp", props);
}

function openImg (imgNum,totalNum) {
	var props = "directories=0,menubar=0,status=0,toolbar=0,location=0,height=325,width=300,resizable=0,scrollbars=0,screenX=0,screenY=0";
	imgWindow = window.open("./popup.php?picnum=" + imgNum + "&V_name=" + V_NAME + "&NUMofIMAGES=" + totalNum, "popUp", props);
}

function viewImg (imgNum,totalNum) {
	if ( imgNum <= 0 || imgNum > totalNum ) {
		alert(" Please enter a number between 1 and " + totalNum + "!");
	} else {
		openImg(imgNum,totalNum);
	}
}

function resize() {
	sizeX = imgWindow.document.images.imgDisp.width + 11;
	sizeY = imgWindow.document.images.imgDisp.height + 73;

	imgWindow.resizeTo( sizeX, sizeY );
}

function changeType ( DISPLAYtype ) {
	document.imageinput.setDISPLAYtype.value = DISPLAYtype;
	document.imageinput.submit();
}

function clickPage(PAGEcurrentVAR,PAGEdisplayVAR) {
	document.imageinput.setPAGEcurrent.value = PAGEcurrentVAR;
	document.imageinput.setPAGEdisplay.value = PAGEdisplayVAR;
	goSubmit(1);
}

function goDir( NEWdir, full ) {
	document.imageinput.setPAGEcurrent.value = 1;
	if ( full == 1 ) {
		document.imageinput.newDir.value = NEWdir;
	} else {
		document.imageinput.newDir.value += "\\" + NEWdir;
	}
	goSubmit(1);
}

function allPage() {
	confirmbox = confirm("Are you sure you wish to display ALL icons?  This could cause the page to take a long time to fully load.\n\nClick OK to Continue, or Cancel.");

	if ( confirmbox == true ) { 
		document.imageinput.setIMGdisplay.value = document.imageinput.IMGtotal.value;
		document.imageinput.setPAGEcurrent.value = 1;
		goSubmit(1);
	}
}

function goSubmit (sendSubmit) {
	if ( document.imageinput.setIMGdisplay.value < 0 ) {
		document.imageinput.setIMGdisplay.value = 0;
	}

	if ( document.imageinput.setIMGdisplay.value * ( document.imageinput.setPAGEcurrent.value - 1 ) > document.imageinput.IMGtotal.value ) {
		document.imageinput.setPAGEcurrent.value = Math.ceil(document.imageinput.IMGtotal.value / document.imageinput.setIMGdisplay.value);
		document.imageinput.setPAGEdisplay.value = 7;
	}
	if (sendSubmit)
		document.imageinput.submit();
	else
		return (true);
}

window.onfocus = function () { if ( imgWindow && !imgWindow.closed) imgWindow.close() };

// -->
