Index: trunk/FACT++/www/viewer/index.html
===================================================================
--- trunk/FACT++/www/viewer/index.html	(revision 17852)
+++ trunk/FACT++/www/viewer/index.html	(revision 17856)
@@ -405,7 +405,9 @@
 <div id="ctrlcontainer" class="ui-widget-content">
    <form id="controls" method="POST" style="margin-bottom:0">
+      <input id="getgeometry" type="button" onclick="onGetGeometry();" value="Get geometry"></input>
       <input id="getcamera"   type="button" onclick="onGetCameras();" value="Get camera data"></input>
       <input id="getwaveform" type="button" onclick="onGetWaveforms();" value="Get waveforms"></input>
       <input id="data" name="data" type="hidden"></input>
+      <input id="name" name="name" type="hidden"></input>
    </form>
 </div>
@@ -618,4 +620,15 @@
 disp=1.42*(1-width/length).
 
+<H3>What are the additional controls</H3>
+<i>Get geometry</i>: You will get a file with the pixel positions in arbitrary units.
+The three columns are the pixel index, and the x and y coordinate 
+in degree.<br>
+<i>Get camera data</i>: You will get a file with the data from the currently
+displayed cameras. The columns are pixel index and value of the cameras
+1, 2, 3 and 4.<br>
+<i>Get waveforms</i>: You will get a file with the data from the currently
+displayed waveforms. The columns are sample index and amplitude  of the waveforms
+1, 2, 3 and 4.
+
 <H3>Why is loading the page so slow?</H3>
 The total contents of the javascript libraries is about 1MB which
Index: trunk/FACT++/www/viewer/index.js
===================================================================
--- trunk/FACT++/www/viewer/index.js	(revision 17852)
+++ trunk/FACT++/www/viewer/index.js	(revision 17856)
@@ -267,4 +267,5 @@
 
     $('#controls > input[name=data]').val(JSON.stringify(arr));
+    $('#controls > input[name=name]').val('cameras.txt');
     $('#controls').attr('action','index.php');
     $('#controls').submit();
@@ -276,4 +277,23 @@
 
     $('#controls > input[name=data]').val(JSON.stringify(arr));
+    $('#controls > input[name=name]').val('waveforms.txt');
+    $('#controls').attr('action','index.php');
+    $('#controls').submit();
+}
+
+function onGetGeometry()
+{
+    var sqrt32 = Math.sqrt(3)/2;
+    
+    var arr = [ new Array(1440), new Array(1440) ];
+
+    for (var i=0; i<1440; i++)
+    {
+        arr[0][i] = coord[i][0]*0.1111;
+        arr[1][i] = coord[i][1]*0.1111*sqrt32;
+    }
+
+    $('#controls > input[name=data]').val(JSON.stringify(arr));
+    $('#controls > input[name=name]').val('geometry.txt');
     $('#controls').attr('action','index.php');
     $('#controls').submit();
@@ -793,7 +813,7 @@
         return;
 
-    if (!f.type.match('text/plain') && !f.type.match('application/javascript'))
-    {
-        alert("ERROR - Unknown file type.");
+    if (!f.type.match('text/plain') && !f.type.match('application/javascript') && !f.type.match('application/x-javascript'))
+    {
+        alert("ERROR - Unknown file type: "+f.type);
         return;
     }
Index: trunk/FACT++/www/viewer/index.php
===================================================================
--- trunk/FACT++/www/viewer/index.php	(revision 17852)
+++ trunk/FACT++/www/viewer/index.php	(revision 17856)
@@ -37,5 +37,5 @@
     header('Content-Type: text/plain');
     header('Content-Transfer-Encoding: Text');
-    header('Content-Disposition: attachment; filename="data.txt"');
+    header('Content-Disposition: attachment; filename="'.$_POST['name'].'"');
 
     $json = json_decode($_POST['data']);
