So I'm just a nuby on using js and website design in general but doing my best to figure this thing all out.
Currently I have a line of js that is now not working properly:
Code:
<script type="text/javascript">    
    $(document).ready(function(){        

        var currentWindowLocation = window.location.pathname;
        var currentWindowProtocol = window.location.protocol;
        var currentHomePage = '/';        
        if(currentWindowLocation != currentHomePage && currentWindowProtocol != 'https:'){
            $(".Content").append('<a href="#TOP" class="TopLink">Back to Top</a>');
        }
        // add parent class to left hand nav for styling and show after styling is done
        $('.Left .category-list li:has(> ul)').addClass('parent');
        $('.Left .category-list li:has(> ul)').prepend('<img class="AccordianCarrot" src="/product_images/uploaded_images/AccordianCarrot.png" />');
        $('.Left .category-list > li').show();
        //Hiding SubCategory lists
        $(".Left .category-list .parent ul").hide();
        
        //Setting Current Category to a Window Var
        window.topLevelCat = $('#CategoryBreadcrumb li:eq(1)').text() + "";
        //window.currentSubCat = $('#CategoryBreadcrumb li:eq(2)').text() + "";
        
        window.currentSubCat = $('#CategoryBreadcrumb li');
        
        //Going Through Each Top Level li and checking to see if it is the current category
        var firstCat = true;
        $('.Left #CategoryList>ul>li').each(function(){
            //Checking to see the current category matches this li's first anchor
            if(window.topLevelCat.indexOf(decodeURIComponent($('a:eq(0)',this).html()).replace('&amp;','&')) >= 0){
                //Expand the SubMenu
                //$('ul',this).show();
                //Applying the pink class to the main cat anchor
                $('a:eq(0)',this).parent().addClass('onCatLink');
                $('a:eq(0)',this).parent().addClass('onCatLink1');
                //Looping through each subcat li and checking to see if it's the current subcat
                for(var i = 1; i < window.currentSubCat.length; i++){
                    $('li',this).each(function(){
                        //If the current li is the subcat
                        //console.log("pre if Current: " + $(window.currentSubCat[i]).text());
                        //console.log("pre if link: " + decodeURIComponent($('a',this).html()).replace('&amp;','&'));
                        var rgx = new RegExp(decodeURIComponent($('a',this).html()).replace('&amp;','&'),"gi");
                        //console.log($(window.currentSubCat[i]).text().match(rgx));
                        if($(window.currentSubCat[i]).text().indexOf(decodeURIComponent($('a',this).html()).replace('&amp;','&')) >= 0){
                            //console.log("in if Current: " + $(window.currentSubCat[i]).text());
                            //console.log("in if link: " + decodeURIComponent($('a',this).html()).replace('&amp;','&'));
                            $('a:eq(0)',this).parent().addClass('onCatLink');
                            $('a:eq(0)',this).parent().addClass('onCatLink2');
                        }
                    });
                }
            }
        });
        //rotate carrot for current cat.
        $('.Left .onCatLink > .AccordianCarrot').rotate(90);
        $('.Left .onCatLink > .AccordianCarrot').addClass('rotated');

        $('.Left .AccordianCarrot').click(function(){
            $(this).parent().find('> ul').slideToggle();
            if($(this).hasClass('rotated')){
                $(this).rotate(360);
                $(this).removeClass('rotated');
            }
            else{
                $(this).rotate(90);
                $(this).addClass('rotated');
            }
            var temp = $(this);
            setTimeout(function(){$(temp).parent().removeClass('onCatLink');},400);
        });

    });
If the text in the menu is selected the sub cats close then open and then the carrot is not rotated down it returns to original position. Original position is pointed to the Cat Text showing there are subs with in it, and when click the arrow points downward to show the cat has been expanded.
Could anyone help me out with this??

thanks!