//fix the problem with the text-nodes in the DOM Tree - IE/Firefox issue
//replacement functions for nextSibling and previousSibling
function getNextSibling(startBrother){
  endBrother=startBrother.nextSibling;
  while(endBrother.nodeType!=1){
    endBrother = endBrother.nextSibling;
  }
  return endBrother;
}

function getPreviousSibling(startBrother){

  endBrother=startBrother.previousSibling;
  while(endBrother.nodeType!=1){
    endBrother = endBrother.previousSibling;
  }
  return endBrother;
}


//recursive Search for a Node with certain Class from a specified starting point
function getNodeByClass(startNode, className){
        if (startNode.className == className) return startNode;

        if (startNode.firstChild != null) {
                var node = getNodeByClass(startNode.firstChild, className);
                if (node != null) return node;
        }
        if (startNode.nextSibling != null) {
                var node = getNodeByClass(startNode.nextSibling, className);
                if (node != null) return node;
        }
        return null;
} 