/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function externalWindow(href){
    window.open( href);
    return false;
}

$(document).ready(function(){
    $("#menu a").each(function(){
        var href = $(this).attr("href");
        var ext = $(this).attr("ext");
        $(this).attr({
            href: "#"
        });
        $(this).click(function(){
            var a =new String(href);
            if(a.length>1){
                if (ext=="no"){
                    $("#container-ajax").load(href);
                }else{
                    externalWindow(href);
                }
            }
        });
    });
});


$(function(){
    $('#menu li a').click(function(event){
        var elem = $(this).next();
        if(elem.is('ul')){
            event.preventDefault();
            $('#menu ul:visible').not(elem).slideUp();
            elem.slideToggle();
        }
    });
});



