$(document).ready(function() {
  if($("#main-nav ul li a")) {
    $("#main-nav ul li a").hover(function() { //When trigger is clicked...

        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("ul.subnav").show().css('z-index','11'); //Drop down the subnav on click

        $(this).parent().hover(function() {
        }, function(){
            $(this).parent().find("ul.subnav").hide(); //When the mouse hovers out of the subnav, move it back up
        });
    });
  }
});


