changeset 6:254fca7a21ce vendor

First import of client module
author robcast
date Thu, 17 Jan 2002 15:29:52 +0100
parents fa22d26c02d3
children 865c689a64d7
files client/digitallibrary/navcat_ie.js client/digitallibrary/navcat_n4.js client/digitallibrary/navcat_n6.js client/digitallibrary/navigation.html client/digitallibrary/navigation_ie.js client/digitallibrary/navigation_n4.js client/digitallibrary/navigation_n6.js
diffstat 7 files changed, 1924 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navcat_ie.js	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,142 @@
+/* navcat_ie -- JS library for digilib (IE version)
+
+  Digital Image Library servlet components
+
+  Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+  This program is free software; you can redistribute  it and/or modify it
+  under  the terms of  the GNU General  Public License as published by the
+  Free Software Foundation;  either version 2 of the  License, or (at your
+  option) any later version.
+   
+  Please read license.txt for the full details. A copy of the GPL
+  may be found at http://www.gnu.org/copyleft/lgpl.html
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// these two global variables have to be initialised before the frist use of the functions below
+// to fill in the attributes you can use the function initPicture provided below
+// - array with all attributes
+var att = new Array();
+
+// - variable to store the path to the frame, in which the pictures should be created
+var whichFrame = parent.mainFrame;
+
+// give a name to the window containing digicat - this way one can test if there is already a
+// digicat-window open and replace the contents of it (ex. digilib)
+window.name = "digicat";
+
+function loadThumbTable() {
+	tableWidth = whichFrame.document.body.offsetWidth-30;
+	tableHeight = whichFrame.document.body.offsetHeight-30;
+
+	cellWidth = Math.floor(tableWidth/att[3])-9;
+	cellHeight = Math.floor(tableHeight/att[2])-6;
+	
+//	alert(tableWidth + "   " + tableHeight + "\n" + cellWidth + "   " +cellHeight);
+
+	whichFrame.document.open();
+	whichFrame.document.write('<html><head>');
+	whichFrame.document.write('<style type="text/css">.myFont {font-family: sans-serif, Arial; font-size: 11px; color: #FFFFFF}</style>');
+	whichFrame.document.write('<script language="Javascript">');
+	whichFrame.document.write('function loadDigilib(idx) {');
+	whichFrame.document.write('linkRef = "http://' + location.host + '/docuserver/digitallibrary/digilib.html?' + parent.att[0] + '+" + idx;');
+	whichFrame.document.write('win = window.open(linkRef, "digilib");');
+	whichFrame.document.write('win.focus();');	
+	whichFrame.document.write('}');	
+	whichFrame.document.write('</script>');	
+
+
+	whichFrame.document.write('</head><body bgcolor="#666666">');
+	whichFrame.document.write('<table border="1" width="' + tableWidth + '" height="' + tableHeight + '">');
+	for (i = 0; i < att[2]; i++) {
+		whichFrame.document.write('<tr>');
+		for (j = 0; j < att[3]; j++) {
+			indexNr = parseInt(att[1])+i*parseInt(att[3])+j;
+			thumb  = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/"
+			thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=fit&dw=" + cellWidth + "&dh=" + (cellHeight-25);
+			whichFrame.document.write('<td align="center" valign="middle" width="' + cellWidth + '" height="' + cellHeight + '" class="myFont">');
+			whichFrame.document.write('<a href="javascript:loadDigilib(' + indexNr + ')">');
+			whichFrame.document.write('<img src="' + thumb + '" border="0">');
+			whichFrame.document.write('</a><br>');
+			whichFrame.document.write(indexNr + '</td>');
+		}
+		whichFrame.document.write('</tr>');
+	}
+	whichFrame.document.write('</table></body></html>');
+	whichFrame.document.close();
+
+	initScripts();
+}
+
+
+function Backpage() {
+
+	if (att[1] <= 1) {
+		att[1] = 1;
+        alert("You are already on the first page!");
+	}
+	
+    att[1] = parseInt(att[1])-parseInt(att[2]*att[3]);
+
+    if (att[1] < 1) {
+    	att[1] = 1;
+    }
+	loadThumbTable();
+}
+
+
+
+function Nextpage() {
+
+    att[1] = parseInt(att[1])+parseInt(att[2]*att[3]);
+	loadThumbTable();
+}
+
+
+// capturing keypresses for next and previous page
+function parseKeypress() {
+	e = whichFrame.event;
+
+	if (e.keyCode == 110) {
+		Nextpage();
+	}
+	if (e.keyCode == 98) {
+		Backpage();
+	}
+	whichFrame.document.cancleBubble = true;
+}
+
+
+
+// initialize browser specific things (keypress caputring)
+function initScripts() {
+	whichFrame.document.onkeypress = parseKeypress;
+	whichFrame.focus();
+}
+
+
+// fill in the values of the "att"-array
+function initPicture(picURL) {
+	att = picURL.split("+");
+
+	if (att[0].lastIndexOf("/") == att[0].length-1) {
+		att[0] = att[0].substring(0, att[0].length-1);
+	}
+	
+	if (att.length < 2 || att[1] == "") {
+		att[1] = 1;
+	}
+
+	if (att.length < 3 || att[2] == "") {
+		att[2] = 3;
+	}
+
+	if (att.length < 4) {
+		att[3] = 4;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navcat_n4.js	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,135 @@
+/* navcat_n4 -- JS library for digilib (Netscape4 version)
+
+  Digital Image Library servlet components
+
+  Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+  This program is free software; you can redistribute  it and/or modify it
+  under  the terms of  the GNU General  Public License as published by the
+  Free Software Foundation;  either version 2 of the  License, or (at your
+  option) any later version.
+   
+  Please read license.txt for the full details. A copy of the GPL
+  may be found at http://www.gnu.org/copyleft/lgpl.html
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// these two global variables have to be initialised before the frist use of the functions below
+// to fill in the attributes you can use the function initPicture provided below
+// - array with all attributes
+var att = new Array();
+
+// - variable to store the path to the frame, in which the pictures should be created
+var whichFrame = parent.mainFrame;
+
+// give a name to the window containing digicat - this way one can test if there is already a
+// digicat-window open and replace the contents of it (ex. digilib)
+window.name = "digicat";
+
+function loadThumbTable() {
+	tableWidth = whichFrame.innerWidth-30;
+	tableHeight = whichFrame.innerHeight-30;
+
+	cellWidth = Math.floor(tableWidth/att[3])-6;
+	cellHeight = Math.floor(tableHeight/att[2])-4;
+	
+//	alert(tableWidth + "   " + tableHeight + "\n" + cellWidth + "   " +cellHeight);
+
+	whichFrame.document.open();
+	whichFrame.document.write('<html><head>');
+	whichFrame.document.write('<style type="text/css">.myFont {font-family: sans-serif, Arial; font-size: 11px; color: #FFFFFF}</style>');
+	whichFrame.document.write('<script language="Javascript">');
+	whichFrame.document.write('function loadDigilib(idx) {');
+	whichFrame.document.write('linkRef = "http://' + location.host + '/docuserver/digitallibrary/digilib.html?' + parent.att[0] + '+" + idx;');
+	whichFrame.document.write('win = window.open(linkRef, "digilib");');
+	whichFrame.document.write('win.focus();');	
+	whichFrame.document.write('}');	
+	whichFrame.document.write('</script>');	
+
+
+	whichFrame.document.write('</head><body bgcolor="#666666">');
+	whichFrame.document.write('<table border="1" width="' + tableWidth + '" height="' + tableHeight + '">');
+	for (i = 0; i < att[2]; i++) {
+		whichFrame.document.write('<tr>');
+		for (j = 0; j < att[3]; j++) {
+			indexNr = parseInt(att[1])+i*parseInt(att[3])+j;
+			thumb  = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/"
+			thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=fit&dw=" + cellWidth + "&dh=" + (cellHeight-25);
+			whichFrame.document.write('<td align="center" valign="middle" width="' + cellWidth + '" height="' + cellHeight + '" class="myFont">');
+			whichFrame.document.write('<a href="javascript:loadDigilib(' + indexNr + ')">');
+			whichFrame.document.write('<img src="' + thumb + '" border="0">');
+			whichFrame.document.write('</a><br>');
+			whichFrame.document.write(indexNr + '</td>');
+		}
+		whichFrame.document.write('</tr>');
+	}
+	whichFrame.document.write('</table></body></html>');
+	whichFrame.document.close();
+}
+
+
+function Backpage() {
+
+	if (att[1] <= 1) {
+		att[1] = 1;
+        alert("You are already on the first page!");
+	}
+	
+    att[1] = parseInt(att[1])-parseInt(att[2]*att[3]);
+
+    if (att[1] < 1) {
+    	att[1] = 1;
+    }
+	loadThumbTable();
+}
+
+
+function Nextpage() {
+
+    att[1] = parseInt(att[1])+parseInt(att[2]*att[3]);
+	loadThumbTable();
+}
+
+
+// capturing keypresses for next and previous page
+function parseKeypress(event) {
+	var whichCode = (window.Event) ? event.which : event.keyCode;
+	if (String.fromCharCode(whichCode) == "n") {
+		Nextpage();
+	}
+	if (String.fromCharCode(whichCode) == "b") {
+		Backpage();
+	}
+}
+
+
+// initialize browser specific things (keypress caputring)
+function initScripts() {
+	window.captureEvents(Event.KEYDOWN);
+	window.onkeydown = parseKeypress;
+}
+
+
+// fill in the values of the "att"-array
+function initPicture(picURL) {
+	att = picURL.split("+");
+
+	if (att[0].lastIndexOf("/") == att[0].length-1) {
+		att[0] = att[0].substring(0, att[0].length-1);
+	}
+	
+	if (att.length < 2 || att[1] == "") {
+		att[1] = 1;
+	}
+	if (att.length < 3 || att[2] == "") {
+		att[2] = 3;
+	}
+
+	if (att.length < 4) {
+		att[3] = 4;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navcat_n6.js	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,141 @@
+/* navcat_n6 -- JS library for digilib (Mozilla version)
+
+  Digital Image Library servlet components
+
+  Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+  This program is free software; you can redistribute  it and/or modify it
+  under  the terms of  the GNU General  Public License as published by the
+  Free Software Foundation;  either version 2 of the  License, or (at your
+  option) any later version.
+   
+  Please read license.txt for the full details. A copy of the GPL
+  may be found at http://www.gnu.org/copyleft/lgpl.html
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// these two global variables have to be initialised before the frist use of the functions below
+// to fill in the attributes you can use the function initPicture provided below
+// - array with all attributes
+var att = new Array();
+
+// - variable to store the path to the frame, in which the pictures should be created
+var whichFrame = parent.mainFrame;
+
+// give a name to the window containing digicat - this way one can test if there is already a
+// digicat-window open and replace the contents of it (ex. digilib)
+window.name = "digicat";
+
+function loadThumbTable() {
+	tableWidth = whichFrame.innerWidth-30;
+	tableHeight = whichFrame.innerHeight-30;
+
+	cellWidth = Math.floor(tableWidth/att[3])-6;
+	cellHeight = Math.floor(tableHeight/att[2])-4;
+	
+//	alert(tableWidth + "   " + tableHeight + "\n" + cellWidth + "   " +cellHeight);
+
+	whichFrame.document.open();
+	whichFrame.document.write('<html><head>');
+	whichFrame.document.write('<style type="text/css">.myFont {font-family: sans-serif, Arial; font-size: 11px; color: #FFFFFF}</style>');
+	whichFrame.document.write('<script language="Javascript">');
+	whichFrame.document.write('function loadDigilib(idx) {');
+	whichFrame.document.write('linkRef = "http://' + location.host + '/docuserver/digitallibrary/digilib.html?' + parent.att[0] + '+" + idx;');
+	whichFrame.document.write('win = window.open(linkRef, "digilib");');
+	whichFrame.document.write('win.focus();');	
+	whichFrame.document.write('}');	
+	whichFrame.document.write('</script>');	
+
+
+	whichFrame.document.write('</head><body bgcolor="#666666">');
+	whichFrame.document.write('<table border="1" width="' + tableWidth + '" height="' + tableHeight + '">');
+	for (i = 0; i < att[2]; i++) {
+		whichFrame.document.write('<tr>');
+		for (j = 0; j < att[3]; j++) {
+			indexNr = parseInt(att[1])+i*parseInt(att[3])+j;
+			thumb  = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/"
+			thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=fit&dw=" + cellWidth + "&dh=" + (cellHeight-25);
+			whichFrame.document.write('<td align="center" valign="middle" width="' + cellWidth + '" height="' + cellHeight + '" class="myFont">');
+			whichFrame.document.write('<a href="javascript:loadDigilib(' + indexNr + ')">');
+			whichFrame.document.write('<img src="' + thumb + '" border="0">');
+			whichFrame.document.write('</a><br>');
+			whichFrame.document.write(indexNr + '</td>');
+		}
+		whichFrame.document.write('</tr>');
+	}
+	whichFrame.document.write('</table></body></html>');
+	whichFrame.document.close();
+
+	initScripts();
+}
+
+
+function Backpage() {
+
+	if (att[1] <= 1) {
+		att[1] = 1;
+        alert("You are already on the first page!");
+	}
+	
+    att[1] = parseInt(att[1])-parseInt(att[2]*att[3]);
+
+    if (att[1] < 1) {
+    	att[1] = 1;
+    }
+	loadThumbTable();
+}
+
+
+
+function Nextpage() {
+
+    att[1] = parseInt(att[1])+parseInt(att[2]*att[3]);
+	loadThumbTable();
+}
+
+
+// capturing keypresses for next and previous page
+// ascii-values of n = 110, b = 98
+function parseKeypress (event) {
+	if (event.charCode == 110) {
+		Nextpage();
+	}
+	if (event.charCode == 98) {
+		Backpage();
+	}
+}
+
+
+// initialize browser specific things (keypress caputring)
+function initScripts() {
+	for (var f = 0; f < frames.length; f++) {
+		frames[f].document.addEventListener('keypress', parseKeypress, true);
+	}
+	whichFrame.focus();
+}
+
+
+// fill in the values of the "att"-array
+function initPicture(picURL) {
+	att = picURL.split("+");
+
+	if (att[0].lastIndexOf("/") == att[0].length-1) {
+		att[0] = att[0].substring(0, att[0].length-1);
+	}
+	
+	if (att.length < 2 || att[1] == "") {
+		att[1] = 1;
+	}
+
+	if (att.length < 3 || att[2] == "") {
+		att[2] = 3;
+	}
+
+	if (att.length < 4) {
+		att[3] = 4;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navigation.html	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,105 @@
+<html>
+<head>
+<style type="text/css">
+.menu {position:absolute; visibility:hidden}
+
+.item1 {position:absolute; left:33; width:50; height:14; clip:rect(0,50,14,0); visibility:hidden}
+.item2 {position:absolute; left:43; width:40; height:14; clip:rect(0,40,14,0); visibility:hidden}
+.item3 {position:absolute; left:3; width:80; height:14; clip:rect(0,80,14,0); visibility:hidden}
+
+.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none}
+</style>
+<script language="JavaScript" src="buttons/menu.js"></script>
+<script language="JavaScript" src="page.js"></script>
+<script language="JavaScript">
+// because on a netscape 4.xx bug (messing up with layers on resize) we cache the window
+// resize event and redisplay the navigation frame
+if (document.layers && !document.getElementById) {
+	window.onresize = function() {parent.rightFrame.location.reload();}
+}
+
+
+// variable that store the texts for contexthelp
+var helpText = new Array();
+
+helpText[0]  = "'back'-button|Click on this button to load the previous image (usually the next page from a manuscript).";
+helpText[1]  = "'next'-button|Click on this button to load the next image (usually the next page from a manuscript).";
+helpText[2]  = "'page'-button|After clicking 'page' you will be prompted for a specific page you want to see.<br>Note that the page number refers to the same serie you are in now.";
+helpText[3]  = "'digicat'-button|Click here to open a new window containing thumbnails of the current series pages to navigate.";
+helpText[4]  = "'mark'-button|You can set marks into the picture. After hitting 'mark' you have to click on the desired picures location, a numbered mark appears.<br>Check out 'reference' to make these marks (up to 8) visible for others.";
+helpText[5]  = "'reference'-button|Choose LaTeX or HTML mode to get a link for the actual (zoomed) picture with all set marks.<br>This link can easily be included in a TeX- or HTML-formatted document/page.";
+helpText[6]  = "'zoom area'-button|With 'zoom area' you can zoom into any rectangular field for the current picture.<br>After clicking on the button click on the image to set any corner (ex. topleft), release the mousebutton and move the mouse until you have the desired size, then click again.";
+helpText[7]  = "'zoom point'-button|Click on 'zoom point' then click into a point of the picture. This gives you a zoomed picture centered around your clicked point.";
+helpText[8]  = "'zoom out'-button|To gain the original unzoomed picture, click on 'zoom out'.<br>Note that any set marks are still saved at their positions.";
+helpText[9]  = "'move to'-button|This button allows you change the center of a zoomed picture, while not changing the current zoom-factor.<br>Use: Click on the point in the picture you want to be the new center of the image.";
+helpText[10] = "'scale'-button|By clicking on one of the menu entries you can select the factor the currently displayed picture will be scaled.<br>Note: a scale factor of '1.0' means that the picture fits right into the working area, while '2.0' means that it will be twice as high and large.";
+helpText[11] = "'?'-button|In its menu you are able change options like the visibility of this contextsensitive help, with 'Keep area' the program keeps its current area when changing to another page or with 'Fit GIFs' you can force to program to adjust the size of GIF-images to the working area.";
+
+
+// boolean variable to eighter show or not show the additional help
+// change in the menuitem its original mark
+var showHelp = false;
+
+// variable to tell if while changing to another page it should keep the area
+// change in the menuitem its original mark
+var keepArea = true;
+
+// changes to the correct mark of menu33 (fit GIFs)
+// I know it is not very nice to do it this way
+function checkAtt3() {
+	if (parent.att) {
+		if (parent.att.length >= 3) {
+			if (parent.att[3].indexOf('f') > -1) changeMark(33);
+		} else {
+			setTimeout("checkAtt3()", 100);
+		}
+	}
+}
+
+</script>
+</head>
+
+<body bgcolor="#CCCCCC" leftmargin="8" marginwidth="8" topmargin="5" marginheight="5" onload="preloadImages();" onunload="closeContextHelp()">
+<a href="#" onClick="parent.Backpage(keepArea); return false;" onmouseover="overButton(0)" onmouseout="awayButton(0)"><img src="buttons/back0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onClick="parent.Nextpage(keepArea); return false;" onmouseover="overButton(1)" onmouseout="awayButton(1)"><img src="buttons/next0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onClick="parent.Page(keepArea); return false;" onmouseover="overButton(2)" onmouseout="awayButton(2)"><img src="buttons/page0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onClick="parent.Digicat(); return false;" onmouseover="overButton(3)" onmouseout="awayButton(3)"><img src="buttons/digicat0.gif" width="73" height="30" border="0"></a><br><br>
+<a href="#" onClick="parent.Mark(); return false;" onmouseover="overButton(4)" onmouseout="awayButton(4)"><img src="buttons/mark0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onclick="hideMenu(); showMenu(1); return false;" onmouseover="overButton(5)" onmouseout="awayButton(5)"><img src="buttons/reference0.gif" width="73" height="30" border="0"></a><br><br>
+<a href="#" onClick="parent.Zoomrect(); return false;" onmouseover="overButton(6)" onmouseout="awayButton(6)"><img src="buttons/zoomarea0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onClick="parent.Zoomin(); return false;" onmouseover="overButton(7)" onmouseout="awayButton(7)"><img src="buttons/zoompoint0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onClick="parent.Zoomout(); return false;" onmouseover="overButton(8)" onmouseout="awayButton(8)"><img src="buttons/zoomout0.gif" width="73" height="30" border="0"></a><br>
+<a href="#" onClick="parent.Moveto(); return false;" onmouseover="overButton(9)" onmouseout="awayButton(9)"><img src="buttons/moveto0.gif" width="73" height="30" border="0"></a><br><br>
+<a href="#" onclick="hideMenu(); showMenu(2); return false;" onmouseover="overButton(10)" onmouseout="awayButton(10)"><img src="buttons/scale0.gif" width="73" height="30" border="0"></a><br><br>
+<a href="#" onclick="hideMenu(); showMenu(3); return false;" onmouseover="overButton(11)" onmouseout="awayButton(11)"><img src="buttons/questionmark0.gif" width="73" height="30" border="0"></a>
+
+<div id="menu1" class="menu" style="top:211; left:31; width:54; height:33; clip:rect(0,54,33,0)"></div>
+ <div id="menu11" class="item1" style="top:213"><center><a href="#" class="text" onClick="hideMenu(); parent.Ref(0); return false;" onmouseover="overItem(11)" onmouseout="awayItem(11)">LaTeX</a></center></div>
+ <div id="menu12" class="item1" style="top:228"><center><a href="#" class="text" onClick="hideMenu(); parent.Ref(1); return false;" onmouseover="overItem(12)" onmouseout="awayItem(12)">HTML</a></center></div>
+
+<div id="menu2" class="menu" style="top:399; left:41; width:44; height:93; clip:rect(0,44,93,0)"></div>
+ <div id="menu21" class="item2" style="top:401"><center><a href="#" class="text" onClick="hideMenu(); parent.Scaledef(0.7); return false;" onmouseover="overItem(21)" onmouseout="awayItem(21)">0.7</a></center></div>
+ <div id="menu22" class="item2" style="top:416"><center><a href="#" class="text" onClick="hideMenu(); parent.Scaledef(1.0); return false;" onmouseover="overItem(22)" onmouseout="awayItem(22)">1.0</a></center></div>
+ <div id="menu23" class="item2" style="top:431"><center><a href="#" class="text" onClick="hideMenu(); parent.Scaledef(1.5); return false;" onmouseover="overItem(23)" onmouseout="awayItem(23)">1.5</a></center></div>
+ <div id="menu24" class="item2" style="top:446"><center><a href="#" class="text" onClick="hideMenu(); parent.Scaledef(2.0); return false;" onmouseover="overItem(24)" onmouseout="awayItem(24)">2.0</a></center></div>
+ <div id="menu25" class="item2" style="top:461"><center><a href="#" class="text" onClick="hideMenu(); parent.Scaledef(2.5); return false;" onmouseover="overItem(25)" onmouseout="awayItem(25)">2.5</a></center></div>
+ <div id="menu26" class="item2" style="top:476"><center><a href="#" class="text" onClick="hideMenu(); parent.Scaledef(3.0); return false;" onmouseover="overItem(26)" onmouseout="awayItem(26)">3.0</a></center></div>
+
+<div id="menu3" class="menu" style="top:448; left:1; width:84; height:48; clip:rect(0,84,48,0)"></div>
+ <div id="menu31" class="item3" style="top:450"><center><a href="#" class="text" onclick="changeMark(31); hideMenu(); changeHelp(); return false;" onmouseover="overItem(31)" onmouseout="awayItem(31)"><img id="mark31" src="buttons/nomark.gif" border="0">Contexthelp</a></center></div>
+ <div id="menu32" class="item3" style="top:465"><center><a href="#" class="text" onclick="changeMark(32); keepArea = !keepArea; return false;" onmouseover="overItem(32)" onmouseout="awayItem(32)"><img id="mark32" src="buttons/mark.gif" border="0">Keep&nbsp;area</a></center></div>
+ <div id="menu33" class="item3" style="top:480"><center><a href="#" class="text" onclick="changeMark(33); (parent.att[3].indexOf('f') > -1) ? parent.att[3] = '' : parent.att[3] = 'fit'; parent.loadPicture(2, keepArea); return false;" onmouseover="overItem(33)" onmouseout="awayItem(33)"><img id="mark33" src="buttons/nomark.gif" border="0">Fit&nbsp;GIFs</a></center></div>
+
+
+<script language="Javascript">
+// initial background color of the menues (has to be done like this, 
+// otherwise menues in ns4 you will have wrong dimensions)
+changeBc("menu1", "#666666");
+changeBc("menu2", "#666666");
+changeBc("menu3", "#666666");
+
+// launch the initial check of att[3] (fit gifs) and change to the correct mark
+checkAtt3();
+</script>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navigation_ie.js	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,472 @@
+/* navigation_ie -- JS library for digilib (IE version)
+
+  Digital Image Library servlet components
+
+  Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+  This program is free software; you can redistribute  it and/or modify it
+  under  the terms of  the GNU General  Public License as published by the
+  Free Software Foundation;  either version 2 of the  License, or (at your
+  option) any later version.
+   
+  Please read license.txt for the full details. A copy of the GPL
+  may be found at http://www.gnu.org/copyleft/lgpl.html
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// these two global variables have to be initialised before the frist use of the functions below
+// to fill in the attributes you can use the function initPicture provided below
+// - array with all attributes
+var att = new Array();
+
+// - variable to store the path to the frame, in which the pictures should be created
+var whichFrame = parent.mainFrame;
+
+// give a name to the window containing digilib - this way one can test if there is already a
+// digilib-window open and replace the contents of it (ex. digicat)
+window.name = "digilib";
+
+// function that launches the ScaleServlet
+// the different detailGrades:
+// 		0 -> back, next, page
+//		1 -> zoomout
+//		2 -> zoomarea, zoompoint, moveto, scaledef
+
+function loadPicture(detailGrade, keepArea) {
+
+//	alert("wx: " + att[5] + "\tww: " + att[7] + "\nwy: " + att[6] + "\twh: " + att[8]);
+
+	// sorry about that, but IE needs to have a document body to calc the frames width and height
+	whichFrame.document.open();
+	whichFrame.document.write('<html><head></head><body bgcolor="#666666" topmargin="10" leftmargin="10" marginwidth="10" magrinheight="10">');
+
+	var newPicture  = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/"
+	newPicture += att[0] + "?" + "pn=" + att[1] + "&ws=" + att[2];
+	newPicture += "&dw=" + (whichFrame.document.body.clientWidth-30) + "&dh=" + (whichFrame.document.body.clientHeight-30);
+	newPicture += "&mo=" + att[3];
+
+	if (detailGrade == 0) {
+		att[4] = "0/0";
+	}
+
+	if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) {
+		att[5] = 0;
+		att[6] = 0;
+		att[7] = 1;
+		att[8] = 1;
+	}
+	newPicture += "&wx=" + att[5] + "&wy=" + att[6] + "&ww=" + att[7] + "&wh=" + att[8];
+
+	whichFrame.document.write('<div ID="lay1" style="position:absolute; left:10;  top:10;  visibility:visible"><img name="pic" src="' + newPicture + '"></div>');
+	whichFrame.document.write('<div ID="dot0" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark1.gif"></div>');
+	whichFrame.document.write('<div ID="dot1" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark2.gif"></div>');
+	whichFrame.document.write('<div ID="dot2" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark3.gif"></div>');
+	whichFrame.document.write('<div ID="dot3" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark4.gif"></div>');
+	whichFrame.document.write('<div ID="dot4" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark5.gif"></div>');
+	whichFrame.document.write('<div ID="dot5" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark6.gif"></div>');
+	whichFrame.document.write('<div ID="dot6" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark7.gif"></div>');
+	whichFrame.document.write('<div ID="dot7" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark8.gif"></div>');
+	whichFrame.document.write('<div ID="eck1" style="position:absolute; left:-20; top:120; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/olinks.gif"></div>');
+	whichFrame.document.write('<div ID="eck2" style="position:absolute; left:-20; top:140; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/orechts.gif"></div>');
+	whichFrame.document.write('<div ID="eck3" style="position:absolute; left:-20; top:160; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/ulinks.gif"></div>');
+	whichFrame.document.write('<div ID="eck4" style="position:absolute; left:-20; top:180; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/urechts.gif"></div>');
+
+	whichFrame.document.write('</body></html>');
+	
+	whichFrame.document.close();
+
+	initScripts();
+	
+	pageInfo();
+
+	setmark();
+}
+
+
+function Backpage(keepArea) {
+
+    att[1] = parseInt(att[1]) - 1;
+
+    if (att[1] > 0) {
+        loadPicture(0, keepArea);
+    } else {
+	    att[1] = parseInt(att[1]) + 1;
+        alert("You are already on the first page!");
+    }
+}
+
+
+function Nextpage(keepArea) {
+
+    att[1] = parseInt(att[1]) + 1;
+
+    if (att[1] <= parent.numPages) {
+        loadPicture(0, keepArea);
+    } else {
+	    att[1] = parseInt(att[1]) - 1;
+        alert("You are already on the last page!");
+    }
+}
+
+
+function Page(keepArea) {
+
+	do {
+    	page = prompt("Goto Page (1 - " + parent.numPages + "):", 1);
+	} while ((page != null) && ((page < 1) || (page > parent.numPages)));
+
+   	if (page != null && page != att[1]) {
+		att[1] = page;
+		loadPicture(0, keepArea);
+	}
+}
+
+
+function Digicat() {
+	var url = "http://" + location.host + "/docuserver/digitallibrary/digicat.html?" + att[0] + "+" + att[1];
+	win = window.open(url, "digicat");
+	win.focus();
+}
+
+
+function Ref(refselect) {
+
+	var hyperlinkRef = "http://" + location.host + "/docuserver/digitallibrary/digilib.jsp?";
+	hyperlinkRef += att[0] + "+" + att[1] + "+" + att[2] + "+" + att[3] + "+" + att[4];
+	
+	if ((att[5] != 0) || (att[6] != 0) || (att[7] != 1) || (att[8] != 1)) {
+		hyperlinkRef += "+" + att[5] + "+" + att[6] + "+" + att[7] + "+" + att[8];
+	}
+
+    if (refselect == 1) {
+        prompt("Link for HTML--documents", hyperlinkRef);
+    } else {
+        prompt("Link for LaTeX--documents", "\\href{" + hyperlinkRef + "}{TEXT}");
+    }
+}
+
+
+function Mark(refselect) {
+
+	if (att[4].split(";").length > 7) {
+		alert("Only 8 marks are possible at the moment!");
+		return;
+	}
+
+    whichFrame.document.all.lay1.onmousedown = function() {
+		e = whichFrame.event;
+
+        if ((att[4] != "") && (att[4] != "0/0")) {
+            att[4] += ";";
+        } else {
+            att[4] = "";
+        }
+
+		markX = cropFloat(att[5]+att[7]*(whichFrame.document.body.scrollLeft+e.x-parseInt(whichFrame.document.all.lay1.style.left))/whichFrame.document.all.lay1.offsetWidth);
+		markY = cropFloat(att[6]+att[8]*(whichFrame.document.body.scrollTop+e.y-parseInt(whichFrame.document.all.lay1.style.top))/whichFrame.document.all.lay1.offsetHeight);
+
+        att[4] += markX + "/" + markY;
+
+        whichFrame.document.all.lay1.cancleBubble = true;
+        
+        setmark();
+    }
+}
+
+
+function Zoomrect() {
+    var state = 0;
+    var x1, y1, x2, y2;
+        
+    function Click() {
+		e = whichFrame.event;
+
+        if (state == 0) {
+            state = 1;
+            
+            x1 = whichFrame.document.body.scrollLeft+e.x;
+            y1 = whichFrame.document.body.scrollTop+e.y;           
+            x2 = x1;
+            y2 = y1;
+
+			whichFrame.document.all.eck1.style.left = x1;
+			whichFrame.document.all.eck1.style.top = y1;
+			whichFrame.document.all.eck2.style.left = x2-12;
+			whichFrame.document.all.eck2.style.top = y1;
+			whichFrame.document.all.eck3.style.left = x1;
+			whichFrame.document.all.eck3.style.top = y2-12;
+			whichFrame.document.all.eck4.style.left = x2-12;
+			whichFrame.document.all.eck4.style.top = y2-12;
+
+			whichFrame.document.all.eck1.style.visibility="visible";
+			whichFrame.document.all.eck2.style.visibility="visible";
+			whichFrame.document.all.eck3.style.visibility="visible";
+			whichFrame.document.all.eck4.style.visibility="visible";
+            
+            whichFrame.document.all.lay1.onmousemove = Move;
+            whichFrame.document.all.eck4.onmousemove = Move;
+            
+        } else {
+
+			x1 -= parseInt(whichFrame.document.all.lay1.style.left);
+			y1 -= parseInt(whichFrame.document.all.lay1.style.top);			
+
+            x2 = whichFrame.document.body.scrollLeft+e.x-parseInt(whichFrame.document.all.lay1.style.left);
+            y2 = whichFrame.document.body.scrollTop+e.y-parseInt(whichFrame.document.all.lay1.style.left);         
+
+            whichFrame.document.all.eck1.visibility="hidden";
+            whichFrame.document.all.eck2.visibility="hidden";
+            whichFrame.document.all.eck3.visibility="hidden";
+            whichFrame.document.all.eck4.visibility="hidden";
+
+			whichFrame.document.all.lay1.cancleBubble = true;
+			whichFrame.document.all.eck4.cancleBubble = true;
+
+            att[5] = cropFloat(att[5]+att[7]*((x1 < x2) ? x1 : x2)/whichFrame.document.all.lay1.offsetWidth);
+            att[6] = cropFloat(att[6]+att[8]*((y1 < y2) ? y1 : y2)/whichFrame.document.all.lay1.offsetHeight);
+
+            att[7] = cropFloat(att[7]*Math.abs(x1-x2)/whichFrame.document.all.lay1.offsetWidth);
+            att[8] = cropFloat(att[8]*Math.abs(y1-y2)/whichFrame.document.all.lay1.offsetHeight);
+                        
+            if (att[7] != 0 && att[8] != 0) {
+              loadPicture(2);
+            }
+        }
+    }
+
+    function Move() {
+		e = whichFrame.event;
+
+        x2 = whichFrame.document.body.scrollLeft+e.x;
+        y2 = whichFrame.document.body.scrollTop+e.y;           
+
+		whichFrame.document.all.eck1.style.left = ((x1 < x2) ? x1 : x2);
+		whichFrame.document.all.eck1.style.top = ((y1 < y2) ? y1 : y2);
+		whichFrame.document.all.eck2.style.left = ((x1 < x2) ? x2 : x1)-12;
+		whichFrame.document.all.eck2.style.top = ((y1 < y2) ? y1 : y2);
+		whichFrame.document.all.eck3.style.left = ((x1 < x2) ? x1 : x2);
+		whichFrame.document.all.eck3.style.top = ((y1 < y2) ? y2 : y1)-12;
+		whichFrame.document.all.eck4.style.left = ((x1 < x2) ? x2 : x1)-12;
+		whichFrame.document.all.eck4.style.top = ((y1 < y2) ? y2 : y1)-12;
+    }
+
+    whichFrame.document.all.lay1.onmousedown = Click;
+    whichFrame.document.all.eck4.onmousedown = Click;
+}
+
+
+function Zoomin() {
+
+    whichFrame.document.all.lay1.onmousedown = function() {
+		e = whichFrame.event;
+
+		att[5] = cropFloat(att[5]+att[7]*(whichFrame.document.body.scrollLeft+e.x-parseInt(whichFrame.document.all.lay1.style.left))/whichFrame.document.all.lay1.offsetWidth-0.5*att[7]*0.7);
+		att[6] = cropFloat(att[6]+att[8]*(whichFrame.document.body.scrollTop+e.y-parseInt(whichFrame.document.all.lay1.style.top))/whichFrame.document.all.lay1.offsetHeight-0.5*att[8]*0.7);
+
+		att[7] = cropFloat(att[7]*0.7);
+		att[8] = cropFloat(att[8]*0.7);
+
+		if (att[5] < 0) {
+			att[5] = 0;
+		}
+		if (att[6] < 0) {
+			att[6] = 0;
+		}
+		if (att[5]+att[7] > 1) {
+			att[5] = 1-att[7];
+		}
+		if (att[6]+att[8] > 1) {
+			att[6] = 1-att[8];
+		}
+
+	    whichFrame.document.all.lay1.cancleBubble = true;
+
+		loadPicture(2);
+	}
+}
+
+
+function Zoomout() {
+    loadPicture(1);
+}
+
+
+function Moveto() {
+
+    whichFrame.document.all.lay1.onmousedown = function() {
+		e = whichFrame.event;
+
+		att[5] = cropFloat(att[5]+att[7]*(whichFrame.document.body.scrollLeft+e.x-parseInt(whichFrame.document.all.lay1.style.left))/whichFrame.document.all.lay1.offsetWidth-0.5*att[7]);
+		att[6] = cropFloat(att[6]+att[8]*(whichFrame.document.body.scrollTop+e.y-parseInt(whichFrame.document.all.lay1.style.top))/whichFrame.document.all.lay1.offsetHeight-0.5*att[8]);
+
+		if (att[5] < 0) {
+			att[5] = 0;
+		}
+		if (att[6] < 0) {
+			att[6] = 0;
+		}
+		if (att[5]+att[7] > 1) {
+			att[5] = 1-att[7];
+		}
+		if (att[6]+att[8] > 1) {
+			att[6] = 1-att[8];
+		}
+
+	    whichFrame.document.all.lay1.cancleBubble = true;
+
+        loadPicture(2);
+	}
+}
+
+
+function Scaledef(scaledef) {
+
+    att[2] = scaledef;
+    loadPicture(2);
+}
+
+
+function setmark() {
+	if ((att[4] != "") && (att[4] != "0/0")) {
+		var mark = att[4].split(";");
+
+		var countMarks = mark.length;
+		
+		// maximum of marks is 8
+		// we do not report this error because this is already done in func. "Mark"
+		if (countMarks > 8) countMarks = 8;
+
+		var picWidth  = whichFrame.document.all.lay1.offsetWidth;
+		var picHeight = whichFrame.document.all.lay1.offsetHeight;
+
+		// catch the cases where the picture had not been loaded already and
+		// make a timeout so that the coordinates are calculated with the real dimensions
+		if (picWidth > 30) {
+
+			var xoffset = parseInt(whichFrame.document.all.lay1.style.left);
+			var yoffset = parseInt(whichFrame.document.all.lay1.style.top);
+
+			for (var i = 0; i < countMarks; i++) {
+				mark[i] = mark[i].split("/");
+
+				if ((mark[i][0] > att[5]) && (mark[i][1] > att[6]) && (mark[i][0] < (att[5]+att[7])) && (mark[i][1] < (att[6]+att[8]))) {
+
+					mark[i][0] = parseInt(xoffset+picWidth*(mark[i][0]-att[5])/att[7]);
+					mark[i][1] = parseInt(yoffset+picHeight*(mark[i][1]-att[6])/att[8]);
+
+					whichFrame.document.getElementById("dot" + i).style.left = mark[i][0]-5;
+					whichFrame.document.getElementById("dot" + i).style.top = mark[i][1]-5;
+					whichFrame.document.getElementById("dot" + i).style.visibility = "visible";
+				}
+			}
+		} else {
+			setTimeout("setmark()", 100);
+		}
+	}
+}
+
+
+// capturing keypresses for next and previous page
+function parseKeypress() {
+	e = whichFrame.event;
+
+	if (e.keyCode == 110) {
+		Nextpage();
+	}
+	if (e.keyCode == 98) {
+		Backpage();
+	}
+	whichFrame.document.cancleBubble = true;
+}
+
+
+// auxiliary function to crop senseless precicsion
+function cropFloat(tmp) {
+	return parseInt(10000*tmp)/10000;
+}
+
+
+// initialize browser specific things (keypress caputring)
+function initScripts() {
+	whichFrame.document.onkeypress = parseKeypress;
+	whichFrame.focus();
+}
+
+
+// fill in the values of the "att"-array
+function initPicture(picURL) {
+	att = picURL.split("+");
+
+	if (att[0].lastIndexOf("/") == att[0].length-1) {
+		att[0] = att[0].substring(0, att[0].length-1);
+	}
+	
+	if (att.length < 2 || att[1] == "") {
+		att[1] = 1;
+	}
+	if (att.length < 3 || att[2] == "") {
+		att[2] = "1.0";
+	}
+
+	if (att.length < 4) {
+		att[3] = "";
+	}
+
+	if (att[3].indexOf("f") > -1) {
+		att[3] = "fit";
+	}
+
+	if (att.length < 5 || att[4] == "") {
+		att[4] = "0/0";
+	}
+
+	// converts the old mark format (0-1000) to new format(0.0 - 1.0)
+	if (att[4] != "0/0") {
+		var tmp = att[4].split(";");
+		
+		att[4] = "";
+		
+		for (i = 0; i < tmp.length; i++) {
+			tmp[i] = tmp[i].split("/");
+
+			if (tmp[i][0] > 1 && tmp[i][1] > 1) {
+				tmp[i][0] /= 1000;
+				tmp[i][1] /= 1000;
+			}
+			
+			att[4] += tmp[i][0] + "/" + tmp[i][1] + ";";
+		}
+		att[4] = att[4].slice(0, -1);
+	}
+	
+	if (att.length < 7) {
+		att[5] = 0;
+		att[6] = 0;
+		att[7] = 1;
+		att[8] = 1;
+	} else {
+		att[5] = parseFloat(att[5]);
+		att[6] = parseFloat(att[6]);
+		att[7] = parseFloat(att[7]);
+		att[8] = parseFloat(att[8]);
+	}
+}
+
+
+function pageInfo() {
+	
+	// bug in netscape 4.xx (confunding px and pt)
+	var fontsize = document.layers ? "11pt" : "11px";
+
+	if (window.pageFrame) {
+		pageFrame.document.open();
+		pageFrame.document.write('<html><head></head><body bgcolor="#CCCCCC" topmargin="5" marginheight="5">');
+		pageFrame.document.write('<p style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; color: #CC3333; font-size: ' + fontsize + '">');
+		pageFrame.document.write(att[1] + '<b> of </b>' + numPages + '</p></body></html>');
+		pageFrame.document.close();
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navigation_n4.js	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,450 @@
+/* navigation_ie -- JS library for digilib (Netscape4 version)
+
+  Digital Image Library servlet components
+
+  Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+  This program is free software; you can redistribute  it and/or modify it
+  under  the terms of  the GNU General  Public License as published by the
+  Free Software Foundation;  either version 2 of the  License, or (at your
+  option) any later version.
+   
+  Please read license.txt for the full details. A copy of the GPL
+  may be found at http://www.gnu.org/copyleft/lgpl.html
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// these two global variables have to be initialised before the frist use of the functions below
+// to fill in the attributes you can use the function initPicture provided below
+// - array with all attributes
+var att = new Array();
+
+// - variable to store the path to the frame, in which the pictures should be created
+var whichFrame = parent.mainFrame;
+
+// give a name to the window containing digilib - this way one can test if there is already a
+// digilib-window open and replace the contents of it (ex. digicat)
+window.name = "digilib";
+
+// function that launches the ScaleServlet
+// the different detailGrades:
+// 		0 -> back, next, page
+//		1 -> zoomout
+//		2 -> zoomarea, zoompoint, moveto, scaledef
+
+function loadPicture(detailGrade, keepArea) {
+
+//	alert("wx: " + att[5] + "\tww: " + att[7] + "\nwy: " + att[6] + "\twh: " + att[8]);
+
+	var newPicture  = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/"
+	newPicture += att[0] + "?" + "pn=" + att[1] + "&ws=" + att[2];
+	newPicture += "&dw=" + (whichFrame.innerWidth-30) + "&dh=" + (whichFrame.innerHeight-30);
+	newPicture += "&mo=" + att[3];
+
+	if (detailGrade == 0) {
+		att[4] = "0/0";
+	}
+
+	if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) {
+		att[5] = 0;
+		att[6] = 0;
+		att[7] = 1;
+		att[8] = 1;
+	}
+	newPicture += "&wx=" + att[5] + "&wy=" + att[6] + "&ww=" + att[7] + "&wh=" + att[8];
+
+	whichFrame.document.open();
+	
+	whichFrame.document.write('<html><head></head><body bgcolor="#666666">');
+	whichFrame.document.write('<div ID="lay1" style="position:absolute; left:10;  top:10;  visibility:visible"><img src="' + newPicture + '"></div>');
+	whichFrame.document.write('<div ID="dot0" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark1.gif"></div>');
+	whichFrame.document.write('<div ID="dot1" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark2.gif"></div>');
+	whichFrame.document.write('<div ID="dot2" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark3.gif"></div>');
+	whichFrame.document.write('<div ID="dot3" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark4.gif"></div>');
+	whichFrame.document.write('<div ID="dot4" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark5.gif"></div>');
+	whichFrame.document.write('<div ID="dot5" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark6.gif"></div>');
+	whichFrame.document.write('<div ID="dot6" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark7.gif"></div>');
+	whichFrame.document.write('<div ID="dot7" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark8.gif"></div>');
+	whichFrame.document.write('<div ID="eck1" style="position:absolute; left:-20; top:120; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/olinks.gif"></div>');
+	whichFrame.document.write('<div ID="eck2" style="position:absolute; left:-20; top:140; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/orechts.gif"></div>');
+	whichFrame.document.write('<div ID="eck3" style="position:absolute; left:-20; top:160; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/ulinks.gif"></div>');
+	whichFrame.document.write('<div ID="eck4" style="position:absolute; left:-20; top:180; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/urechts.gif"></div>');
+	whichFrame.document.write('</body></html>');
+	
+	whichFrame.document.close();
+	
+	pageInfo();
+
+	setmark();
+}
+
+
+function Backpage(keepArea) {
+
+    att[1] = parseInt(att[1]) - 1;
+
+    if (att[1] > 0) {
+        loadPicture(0, keepArea);
+    } else {
+	    att[1] = parseInt(att[1]) + 1;
+        alert("You are already on the first page!");
+    }
+}
+
+
+function Nextpage(keepArea) {
+
+    att[1] = parseInt(att[1]) + 1;
+
+    if (att[1] <= parent.numPages) {
+        loadPicture(0, keepArea);
+    } else {
+	    att[1] = parseInt(att[1]) - 1;
+        alert("You are already on the last page!");
+    }
+}
+
+
+function Page(keepArea) {
+
+	do {
+    	page = prompt("Goto Page (1 - " + parent.numPages + "):", 1);
+	} while ((page != null) && ((page < 1) || (page > parent.numPages)));
+
+   	if (page != null && page != att[1]) {
+		att[1] = page;
+		loadPicture(0, keepArea);
+	}
+}
+
+
+function Digicat() {
+	var url = "http://" + location.host + "/docuserver/digitallibrary/digicat.html?" + att[0] + "+" + att[1];
+	win = window.open(url, "digicat");
+	win.focus();
+}
+
+
+function Ref(refselect) {
+
+	var hyperlinkRef = "http://" + location.host + "/docuserver/digitallibrary/digilib.jsp?";
+	hyperlinkRef += att[0] + "+" + att[1] + "+" + att[2] + "+" + att[3] + "+" + att[4];
+	
+	if ((att[5] != 0) || (att[6] != 0) || (att[7] != 1) || (att[8] != 1)) {
+		hyperlinkRef += "+" + att[5] + "+" + att[6] + "+" + att[7] + "+" + att[8];
+	}
+
+    if (refselect == 1) {
+        prompt("Link for HTML--documents", hyperlinkRef);
+    } else {
+        prompt("Link for LaTeX--documents", "\\href{" + hyperlinkRef + "}{TEXT}");
+    }
+}
+
+
+function Mark(refselect) {
+
+	if (att[4].split(";").length > 7) {
+		alert("Only 8 marks are possible at the moment!");
+		return;
+	}
+
+    whichFrame.document.lay1.captureEvents(Event.MOUSEDOWN);
+    whichFrame.document.lay1.onmousedown = function(event) {
+
+        if ((att[4] != "") && (att[4] != "0/0")) {
+            att[4] += ";";
+        } else {
+            att[4] = "";
+        }
+
+		var markX = cropFloat(att[5]+(att[7]*event.x/whichFrame.document.lay1.clip.width));
+		var markY = cropFloat(att[6]+(att[8]*event.y/whichFrame.document.lay1.clip.height));
+		
+        att[4] += markX + "/" + markY;
+
+        whichFrame.document.lay1.releaseEvents(Event.MOUSEDOWN);
+        setmark();
+    }
+}
+
+
+function Zoomrect() {
+    var state = 0;
+    var x1, y1, x2, y2;
+        
+    function Click(event) {
+
+        if (state == 0) {
+            state = 1;
+            
+            x1 = event.pageX;
+            y1 = event.pageY;           
+            x2 = x1;
+            y2 = y1;
+
+            whichFrame.document.eck1.moveTo(((x1 < x2) ? x1 : x2), ((y1 < y2) ? y1 : y2));
+            whichFrame.document.eck2.moveTo(((x1 < x2) ? x2 : x1)-12, ((y1 < y2) ? y1 : y2));
+            whichFrame.document.eck3.moveTo(((x1 < x2) ? x1 : x2), ((y1 < y2) ? y2 : y1)-12);
+            whichFrame.document.eck4.moveTo(((x1 < x2) ? x2 : x1)-12, ((y1 < y2) ? y2 : y1)-12);
+
+            whichFrame.document.eck1.visibility="show";
+            whichFrame.document.eck2.visibility="show";
+            whichFrame.document.eck3.visibility="show";
+            whichFrame.document.eck4.visibility="show";
+            
+            whichFrame.document.lay1.captureEvents(Event.MOUSEMOVE);
+            whichFrame.document.eck4.captureEvents(Event.MOUSEMOVE);
+
+            whichFrame.document.lay1.onmousemove = Move;
+            whichFrame.document.eck4.onmousemove = Move;
+            
+        } else {
+
+            x1 -= whichFrame.document.lay1.x;
+            y1 -= whichFrame.document.lay1.y;            
+
+            x2 = event.pageX-whichFrame.document.lay1.x;
+            y2 = event.pageY-whichFrame.document.lay1.y;         
+
+            whichFrame.document.lay1.releaseEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
+            whichFrame.document.eck4.releaseEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
+
+            whichFrame.document.eck1.visibility="hide";
+            whichFrame.document.eck2.visibility="hide";
+            whichFrame.document.eck3.visibility="hide";
+            whichFrame.document.eck4.visibility="hide";
+
+            att[5] = cropFloat(att[5]+att[7]*((x1 < x2) ? x1 : x2)/whichFrame.document.lay1.clip.width);
+            att[6] = cropFloat(att[6]+att[8]*((y1 < y2) ? y1 : y2)/whichFrame.document.lay1.clip.height);
+
+            att[7] = cropFloat(att[7]*Math.abs(x1-x2)/whichFrame.document.lay1.clip.width);
+            att[8] = cropFloat(att[8]*Math.abs(y1-y2)/whichFrame.document.lay1.clip.height);
+                        
+            if (att[7] != 0 && att[8] != 0) {
+              loadPicture(2);
+            }
+        }
+    }
+
+    function Move(event) {
+
+        x2 = event.pageX;
+        y2 = event.pageY;           
+
+        whichFrame.document.eck1.moveTo(((x1 < x2) ? x1 : x2), ((y1 < y2) ? y1 : y2));
+        whichFrame.document.eck2.moveTo(((x1 < x2) ? x2 : x1)-12, ((y1 < y2) ? y1 : y2));
+        whichFrame.document.eck3.moveTo(((x1 < x2) ? x1 : x2), ((y1 < y2) ? y2 : y1)-12);
+        whichFrame.document.eck4.moveTo(((x1 < x2) ? x2 : x1)-12, ((y1 < y2) ? y2 : y1)-12);
+    }
+
+    whichFrame.document.lay1.captureEvents(Event.MOUSEDOWN);
+    whichFrame.document.eck4.captureEvents(Event.MOUSEDOWN);
+
+    whichFrame.document.lay1.onmousedown = Click;
+    whichFrame.document.eck4.onmousedown = Click;
+}
+
+
+function Zoomin() {
+
+    whichFrame.document.lay1.captureEvents(Event.MOUSEDOWN);
+    whichFrame.document.lay1.onmousedown = function(event) {
+
+		att[5] = cropFloat(att[5]+(att[7]*event.x/whichFrame.document.lay1.clip.width-0.5*att[7]*0.7));
+		att[6] = cropFloat(att[6]+(att[8]*event.y/whichFrame.document.lay1.clip.height-0.5*att[8]*0.7));
+
+        att[7] = cropFloat(att[7]*0.7);
+        att[8] = cropFloat(att[8]*0.7);
+
+		if (att[5] < 0) {
+			att[5] = 0;
+		}
+		if (att[6] < 0) {
+			att[6] = 0;
+		}
+		if (att[5]+att[7] > 1) {
+			att[5] = 1-att[7];
+		}
+		if (att[6]+att[8] > 1) {
+			att[6] = 1-att[8];
+		}
+
+        releaseEvents(Event.MOUSEDOWN);
+
+        loadPicture(2);
+    }
+}
+
+
+function Zoomout() {
+    loadPicture(1);
+}
+
+
+function Moveto() {
+
+    whichFrame.document.lay1.captureEvents(Event.MOUSEDOWN);
+    whichFrame.document.lay1.onmousedown = function(event) {
+
+		att[5] = cropFloat(att[5]+(att[7]*event.x/whichFrame.document.lay1.clip.width-0.5*att[7]));
+		att[6] = cropFloat(att[6]+(att[8]*event.y/whichFrame.document.lay1.clip.height-0.5*att[8]));
+
+		if (att[5] < 0) {
+			att[5] = 0;
+		}
+		if (att[6] < 0) {
+			att[6] = 0;
+		}
+		if (att[5]+att[7] > 1) {
+			att[5] = 1-att[7];
+		}
+		if (att[6]+att[8] > 1) {
+			att[6] = 1-att[8];
+		}
+
+        releaseEvents(Event.MOUSEDOWN);
+
+        loadPicture(2);
+	}
+}
+
+
+function Scaledef(scaledef) {
+
+    att[2] = scaledef;
+    loadPicture(2);
+}
+
+
+function setmark() {
+	if ((att[4] != "") && (att[4] != "0/0")) {
+		var mark = att[4].split(";");
+
+		var countMarks = mark.length;
+		
+		// maximum of marks is 8
+		// we do not report this error because this is already done in func. "Mark"
+		if (countMarks > 8) countMarks = 8;
+
+		var picWidth  = whichFrame.document.lay1.clip.width;
+		var picHeight = whichFrame.document.lay1.clip.height;
+
+		for (var i = 0; i < countMarks; i++) {
+			mark[i] = mark[i].split("/");
+
+			if ((mark[i][0] > att[5]) && (mark[i][1] > att[6]) && (mark[i][0] < (att[5]+att[7])) && (mark[i][1] < (att[6]+att[8]))) {
+
+				mark[i][0] = parseInt(whichFrame.document.lay1.x + (picWidth*(mark[i][0]-att[5]))/att[7]);
+				mark[i][1] = parseInt(whichFrame.document.lay1.y + (picHeight*(mark[i][1]-att[6]))/att[8]);
+
+				whichFrame.document.layers[i+1].moveTo(mark[i][0]-5, mark[i][1]-5);
+				whichFrame.document.layers[i+1].visibility = "show";
+			}
+		}
+	}
+}
+
+
+// capturing keypresses for next and previous page
+function parseKeypress(event) {
+	var whichCode = (window.Event) ? event.which : event.keyCode;
+	if (String.fromCharCode(whichCode) == "n") {
+		Nextpage();
+	}
+	if (String.fromCharCode(whichCode) == "b") {
+		Backpage();
+	}
+}
+
+
+// auxiliary function to crop senseless precicsion
+function cropFloat(tmp) {
+	return parseInt(10000*tmp)/10000;
+}
+
+
+// initialize browser specific things (keypress caputring)
+function initScripts() {
+	window.captureEvents(Event.KEYDOWN);
+	window.onkeydown = parseKeypress;
+}
+
+
+// fill in the values of the "att"-array
+function initPicture(picURL) {
+	att = picURL.split("+");
+
+	if (att[0].lastIndexOf("/") == att[0].length-1) {
+		att[0] = att[0].substring(0, att[0].length-1);
+	}
+	
+	if (att.length < 2 || att[1] == "") {
+		att[1] = 1;
+	}
+	if (att.length < 3 || att[2] == "") {
+		att[2] = "1.0";
+	}
+
+	if (att.length < 4) {
+		att[3] = "";
+	}
+
+	if (att[3].indexOf("f") > -1) {
+		att[3] = "fit";
+	}
+
+	if (att.length < 5 || att[4] == "") {
+		att[4] = "0/0";
+	}
+
+	// converts the old mark format (0-1000) to new format(0.0 - 1.0)
+	if (att[4] != "0/0") {
+		var tmp = att[4].split(";");
+		
+		att[4] = "";
+		
+		for (i = 0; i < tmp.length; i++) {
+			tmp[i] = tmp[i].split("/");
+
+			if (tmp[i][0] > 1 && tmp[i][1] > 1) {
+				tmp[i][0] /= 1000;
+				tmp[i][1] /= 1000;
+			}
+			
+			att[4] += tmp[i][0] + "/" + tmp[i][1] + ";";
+		}
+		att[4] = att[4].slice(0, -1);
+	}
+	
+	if (att.length < 7) {
+		att[5] = 0;
+		att[6] = 0;
+		att[7] = 1;
+		att[8] = 1;
+	} else {
+		att[5] = parseFloat(att[5]);
+		att[6] = parseFloat(att[6]);
+		att[7] = parseFloat(att[7]);
+		att[8] = parseFloat(att[8]);
+	}
+}
+
+function pageInfo() {
+	
+	// bug in netscape 4.xx (confunding px and pt)
+	var fontsize = document.layers ? "11pt" : "11px";
+
+	if (window.pageFrame) {
+		pageFrame.document.open();
+		pageFrame.document.write('<html><head></head><body bgcolor="#CCCCCC" topmargin="5" marginheight="5">');
+		pageFrame.document.write('<p style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; color: #CC3333; font-size: ' + fontsize + '">');
+		pageFrame.document.write(att[1] + '<b> of </b>' + numPages + '</p></body></html>');
+		pageFrame.document.close();
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/navigation_n6.js	Thu Jan 17 15:29:52 2002 +0100
@@ -0,0 +1,479 @@
+/* navigation_ie -- JS library for digilib (Mozilla version)
+
+  Digital Image Library servlet components
+
+  Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
+
+  This program is free software; you can redistribute  it and/or modify it
+  under  the terms of  the GNU General  Public License as published by the
+  Free Software Foundation;  either version 2 of the  License, or (at your
+  option) any later version.
+   
+  Please read license.txt for the full details. A copy of the GPL
+  may be found at http://www.gnu.org/copyleft/lgpl.html
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// these two global variables have to be initialised before the frist use of the functions below
+// to fill in the attributes you can use the function initPicture provided below
+// - array with all attributes
+var att = new Array();
+
+// - variable to store the path to the frame, in which the pictures should be created
+var whichFrame = parent.mainFrame;
+
+// give a name to the window containing digilib - this way one can test if there is already a
+// digilib-window open and replace the contents of it (ex. digicat)
+window.name = "digilib";
+
+// function that launches the ScaleServlet
+// the different detailGrades:
+// 		0 -> back, next, page
+//		1 -> zoomout
+//		2 -> zoomarea, zoompoint, moveto, scaledef
+
+function loadPicture(detailGrade, keepArea) {
+
+//	alert("wx: " + att[5] + "\tww: " + att[7] + "\nwy: " + att[6] + "\twh: " + att[8]);
+
+	// sorry about that, but Mozilla needs to have a document body to calc the frames width and height
+	whichFrame.document.open();
+	whichFrame.document.write('<html><head></head><body bgcolor="#666666" topmargin="10" leftmargin="10" marginwidth="10" magrinheight="10">');
+
+//	alert(whichFrame.innerWidth);
+
+	var newPicture  = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/"
+	newPicture += att[0] + "?" + "pn=" + att[1] + "&ws=" + att[2];
+	newPicture += "&dw=" + (whichFrame.innerWidth-30) + "&dh=" + (whichFrame.innerHeight-30);
+	newPicture += "&mo=" + att[3];
+
+	if (detailGrade == 0) {
+		att[4] = "0/0";
+	}
+
+	if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) {
+		att[5] = 0;
+		att[6] = 0;
+		att[7] = 1;
+		att[8] = 1;
+	}
+	newPicture += "&wx=" + att[5] + "&wy=" + att[6] + "&ww=" + att[7] + "&wh=" + att[8];
+	
+	whichFrame.document.write('<div ID="lay1" style="position:absolute; left:10;  top:10;  visibility:visible"><img name="pic" src="' + newPicture + '"></div>');
+	whichFrame.document.write('<div ID="dot0" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark1.gif"></div>');
+	whichFrame.document.write('<div ID="dot1" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark2.gif"></div>');
+	whichFrame.document.write('<div ID="dot2" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark3.gif"></div>');
+	whichFrame.document.write('<div ID="dot3" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark4.gif"></div>');
+	whichFrame.document.write('<div ID="dot4" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark5.gif"></div>');
+	whichFrame.document.write('<div ID="dot5" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark6.gif"></div>');
+	whichFrame.document.write('<div ID="dot6" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark7.gif"></div>');
+	whichFrame.document.write('<div ID="dot7" style="position:absolute; left:-20; top:100; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/mark8.gif"></div>');
+	whichFrame.document.write('<div ID="eck1" style="position:absolute; left:-20; top:120; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/olinks.gif"></div>');
+	whichFrame.document.write('<div ID="eck2" style="position:absolute; left:-20; top:140; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/orechts.gif"></div>');
+	whichFrame.document.write('<div ID="eck3" style="position:absolute; left:-20; top:160; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/ulinks.gif"></div>');
+	whichFrame.document.write('<div ID="eck4" style="position:absolute; left:-20; top:180; visibility:hidden"><img src="http://' + location.host + '/docuserver/digitallibrary/urechts.gif"></div>');
+
+	whichFrame.document.write('</body></html>');
+
+	whichFrame.document.close();
+
+	initScripts();
+	
+	pageInfo();
+
+	setmark();
+}
+
+
+function Backpage(keepArea) {
+
+    att[1] = parseInt(att[1]) - 1;
+
+    if (att[1] > 0) {
+        loadPicture(0, keepArea);
+    } else {
+	    att[1] = parseInt(att[1]) + 1;
+        alert("You are already on the first page!");
+    }
+}
+
+
+function Nextpage(keepArea) {
+
+    att[1] = parseInt(att[1]) + 1;
+
+    if (att[1] <= parent.numPages) {
+        loadPicture(0, keepArea);
+    } else {
+	    att[1] = parseInt(att[1]) - 1;
+        alert("You are already on the last page!");
+    }
+}
+
+
+function Page(keepArea) {
+
+	do {
+    	page = prompt("Goto Page (1 - " + parent.numPages + "):", 1);
+	} while ((page != null) && ((page < 1) || (page > parent.numPages)));
+
+   	if (page != null && page != att[1]) {
+		att[1] = page;
+		loadPicture(0, keepArea);
+	}
+}
+
+
+function Digicat() {
+	var url = "http://" + location.host + "/docuserver/digitallibrary/digicat.html?" + att[0] + "+" + att[1];
+	win = window.open(url, "digicat");
+	win.focus();
+}
+
+
+function Ref(refselect) {
+
+	var hyperlinkRef = "http://" + location.host + "/docuserver/digitallibrary/digilib.jsp?";
+	hyperlinkRef += att[0] + "+" + att[1] + "+" + att[2] + "+" + att[3] + "+" + att[4];
+	
+	if ((att[5] != 0) || (att[6] != 0) || (att[7] != 1) || (att[8] != 1)) {
+		hyperlinkRef += "+" + att[5] + "+" + att[6] + "+" + att[7] + "+" + att[8];
+	}
+
+	if (refselect == 1) {
+		prompt("Link for HTML--documents", hyperlinkRef);
+	} else {
+		prompt("Link for LaTeX--documents", "\\href{" + hyperlinkRef + "}{TEXT}");
+	}
+}
+
+
+function Mark() {
+
+	if (att[4].split(";").length > 7) {
+		alert("Only 8 marks are possible at the moment!");
+		return;
+	}
+
+	function MarkEvent(event) {
+
+		if ((att[4] != "") && (att[4] != "0/0")) {
+			att[4] += ";";
+		} else {
+			att[4] = "";
+		}
+
+		var markX = cropFloat(att[5]+att[7]*(event.pageX-parseInt(whichFrame.document.getElementById("lay1").style.left))/whichFrame.document.pic.offsetWidth);
+		var markY = cropFloat(att[6]+att[8]*(event.pageY-parseInt(whichFrame.document.getElementById("lay1").style.top))/whichFrame.document.pic.offsetHeight);
+
+		att[4] += markX + "/" + markY;
+
+		whichFrame.document.getElementById("lay1").removeEventListener("mousedown", MarkEvent, true);		
+		setmark();
+	}
+
+	whichFrame.document.getElementById("lay1").addEventListener("mousedown", MarkEvent, true);		
+}
+
+
+function Zoomrect() {
+	var state = 0;
+	var x1, y1, x2, y2;
+
+	function Click(event) {
+
+		if (state == 0) {
+			state = 1;
+			
+			x1 = event.pageX;
+			y1 = event.pageY;			
+			x2 = x1;
+			y2 = y1;
+			
+			whichFrame.document.getElementById("eck1").style.left = x1;
+			whichFrame.document.getElementById("eck1").style.top = y1;
+			whichFrame.document.getElementById("eck2").style.left = x2-12;
+			whichFrame.document.getElementById("eck2").style.top = y1;
+			whichFrame.document.getElementById("eck3").style.left = x1;
+			whichFrame.document.getElementById("eck3").style.top = y2-12;
+			whichFrame.document.getElementById("eck4").style.left = x2-12;
+			whichFrame.document.getElementById("eck4").style.top = y2-12;
+
+			whichFrame.document.getElementById("eck1").style.visibility="visible";
+			whichFrame.document.getElementById("eck2").style.visibility="visible";
+			whichFrame.document.getElementById("eck3").style.visibility="visible";
+			whichFrame.document.getElementById("eck4").style.visibility="visible";
+			
+			whichFrame.document.getElementById("lay1").addEventListener("mousemove", Move, true);		
+			whichFrame.document.getElementById("eck4").addEventListener("mousemove", Move, true);		
+
+		} else {
+
+			x1 -= parseInt(whichFrame.document.getElementById("lay1").style.left);
+			y1 -= parseInt(whichFrame.document.getElementById("lay1").style.top);			
+
+			x2 = event.pageX-parseInt(whichFrame.document.getElementById("lay1").style.left);
+			y2 = event.pageY-parseInt(whichFrame.document.getElementById("lay1").style.top);			
+
+			whichFrame.document.getElementById("lay1").removeEventListener("mousedown", Click, true);		
+			whichFrame.document.getElementById("eck4").removeEventListener("mousedown", Click, true);		
+			
+			whichFrame.document.getElementById("lay1").removeEventListener("mousemove", Move, true);		
+			whichFrame.document.getElementById("eck4").removeEventListener("mousemove", Move, true);		
+
+			whichFrame.document.getElementById("eck1").style.visibility="hidden";
+			whichFrame.document.getElementById("eck2").style.visibility="hidden";
+			whichFrame.document.getElementById("eck3").style.visibility="hidden";
+			whichFrame.document.getElementById("eck4").style.visibility="hidden";
+
+			att[5] = cropFloat(att[5]+att[7]*((x1 < x2) ? x1 : x2)/whichFrame.document.pic.offsetWidth);
+			att[6] = cropFloat(att[6]+att[8]*((y1 < y2) ? y1 : y2)/whichFrame.document.pic.offsetHeight);
+
+			att[7] = cropFloat(att[7]*Math.abs(x1-x2)/whichFrame.document.pic.offsetWidth);
+			att[8] = cropFloat(att[8]*Math.abs(y1-y2)/whichFrame.document.pic.offsetHeight);
+
+			if (att[7] != 0 && att[8] != 0) {
+				loadPicture(2);
+			}
+		}
+	}
+
+	function Move(event) {
+
+		x2 = event.pageX;
+		y2 = event.pageY;
+
+		whichFrame.document.getElementById("eck1").style.left = ((x1 < x2) ? x1 : x2);
+		whichFrame.document.getElementById("eck1").style.top = ((y1 < y2) ? y1 : y2);
+		whichFrame.document.getElementById("eck2").style.left = ((x1 < x2) ? x2 : x1)-12;
+		whichFrame.document.getElementById("eck2").style.top = ((y1 < y2) ? y1 : y2);
+		whichFrame.document.getElementById("eck3").style.left = ((x1 < x2) ? x1 : x2);
+		whichFrame.document.getElementById("eck3").style.top = ((y1 < y2) ? y2 : y1)-12;
+		whichFrame.document.getElementById("eck4").style.left = ((x1 < x2) ? x2 : x1)-12;
+		whichFrame.document.getElementById("eck4").style.top = ((y1 < y2) ? y2 : y1)-12;
+	}
+
+	whichFrame.document.getElementById("lay1").addEventListener("mousedown", Click, true);		
+	whichFrame.document.getElementById("eck4").addEventListener("mousedown", Click, true);		
+}
+
+
+function Zoomin() {
+
+	function ZoominEvent(event) {
+
+		att[5] = cropFloat(att[5]+att[7]*(event.pageX-parseInt(whichFrame.document.getElementById("lay1").style.left))/whichFrame.document.pic.offsetWidth-0.5*att[7]*0.7);
+		att[6] = cropFloat(att[6]+att[8]*(event.pageY-parseInt(whichFrame.document.getElementById("lay1").style.top))/whichFrame.document.pic.offsetHeight-0.5*att[8]*0.7);
+
+		att[7] = cropFloat(att[7]*0.7);
+		att[8] = cropFloat(att[8]*0.7);
+
+		if (att[5] < 0) {
+			att[5] = 0;
+		}
+		if (att[6] < 0) {
+			att[6] = 0;
+		}
+		if (att[5]+att[7] > 1) {
+			att[5] = 1-att[7];
+		}
+		if (att[6]+att[8] > 1) {
+			att[6] = 1-att[8];
+		}
+
+		whichFrame.document.getElementById("lay1").removeEventListener("mousedown", ZoominEvent, true);
+		
+		loadPicture(2);
+	}
+
+	whichFrame.document.getElementById("lay1").addEventListener("mousedown", ZoominEvent, true);
+}
+
+
+function Zoomout() {
+
+	loadPicture(1);
+}
+
+
+function Moveto() {
+
+	function MovetoEvent(event) {
+
+		att[5] = cropFloat(att[5]+att[7]*(event.pageX-parseInt(whichFrame.document.getElementById("lay1").style.left))/whichFrame.document.pic.offsetWidth-0.5*att[7]);
+		att[6] = cropFloat(att[6]+att[8]*(event.pageY-parseInt(whichFrame.document.getElementById("lay1").style.top))/whichFrame.document.pic.offsetHeight-0.5*att[8]);
+
+		if (att[5] < 0) {
+			att[5] = 0;
+		}
+		if (att[6] < 0) {
+			att[6] = 0;
+		}
+		if (att[5]+att[7] > 1) {
+			att[5] = 1-att[7];
+		}
+		if (att[6]+att[8] > 1) {
+			att[6] = 1-att[8];
+		}
+
+		whichFrame.document.getElementById("lay1").removeEventListener("mousedown", MovetoEvent, true);		
+		
+		loadPicture(2);
+	}
+
+	whichFrame.document.getElementById("lay1").addEventListener("mousedown", MovetoEvent, true);
+}
+
+
+function Scaledef(scaledef) {
+
+	att[2] = scaledef;
+	loadPicture(2);
+}
+
+
+function setmark() {
+
+	if (att[4] != "" && att[4] != "0/0") {
+		var mark = att[4].split(";");
+
+		var countMarks = mark.length;
+		
+		// maximum of marks is 8
+		// we do not report this error because this is already done in func. "Mark"
+		if (countMarks > 8) countMarks = 8;
+
+		var picWidth = whichFrame.document.pic.offsetWidth;
+		var picHeight = whichFrame.document.pic.offsetHeight;
+
+		// catch the cases where the picture had not been loaded already and
+		// make a timeout so that the coordinates are calculated with the real dimensions
+		if (whichFrame.document.pic.complete) {
+			var xoffset = parseInt(whichFrame.document.getElementById("lay1").style.left);
+			var yoffset = parseInt(whichFrame.document.getElementById("lay1").style.top);
+
+			for (var i = 0; i < countMarks; i++) {
+				mark[i] = mark[i].split("/");
+
+				if ((mark[i][0] > att[5]) && (mark[i][1] > att[6]) && (mark[i][0] < (att[5]+att[7])) && (mark[i][1] < (att[6]+att[8]))) {
+
+					mark[i][0] = parseInt(xoffset+picWidth*(mark[i][0]-att[5])/att[7]);
+					mark[i][1] = parseInt(yoffset+picHeight*(mark[i][1]-att[6])/att[8]);
+
+
+					whichFrame.document.getElementById("dot" + i).style.left = mark[i][0]-5;
+					whichFrame.document.getElementById("dot" + i).style.top = mark[i][1]-5;
+					whichFrame.document.getElementById("dot" + i).style.visibility = "visible";
+				}
+			}
+		} else {
+			setTimeout("setmark()", 100);
+		}
+	}
+}
+
+// capturing keypresses for next and previous page
+// ascii-values of n = 110, b = 98
+function parseKeypress (event) {
+	if (event.charCode == 110) {
+		Nextpage();
+	}
+	if (event.charCode == 98) {
+		Backpage();
+	}
+}
+
+
+// auxiliary function to crop senseless precicsion
+function cropFloat(tmp) {
+	return parseInt(10000*tmp)/10000;
+}
+
+
+// initialize browser specific things (keypress caputring)
+function initScripts() {
+//	for (var f = 0; f < window.frames.length; f++) {
+//		window.frames[f].document.addEventListener('keypress', parseKeypress, true);
+//	}
+	whichFrame.document.addEventListener('keypress', parseKeypress, true);
+	whichFrame.focus();
+}
+
+
+// fill in the values of the "att"-array
+function initPicture(picURL) {
+	att = picURL.split("+");
+
+	if (att[0].lastIndexOf("/") == att[0].length-1) {
+		att[0] = att[0].substring(0, att[0].length-1);
+	}
+	
+	if (att.length < 2 || att[1] == "") {
+		att[1] = 1;
+	}
+	if (att.length < 3 || att[2] == "") {
+		att[2] = "1.0";
+	}
+
+	if (att.length < 4) {
+		att[3] = "";
+	}
+
+	if (att[3].indexOf("f") > -1) {
+		att[3] = "fit";
+	}
+
+	if (att.length < 5 || att[4] == "") {
+		att[4] = "0/0";
+	}
+
+	// converts the old mark format (0-1000) to new format(0.0 - 1.0)
+	if (att[4] != "0/0") {
+		var tmp = att[4].split(";");
+		
+		att[4] = "";
+		
+		for (i = 0; i < tmp.length; i++) {
+			tmp[i] = tmp[i].split("/");
+
+			if (tmp[i][0] > 1 && tmp[i][1] > 1) {
+				tmp[i][0] /= 1000;
+				tmp[i][1] /= 1000;
+			}
+			
+			att[4] += tmp[i][0] + "/" + tmp[i][1] + ";";
+		}
+		att[4] = att[4].slice(0, -1);
+	}
+	
+	if (att.length < 7) {
+		att[5] = 0;
+		att[6] = 0;
+		att[7] = 1;
+		att[8] = 1;
+	} else {
+		att[5] = parseFloat(att[5]);
+		att[6] = parseFloat(att[6]);
+		att[7] = parseFloat(att[7]);
+		att[8] = parseFloat(att[8]);
+	}
+}
+
+
+function pageInfo() {
+	
+	// bug in netscape 4.xx (confunding px and pt)
+	var fontsize = document.layers ? "11pt" : "11px";
+
+	if (window.pageFrame) {
+		pageFrame.document.open();
+		pageFrame.document.write('<html><head></head><body bgcolor="#CCCCCC" topmargin="5" marginheight="5">');
+		pageFrame.document.write('<p style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; color: #CC3333; font-size: ' + fontsize + '">');
+		pageFrame.document.write(att[1] + '<b> of </b>' + numPages + '</p></body></html>');
+		pageFrame.document.close();
+	}
+}