$(function() {
  
  /* dropdown menu */
  
  $(".breadcrumb > li").hoverIntent({
    over: function() {
        var u = $(this);    
        if (u.find("ul:first").length < 1 && u.find("a:first").attr("rel")) {          
          u.append("<ul></ul>")
          .find("ul:first")         
          .css({"display" : "none"})         
          .load("http://" + window.location.host + "/content/menu.php",          
            { parID: u.find("a:first").attr("rel") },          
            function() {          
              $("li > ul", u).parent()          
              .hoverIntent({          
                over: function() {          
                  $("ul:first", this).each(function() {          
                    var p = $(this).parent()          
                    $(this).css({
                      "top"  : "0",
                      "left" : p.position().left + p.width()          
                    })          
                    .stop().show("fast");      
                  });    
              },                                    
              out: function() {
                $("ul:first", this).hide();
              },
              timeout: 400})
              .find("a:first")  
              .append("<span>&raquo;</span>");

              u.find("ul:first").slideDown("fast");
            }
          );         
        } else {
          u.find("ul:first").slideDown("fast");
        }  
      },
    out: function() {  
      $(this).find("ul:first").slideUp("fast");
    },
    timeout: 300});
});

