function mainmenu(){
    $(" #nav ul ").css({ display: "none" }); // Opera Fix

    $(" #nav li").hover(function () {        
        $(this).find('div:first').show();
    }, function () {
        $(this).find('div:first').hide();
    });
}



$(document).ready(function () {
    mainmenu();


    var numheightleft = $("#leftcolcell").height();
    var numheightright = $("#rightcolcell").height();
    if (numheightleft > numheightright) {
        $("#rightcolcell").height(numheightleft);
    }

    if (numheightright > numheightleft) {
        $("#leftcolcell").height(numheightright);
    }

    var numcol1 = $("#3col_col1").height();
    var numcol2 = $("#3col_col2").height();
    var numcol3 = $("#3col_col3").height();
    var numcolfinal = 0;

    if (numcol1 > numcol2) {
        if (numcol1 > numcol3) {
            numcolfinal = numcol1;
        } else {
            numcolfinal = numcol3;
        }
    } else {
        if (numcol2 > numcol3) {
            numcolfinal = numcol2;
        } else {
            numcolfinal = numcol3;
        }
    }
    $("#3col_col1").height(numcolfinal);
    $("#3col_col2").height(numcolfinal);
    $("#3col_col3").height(numcolfinal);


    var pathname = window.location.pathname.replace(".html", "").replace("/", "").toLowerCase();
    pathname = pathname.replace("clients/etlaw/web/", "");
    pathname = pathname.replace("html/", "");
    pathname = pathname.replace("je_site/", "");
   


    if (pathname == "default" || pathname == "default1" || pathname == "espinosa_trueba_pl_an_intellectual_property_law_firm_-_litigation_and_prosecution" || pathname == "") {
        var flashvars = {};
        var params = {
            menu: "false",
            wmode: "transparent"
        };
        var attributes = {};
        swfobject.embedSWF("ETLawAnimation.swf", "divFlashHome", "400", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes);


        var newimg = "";
        $(".divsidetext").hover(function () {
            newimg = $(this).find('img:first').attr("src").replace(".png", "-over.png");
            $(this).find('img:first').attr("src", newimg);
        }, function () {
            newimg = $(this).find('img:first').attr("src").replace("-over.png", ".png");
            $(this).find('img:first').attr("src", newimg);
        });
    }

    if (pathname != "default") {
        if (pathname.indexOf("practiceareas") == -1) {
            $("#mnu" + pathname).css({ backgroundColor: "#000000", height: "35px" });
        } else {
            $("#mnu" + pathname).css({ backgroundColor: "#000000" });
        }

        if (pathname.indexOf("faq") != -1) {
            $("#mnufaq").css({ backgroundColor: "#000000", height: "35px" });
        }

        if (pathname.indexOf("practiceareas") != -1) {
            if (pathname == "practiceareascontracts") {
                $("#mnupracticeareas").css({ backgroundColor: "#000000" });
            } else {
                $("#mnupracticeareas").css({ backgroundColor: "#000000", height: "35px" });
            }
        }

        if (pathname.indexOf("industries") != -1) {
            $("#mnuindustries").css({ backgroundColor: "#000000", height: "35px" });
        }

        if (pathname.indexOf("seminars") != -1) {
            $("#mnuseminars").css({ backgroundColor: "#000000", height: "35px" });
        }

        if (pathname.indexOf("professionals") != -1) {
            $("#mnuprofessionals").css({ backgroundColor: "#000000", height: "35px" });
        }
    }



});
