<?xml version="1.0" encoding="ISO-8859-1"?>
<public:component xmlns:public="urn:HTMLComponent" lightweight="true">
  <public:attach event="onload" for="window" handler="grabInit"/> 
  <script type="text/javascript">
//<![CDATA[
function deselect () {
   if (window.document.selection)
     window.document.selection.empty();
   else if (window.getSelection)
     window.getSelection().removeAllRanges();
}


function grabInit () {
    if (element.className == "splitter-e") {
        element.style.cursor = "e-resize" ;
        element.style.width = "5px" ;
        var td=element.parentNode;
        // alert(td.nodeName);
        td.onmousedown=grabDownEW;
    } else {
        element.style.cursor = "n-resize" ;
        element.onmousedown=grabDownNS;
    }
}
function grabDownNS (e) {
    e=e||window.event;
  
    var clientY0 = e.clientY;
    var sibling = element.previousSibling ;
    while (sibling.nodeName != "DIV") {
        sibling = sibling.previousSibling ;
    }
    var topPane = sibling ;
    var topHeigth0 = topPane.offsetHeight;
    var bottomPane =  element.nextSibling ;
   while (bottomPane.nodeName != "DIV") {
       bottomPane = bottomPane.nextSibling ;
   }
   var bottomHeigth0 = bottomPane.offsetHeight;
   window.document.onmousemove = function (e) {
     var deltaY;
     e=e||window.event;
     deltaY = e.clientY - clientY0;
     deltaY = Math.min(deltaY, bottomHeigth0);
     deltaY = Math.max(deltaY, -topHeigth0);
     topPane.style.height = topHeigth0 + deltaY + "px";
 }
   // IE seems better without dragstart

   window.document.ondragstart = function(){return false};

   // cleanup after document.onmouseup

   window.document.onmouseup = function(e) {
     this.onmousemove = null;
     this.onmouseup = null;
     this.ondragstart = null;
     topPane = null; // break reference
     deselect();

   }
    
}
function grabDownEW(e) // mousedown over grabber
{
   e=e||window.event;
 
   var clientX0 = e.clientX;
   

   var leftPane = element.parentNode.previousSibling ;
   while (true) {
       if (leftPane.nodeName == "TD") break ;
       if (leftPane.nodeName == "TH") break ;
       leftPane = leftPane.previousSibling ;
   }
   //alert(leftPane.nodeName);
   var leftWidth0 = leftPane.offsetWidth;
   //alert("hi"+leftPane.nodeName+leftWidth0) ;
   //var leftPane = element.parentNode.previousSibling ;
   var rightPane =  element.parentNode.nextSibling ;
   while (true) {
       if (rightPane.nodeName == "TD") break ;
       if (rightPane.nodeName == "TH") break ;
       rightPane = rightPane.nextSibling ;
   }
 
   var rightWidth0 = rightPane.offsetWidth;
   //((window.document.getElementById("rightPane").offsetWidth;
  
   window.document.onmousemove = function (e) {
     var deltaX;
     e=e||window.event;
     deltaX = e.clientX - clientX0;
     deltaX = Math.min(deltaX, rightWidth0);
     deltaX = Math.max(deltaX, -leftWidth0);
     leftPane.style.width = leftWidth0 + deltaX + "px";
   }

   // IE seems better without dragstart

   window.document.ondragstart = function(){return false};

   // cleanup after document.onmouseup

   window.document.onmouseup = function(e) {
     this.onmousemove = null;
     this.onmouseup = null;
     this.ondragstart = null;
     leftPane = null; // break reference
     deselect();

   }
}

//]]>
</script>
</public:component>
