	// PDF windows cause problems. Apparently they are self-closed and references are lost.
	// Can't set the location or close PDF windows using javascript. Hence, just open repeatedly in _blank.

	// var DorothyWindow = null; -- don't need this because undeclared are Global
	
	function SubWindow(MyPhoto,MyCaption) {
		TheURL = 'Gallery.cfm?MyPhoto=' + MyPhoto + '&MyCaption=' + MyCaption;
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;			
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}

	function DocWindow(MyCNum) {
		TheURL = 'Research-DocShow.cfm?MyCNum=' + MyCNum;
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;			
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}

	function LibrarianDocWindow(MyLibrary,MyCNum) {
		TheURL = 'Librarian-DocShow.cfm?MyCNum=' + MyCNum + '&MyLibrary=' + MyLibrary;
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;			
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}

	function OffSite(TheURL) {
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;			
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}
	function DownloadC(TheURL) {
		TheURL = 'Downloader.cfm?MyFile=' + TheURL;
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;			
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}
	function DownloadK(TheURL) {
		TheURL = 'Downloader-kids.cfm?MyFile=' + TheURL;
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;			
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}

	// can't set the location or close PDF windows using javascript. Hence, just open repeatedly.
	function DownloadL(TheURL) {
		TheURL = 'Downloader-kids.cfm?MyFile=' + TheURL;
		
		if (window.DorothyWindow && !(window.DorothyWindow.closed)) {
			DorothyWindow.location = TheURL;
			//DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes')
		}
		else {
			DorothyWindow = window.open(TheURL, 'WSPCGallery', 'width=540,height=500,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes')
		}
		DorothyWindow.focus();		
	}
