Index: /trunk/autoquest-htmlmonitor/src/main/js/autoquest-htmlmonitor.js
===================================================================
--- /trunk/autoquest-htmlmonitor/src/main/js/autoquest-htmlmonitor.js	(revision 868)
+++ /trunk/autoquest-htmlmonitor/src/main/js/autoquest-htmlmonitor.js	(revision 869)
@@ -58,9 +58,11 @@
 'onmouseout' , 'onmousemove' ,'onfocus','onscroll'];  // edit*/
 
-
+/**
+ * stores events, which were recorded but not sent to the server yet
+ */
 var recordedEvents = [];
 
 /**
- * is automatically executed to initialize the event handling
+ * automatically executed to initialize the event handling
  */
 (function() {
@@ -88,9 +90,11 @@
 
 /**
- * traverses the DOM-structure of the HTML-side, and adds event handling attributes to each
+ * traverses the DOM-structure of the HTML-site, and adds event handling attributes to each
  * relevant node
  * 
- * @param node the node of the DOM structure that shall be adapted and whose children shall be
- *             traversed
+ * @param node       the node of the DOM structure that shall be adapted and whose children shall
+ *                   be traversed
+ * @param parentPath the path to the parent node of the provided node within the DOM-structure of
+ *                   the HTML-site
  */
 function addEventHandlingAttributes(node, parentPath) {
@@ -127,5 +131,17 @@
 
 /**
- * 
+ * generates a path through the DOM-structure of the HTML-site depending on a node and the path
+ * to its parent node. The result is the parent path plus a path element for the provided node.
+ * If the node has a tag name, this is the first part of the path element generated for the node.
+ * If the node has an id, it becomes the second part of the path element. If the node does not have
+ * an id, the method calculates the index of the node within all children of the same type within
+ * the parent node. This index becomes then the second part of the path element generated for the
+ * node. 
+ * 
+ * @param node       the node of the DOM structure for which the path shall be created
+ * @param parentPath the path to the parent node of the provided node
+ * 
+ * @returns a path in the DOM-structure of the HTML-site including the parent path an a path
+ *          element for the provided node
  */
 function getNodePath(node, parentPath) {
@@ -170,8 +186,14 @@
 
 /**
- * handles an event that happened on a node
- * 
- * @param node
- * @returns {Boolean}
+ * handles an event that happened on a node. This method is called by the event handling attributes
+ * of the nodes. These attributes are generated by the
+ * {@link #addEventHandlingAttributes(node,parentPath)} function. It creates a new Event object and
+ * add it to the list of <code>recordedEvents</code>. If this list achieves the maximum
+ * <code>packageSize</code> the events in the list are sent to the server asynchronously through
+ * calling {@link #sendRequest()}.
+ * 
+ * @param eventName the name of the event, e.g. onscroll
+ * @param nodePath  the path to the node in the HTML DOM on which the event occurred
+ * @param event     the HTML event that occured
  */
 function handleEvent(eventName, nodePath, event) {
@@ -211,5 +233,6 @@
 
 /**
- * sends the collected data to the server, named in the destination-variable
+ * sends the collected data to the server, named in the destination-variable. For this it generates
+ * a JSON formatted message and uses Ajax and the <code>destination</code> to send it to the server
  */
 function sendRequest() {
@@ -268,5 +291,10 @@
 
 /**
- * determines the coordinates of an onclick or ondblclick event
+ * determines the coordinates of an onclick or ondblclick event. If the coordinates to not come
+ * with the provided event, they are determined based on the surrounding object
+ * 
+ * @param event the event to extract the coordinates of
+ * 
+ * @returns the coordinates of the event as an array with x and y coordinate
  */
 function getEventCoordinates(event) {
@@ -302,5 +330,7 @@
 
 /**
- * 
+ * reads the id of the client from the cookies.
+ * 
+ * @returns the client id or null, if none is found in the cookies
  */
 function readClientId() {
@@ -342,5 +372,7 @@
 
 /**
- * 
+ * stores the provided client id in the cookies
+ * 
+ * @param clientId the client id to be stored
  */
 function storeClientId(clientId) {
@@ -355,5 +387,7 @@
 
 /**
- * 
+ * returns the name of the cookie used to store the client id
+ * 
+ * @returns as described
  */
 function getClientIdCookieName() {
@@ -362,5 +396,8 @@
 
 /**
- * 
+ * generates a client id based on the result of {@link #getClientIdPrefix()} and the current time
+ * stamp
+ * 
+ * @returns the client id
  */
 function generateClientId() {
@@ -369,5 +406,8 @@
 
 /**
- * 
+ * generates a client id prefix based on the user agent and the navigators platform. The prefix
+ * is a simple checksum of the concatenation of both strings
+ * 
+ * @returns the client id prefix
  */
 function getClientIdPrefix() {
@@ -389,5 +429,7 @@
 
 /**
- * performs a simple logging
+ * performs a simple logging by adding a specific div to the HTML
+ * 
+ * @param text the text to be logged
  */
 function log(text) {
@@ -419,4 +461,10 @@
 }
 
+/**
+ * this class represents a single event
+ * 
+ * @param type     the type of the event
+ * @param nodePath the path through the HTML DOM to the event target
+ */
 function Event(type, nodePath) {
     this.type = type;
