(function($){
    $(function() {
        var tempHeight = 0;

        $('div.customCategoryLanding-content').each(function(){
            if($(this).height() > tempHeight) tempHeight = $(this).height();
        })
        $('div.customCategoryLanding-content').css("height", tempHeight+'px');

        $('#categoryLanding-faqs div.categoryLanding-question').click(
                function() {
                    var answerDiv = $(this).next("div.categoryLanding-answer");
                    if($(answerDiv).css('display') == 'none') {
                        $(answerDiv).slideDown("normal");
                        $(this).parent(".link").css('backgroundImage','url("/common/images/bullet-redArrow-down.gif")')
                    } else {
                        $(answerDiv).slideUp("normal")
                        $(this).parent(".link").css('backgroundImage','url("/common/images/bullet-redArrow.gif")')
                    }


                }
                );

        $('div.categoryLanding-question').hover(function() {
            $(this).css('text-decoration', 'underline');
        }, function() {
            $(this).css('text-decoration', 'none');
        })

        if (this.location.href.indexOf('customshowerdoors') == -1) {
            var so = new SWFObject("/common/flash/Main.swf?xmllocation=/common/flash/data/dataWeb.xml",
                    "home", "899", "241", "9" );
            so.addParam('allowScriptAccess', 'always'); so.useExpressInstall("/common/flash/FlashAutoInstaller.swf");
            so.addParam('wmode', 'transparent');
            so.setAttribute('xiRedirectUrl', 'http://www.sterlingplumbing.com/');
            so.write("flashcontent");
        }
    })
})(jQuery);