Hyphenator.run();

$(document).ready(function (){
    $(".readmoreBlock").hide();
    $(".mainnav li").mouseover(function(){
        if(!$(this).hasClass("active")){
            $(this).css("background","#9e620a");
            $(this).children("a").css({"background":"#9e620a", "color":"#ffffff"});
        }
    });
    $(".mainnav li").mouseout(function(){
        if(!$(this).hasClass("active")){
            $(this).css("background","#EAE7DF");
            $(this).children().css({"background":"#EAE7DF", "color":"#57626B"});
        }
    });
    $(".readmore a").click(function(){
        if($(this).attr("title") == $(this).text()){
            $(this).text("Close");
        }else{
            $(this).text($(this).attr("title"));
        }
        $(this).parent().siblings(".readmoreBlock").slideToggle();
        $(this).blur();
        return false;
    });
    $(".readmoreLink").click(function(){
        if($(this).siblings(".readmore").children("a").attr("title") == $(this).siblings(".readmore").children("a").text()){
            $(this).siblings(".readmore").children("a").text("Close");
        }else{
            $(this).siblings(".readmore").children("a").text($(this).siblings(".readmore").children("a").attr("title"));
        }
        $(this).siblings(".readmoreBlock").slideToggle();
        return false;
    });

    var jumpLink = top.location.href.indexOf("jumpLink");
    if(jumpLink != -1){
        jumpLink = top.location.href.substring(jumpLink+9);
        $("#"+jumpLink).children(".readmoreBlock").show();
        $.scrollTo("#"+jumpLink,{duration:2000});
        $("#"+jumpLink).children(".readmore").children("a").text("Close")
    }
    var tempHeight = new Array();
    $(".evenChildren").each(function(){
        tempHeight.length = 0;
        $(this).children(".evenChild").each(function(){
            tempHeight[tempHeight.length] = $(this).height();
        });
        var tempMaxHeight = 0;
        for(i=0;i<tempHeight.length;i++){
            if(tempHeight[i] > tempMaxHeight){
                tempMaxHeight = tempHeight[i];
            }
        }
        $(this).children(".evenChild").css("minHeight",tempMaxHeight + 5 + "px")
    });
});

DD_roundies.addRule('.mainnav li', '7px');
DD_roundies.addRule('.content .halfleft, .content .halfright,.subsections .col1, .subsections .col2, .subsections .col3, .subsections .col4, .content .fullSection, #smallMap a.mapBlock, .content .introBlock, .content .introBlock .imgContainer, .membershipsBlock', '20px');
DD_roundies.addRule('.submitInput, input, textarea','5px');

