function createDestinationMenu() {
  var navBecasDestChilds = $("#navigation-becas-destinations").children();

  navBecasDestChilds.children("ul").toggle();
  $("#navigation-becas-destinations li ul li a.active").parent().parent().toggle();
  navBecasDestChilds.children("a").click(function() {

      navBecasDestChilds.children("ul").css("display", "none");
      if ($(this).attr("href") != '/informacion-becas-mec') {
          var obj = $(this);
          $("ul" , obj.parent()).toggle();
          return false;
      }
  });
}




$(function() {
  createDestinationMenu();

  // pdfs altijd openen in een nieuwe pagina
  $("#content a[href$=.pdf]").click(function(){ var popup = window.open(this.href); return false; });

  // externe links altijd openen in een nieuwe pagina
  $("#content a").each(function(){
    if (this.hostname != document.location.hostname) $(this).click(function(){
      var popup = window.open(this.href);
      return false;
    });
  });

});

