	function display_pano(Name, title, pfov, width, height) {
	pixperdegree = width/pfov;
	minfov = 400 / pixperdegree / 2;
	//alert('width=' + width + ', pfov=' + pfov + ', pixperdegree='+pixperdegree + ', minfov='+minfov );
	panoView = window.open("", "panoView", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=410,height=360");
	panoView.document.open();
	panoView.document.write("<HTML><HEAD>");
	panoView.document.write("<TITLE>"+title+"</TITLE>");
	panoView.document.write( "<script type='text/javascript' language='JavaScript'>");
	panoView.document.write(" document.write('<style> #container {position: relative; visibility: show; top: -15; left: -10;}</style>')");
	panoView.document.write("//-->");
	panoView.document.write("<\/script>");
	panoView.document.write("</HEAD><BODY BGCOLOR=000000 TEXT=000000 border=0 marginwidth=0 marginheight=0>");
	panoView.document.write("<div id=container name=container>");
	if (pfov < 360) {
		panoView.document.write("<applet name=\"ptviewer\" archive=\"/serstuff/ptviewer2.6.jar\" code=\"ptviewer.class\" width=\"410\" height=\"360\">");
	} else {
		panoView.document.write("<applet name=\"ptviewer\" archive=\"/serstuff/ptviewer2.8.jar\" code=\"ptviewer.class\" width=\"410\" height=\"360\">");
	};
	panoView.document.write("<param name=\"file\" value='"+ Name + "'>");
	panoView.document.write("<param name=\"pfov\" value='" + pfov + "'>");
//	panoView.document.write("<param name='fovmax' value='140'>");
//	panoView.document.write("<param name='fovmin' value='" + minfov + "'>");
	panoView.document.write("<param name='auto' value='0.5'>");
	panoView.document.write("<param name='antialias' value='true'>");
	panoView.document.write("<param name='quality' value='2'>");
	panoView.document.write("<param name='view_x' value='5'>");
	panoView.document.write("<param name='view_y' value='5'>");
	panoView.document.write("<param name='view_width' value='400'>");
	panoView.document.write("<param name='view_height' value='300'>");
	panoView.document.write("<param name='frame' value='/serstuff/javaframe.gif'>");
	panoView.document.write("<param name='wait' value='/serstuff/Waitimage.gif'>");
	panoView.document.write("<param name=bgcolor value='000000'>");
	panoView.document.write("<param name=barcolor value='0000ff'>");
	panoView.document.write("<param name=bar_x value=106>");
	panoView.document.write("<param name=bar_y value='271'>");
	panoView.document.write("<param name=bar_width value='198'>");
	panoView.document.write("<param name=bar_height value='13'>");
	panoView.document.write("<param name=\"inits\"  value='ptviewer:startApplet(0);'>");
	panoView.document.write("//controls // ");
	panoView.document.write("<param name='shotspot0' value=\" x27 y323 a48 b345   u'ptviewer:moveTo(-180,0,100,50)' \">");
	panoView.document.write("<param name='shotspot1' value=\" x75 y329 a86 b341   u'ptviewer:startAutoPan(-0.5,0,1)' \">");
	panoView.document.write("<param name='shotspot2' value=\" x87 y321 a99 b331   u'ptviewer:startAutoPan(0,0.5,1)' \">");
	panoView.document.write("<param name='shotspot3' value=\" x87 y338 a99 b348   u'ptviewer:startAutoPan(0,-0.5,1)' \">");
	panoView.document.write("<param name='shotspot4' value=\" x100 y329 a112 b341 u'ptviewer:startAutoPan(0.5,0,1)' \">");
	panoView.document.write("<param name='shotspot5' value=\" x140 y326 a155 b342 u'ptviewer:stopAutoPan()' \">");
	panoView.document.write("<param name='shotspot6' value=\" x178 y320 a208 b350 u'ptviewer:startAutoPan(0,0,1.03)' \">");
	panoView.document.write("<param name='shotspot7' value=\" x220 y320 a250 b350 u'ptviewer:startAutoPan(0,0,0.97)' \">");
	panoView.document.write("<param name='shotspot8' value=\" x305 y318 a385 b348 u'http://www.360photo.org' t'_new' \">");
	panoView.document.write("<param name=\"applet0\" value=\"{code=ptcompass.class} {compass_map=/serstuff/oog.gif} {compass_x=260} {compass_y=320} {compass_pan=120}\">");
	panoView.document.write("</applet>");
	panoView.document.write("</BODY></HTML>");
	panoView.document.close();
}
function display_image(Name, title, width, height) {
	imgView = window.open("", "imgView", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width="+width+",height="+height);
	imgView.document.open();
	imgView.document.write("<HTML><HEAD>");
	imgView.document.write("<TITLE>"+title+"</TITLE>");
	imgView.document.write( "<script type='text/javascript' language='JavaScript'>");
	if (parseInt(navigator.appVersion) >= 4){
		if (navigator.appName == "Netscape") {
			imgView.document.write(" document.write('<style> #container {position: relative; visibility: show; top: -8; left: -8;}</style>')");
		} else if (navigator.appName == "Microsoft Internet Explorer") {
			imgView.document.write(" document.write('<style> #container {position: relative; visibility: show; top: -15; left: -10;}</style>')");
		}
	}
	imgView.document.write("//-->");
	imgView.document.write("<\/script>");
	imgView.document.write("</HEAD><BODY BGCOLOR=000000 TEXT=000000 border=0 marginwidth=0 marginheight=0>");
	imgView.document.write("<div id=container><IMG HSPACE=0 VSPACE=0 width=" + width + " height=" + height + " " + "SRC='" + Name + "'></div>");
	imgView.document.write("</BODY></HTML>");
	imgView.document.close();
}

function display_qt(Name, title, width, height) {
	qtView = window.open("", "qtView", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=410,height=360");
	qtView.document.open();
	qtView.document.write("<HTML><HEAD>");
	qtView.document.write("<TITLE>"+title+"</TITLE>");
	qtView.document.write( "<script type='text/javascript' language='JavaScript'>");
	qtView.document.write(" document.write('<style>");
	qtView.document.write("#container {position: absolute; visibility: show; top: 5; left: 5;}");
	qtView.document.write("#container2 {position: absolute; visibility: show; top: 0; left: 0;}");
	qtView.document.write("</style>')");
	qtView.document.write("//-->");
	qtView.document.write("<\/script>");
	qtView.document.write("</HEAD><BODY BGCOLOR=ffffff TEXT=000000 border=0 marginwidth=0 marginheight=0>");
//	qtView.document.write("<embed src='huiskamer.mov' height="400'  width='400' loop='TRUE' controller='FALSE' pluginspage='http://www.apple.com/quicktime/'>");
	qtView.document.write("<div id=container2><img src=\"/shared/qtframe.gif\"></div><div id=container><embed HSPACE=0 VSPACE=0 width=" + width + " height=" + height + " " + "SRC='" + Name + "'" + " loop='true' controller='false' pluginspage='http://www.apple.com/quicktime/' ></div>");
	qtView.document.write("</BODY></HTML>");
	qtView.document.close();
}

	// TableTitle, AtomicalName
	// ThumbSource, Thumbwidth, Thumbheight, ThumbAltText, 
	// BallSource, BallWidth, BallHeight, 
	// BigSource, BigWidth, BigHeight, 
	// SmallSource, SmallWidth, SmallHeight,
	// JavaSource, JavaFov, JavaWidth, JavaHeight,
	// QtSource, QtWidth, QtHeight, 
	// VrmlUrl, Description, Snow

function bla(TableTitle, AtomicalName, ThumbSource, ThumbWidth, ThumbHeight, ThumbAltText,  BallSource, BallWidth, BallHeight, BigSource, BigWidth, BigHeight, SmallSource, SmallWidth, SmallHeight, JavaSource, JavaFov, JavaWidth, JavaHeight, QtSource, QtWidth, QtHeight, VrmlUrl, Description, Snow) {
	teller=0;
	document.write("<TABLE cellspacing='0'>");
	document.write("<TR><TD valign=\"top\" colspan=\"2\">");
	document.write("<div class=\"tabletitle\">&nbsp;" + TableTitle + "&nbsp;</div>");
	document.write("</TD></TR><TR><TD valign=\"top\">");
	if (Snow != 'yes')	{
		document.write("<IMG SRC=\"" + ThumbSource + "\" WIDTH=\"" + ThumbWidth + "\" HEIGHT=\"" + ThumbHeight + "\"");
		document.write("     BORDER=0 ALT=\"" + ThumbAltText + "\">");
	} else {
		document.write("<applet code=\"snow\" width=" + ThumbWidth + " height=" + ThumbHeight + "><param name=image value=\"" + ThumbSource + "\"><param name=strength value=4> </applet>");
	};
	document.write("</TD><TD valign=\"top\" align=\"right\">");
	document.write("<TABLE cellpadding=\"0\" cellspacing=1 border=\"0\"><TR>");
	if (BigSource != '') {
		teller++;
		doe (AtomicalName, BigSource, BigWidth, BigHeight, "/shared/buttonbig.jpg", "equirectangular");
	};
	if (teller == 3){
		document.write("</TR><TR>");
	};
	if (SmallSource != '') {
		teller++;
		doe (AtomicalName, SmallSource, SmallWidth, SmallHeight, "/shared/buttonsmall.jpg", "equirectangular");
	};
	if (teller == 3){
		document.write("</TR><TR>");
	};
	if (BallSource != '') {
		teller++;
		doe (AtomicalName, BallSource, BallWidth, BallHeight, "/shared/buttonball.jpg", "spherical");
	};
	if (teller == 3){
		document.write("</TR><TR>");
	};
	if (JavaSource != '') {
		teller++;
		document.write("<TD valign=\"top\">");
		document.write("<a href=\"Javascript:display_pano('" + JavaSource + "', 'View " + AtomicalName + " as an interactive java sphere', " + JavaFov + ", " + JavaWidth + ", " + JavaHeight + ")\"");
		document.write("   ONMOUSEOVER=\"window.status='View " + AtomicalName + " as an interactive java sphere' ; return true\"");
		document.write("   ONMOUSEOUT=\"status=('') ; return true\">");
		document.write("  <IMG SRC='/shared/buttonjava.jpg' WIDTH='30' HEIGHT='30' BORDER=0 ALT='View " + AtomicalName + " as an interactive java sphere'>");
		document.write("</a></TD>");
	};
	if (teller == 3){
		document.write("</TR><TR>");
	};
	if (QtSource != '') {
		teller++;
		document.write("<TD valign=\"top\">");
		document.write("<a href=\"Javascript:display_qt('" + QtSource + "','" + AtomicalName + " in Quicktime VR-view'," + QtWidth + ", " + QtHeight + ")\"");
		document.write("   ONMOUSEOVER=\"window.status='View as Quicktime VR panorama' ; return true\"");
		document.write("   ONMOUSEOUT=\"status=('') ; return true\">");
		document.write("  <IMG SRC='/shared/buttonqt.jpg' WIDTH='30' HEIGHT='30' BORDER=0 ALT='View as Quicktime VR panorama'>");
		document.write("</a></TD>");
	};
	if (teller == 3){
		document.write("</TR><TR>");
	};
	if (VrmlUrl != '') {
		teller++;
		document.write("<TD valign=\"top\">");
		document.write("<a href=\"" + VrmlUrl + "\" alt=\"View " + AtomicalName + " as VRML world\" target=\"_new\"");
		document.write("   ONMOUSEOVER=\"window.status='View " + AtomicalName + " as VRML world' ; return true\"");
		document.write("   ONMOUSEOUT=\"status=('') ; return true\">");
		document.write("  <IMG SRC='/shared/buttonvrml.jpg' WIDTH='30' HEIGHT='30' BORDER=0 ALT='View " + AtomicalName + " as VRML world'>");
		document.write("</a></TD>");
	};
	document.write("</TR></TABLE>");
    document.write("</TD></TR><td valign=\"top\" colspan=\"2\" align=justify>");
    document.write("<div class=comment>" + Description + "</div>");
    document.write("</td></TABLE>");
}

function doe (Name, FileName, Width, Height, IconFile, projection) {
	document.write("<TD valign=\"top\">");
	document.write("<a href=\"Javascript:display_image('" + FileName + "','" + Name + " in " + projection + " projection (" + Width + " x " + Height + " pixels)'," + Width + ", " + Height + ")\"");
	document.write("   ONMOUSEOVER=\"window.status=' View " + projection + " (" + Width + " x " + Height + " pixels)' ; return true\""); 
	document.write("   ONMOUSEOUT=\"status=('') ; return true\">");
	document.write("  <IMG SRC='" + IconFile + "'  WIDTH='30' HEIGHT='30' BORDER=0 ALT=' View " + projection + " (" + Width + " x " + Height + " pixels)'>");
	document.write("</a></TD>");
}

function display_3d (NameL, NameR, title, pfov) {
	panval = pfov / 2;
	p3dview = window.open("", "p3dview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=330,height=140");
	p3dview.document.open();
	p3dview.document.writeln("<HTML><HEAD><TITLE>"+title+"</TITLE>");
	p3dview.document.writeln("<style> #container {position: relative; visibility: show; top: -15; left: -10;}</style>");
	p3dview.document.writeln("<script type='text/javascript' language='JavaScript'><!--//");
	p3dview.document.writeln("function changeview(p,t,f) {document.slave1.gotoView(p, t, f);}");
//	p3dview.document.write("function changeview2(p,t,f) {document.master.gotoView(p, t, f);}");
	p3dview.document.writeln("//-->");
	p3dview.document.writeln("<\/script>");
	p3dview.document.write("</HEAD><BODY BGCOLOR=000000 TEXT=000000 border=0 marginwidth=0 marginheight=0>");
	p3dview.document.write("<div id=container name=container>");
	p3dview.document.write("<table><tr><td>");
	p3dview.document.write("<applet archive=ptviewer.jar  code=ptviewer.class width=160 height=100 name=master mayscript=true>");
	p3dview.document.write("<param name=file value='" + NameL + "'>");
	p3dview.document.write("<param name='antialias' value='true'>");
	p3dview.document.write("<param name=pfov value='" + pfov + "'>");
	p3dview.document.write("<param name=pan value='" + "0" + "'>");
	p3dview.document.write("<param name=getview value='changeview'>");
	p3dview.document.write("</applet></td><td>");
	p3dview.document.write("<applet archive=ptviewer.jar  code=ptviewer.class width=160 height=100 name=slave1>");
//	p3dview.document.write("<applet archive=ptviewer.jar  code=ptviewer.class width=160 height=100 name=slave1 mayscript=true>");
	p3dview.document.write("<param name=pan value=" + "0" + "><param name=pfov value=" + pfov + ">");
	p3dview.document.write("<param name=file value='" + NameR + "'>");
	p3dview.document.write("<param name='antialias' value='true'></applet>");
//	p3dview.document.write("<param name=getview value='changeview2'>");
	p3dview.document.write("</td></tr></table></div>");
	p3dview.document.write("</BODY></HTML>");
	p3dview.document.close();
}

function pano(url) {
	var winX='PTViewer';
	var w=410;
	var h=360;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	win = window.open(url,winX,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition);
	if(win.window.focus){win.window.focus();}
}

