// LEFT NAVIAGTION VERSION 0.02 
$(document).ready(function(){
  leftNavigation();
});

var chover = 0;

function leftNavigation(){
  
  $("body").append("<a id=\"expandT\"></a><table id=\"leftNavigationTable\" style=\"display: none\"><tbody><tr><td class=\"expandLayer\" width=\"135px\"><div id=\"expandLinks\"><ul></ul></div><div class=\"expandFooter\"></div></td></tr></tbody></table>")
  $(".navigation_head").each(function(){
    $(this).hover(function(){

      var coffset = $(this).offset();
      var table = $("#leftNavigationTable");
      var cid = $(this).attr("id");
      
      var chref = $("#"+cid+" a").attr("href");
      
      var ccontent = $("#"+cid+" ul").html();
      var ctitle = $("#"+cid+" a").html();
      
        $("#expandT").html(ctitle);
        
        
        $("#expandT").attr("class", cid);
        $("#expandT").css("left", coffset.left);
        $("#expandT").css("top", coffset.top);
        $("#expandT").css("display", "block");
        $("#expandT").attr("href", chref);
    if(ccontent != null){
  
        $("#expandLinks ul").html(ccontent);
        
        table.css("top", (coffset.top - 2));
        table.css("left", (coffset.left + 168));
        table.css("display", "block");
        
        chover = 1;
        
        $("#expandT").bind("mouseover", function(){
          chover = 1;
        });
        $("#expandT").bind("mouseout", function(){
          chover = 0;
          window.setTimeout('if(chover == 0){$("#leftNavigationTable").css("display", "none"); $("#expandT").css("display", "none");} ', 200);
        });
        $("#leftNavigationTable").bind("mouseover", function(){
          chover = 1;
        });
        $("#leftNavigationTable").bind("mouseout", function(){
          chover = 0;
          window.setTimeout('if(chover == 0){$("#leftNavigationTable").css("display", "none"); $("#expandT").css("display", "none");} ', 200);
        });

    }else{
      $("#leftNavigationTable").css("display", "none");
    }
    }, function(){
    
    
    });
  });
}
