        $(document).ready(function() {

            infoboxHover();

            hiliteSelectRows();

            hideRows();
            
            advSearch();

            $(function(){
                $("div.infobox a").click(function(){
                    window.open(this.href);
                    return false;
                });
            });
            
            

        });


//  ------------------------------------------------------------
//  Functions
//  ------------------------------------------------------------

//  --- Info box pop-ups ---------------------------
        function infoboxHover() {
            $("div.infobox").hover(function() {
                $(this).addClass("infohover");
                }, function() {
                $(this).removeClass("infohover");            
            });
        }
        
//  --- Row highlighting and selecting -------------
        function hiliteSelectRows() {

            $("div.product_item").hover(function() {
                $(this).addClass("hilite");
                $(this).find("tr").find("tr").hover(function() { 
                    $(this).addClass("hilite_row");
                    }, function() {
                    $(this).removeClass("hilite_row");
                });
                }, function() {
                $(this).removeClass("hilite");
            });

            
            $("table.deets_bottom").toggle(function() {
                $(this).parent().addClass("select");
                }, function() {
                $(this).parent().removeClass("select");
            });
            
            
        }
        
//  --- Hiding all but Selected and/or Highlighted rows
        function hideRows() {

            $("#product_filters div").hover(function() { 
                $(this).addClass("hover");
                }, function() {
                $(this).removeClass("hover");
            });

            $("#hot_only").toggle(function() {
                $(this).addClass("on");
                $("#main").find("div.product_item").not(".hot").addClass("hot_hide");
                }, function() {
                $(this).removeClass("on");
                $("#main").find("div.product_item").removeClass("hot_hide");
            });

            $("#selected_only").toggle(function() {
                $(this).addClass("on");
                $("#main").find("div.product_item").not(".select").addClass("select_hide");
                }, function() {
                $(this).removeClass("on");            
                $("#main").find("div.product_item").removeClass("select_hide");
            });
        }
        
//  --- Advanced Search toggle

        function advSearch() {
        
            $("img.adv_gear_on").click(function() {
                $("div.current").slideUp("normal", function(){
                    $("div#container").addClass("adv");
                    $("div.current").slideDown("normal");
                });
            });

            $("img.adv_gear_off").click(function() {
                $("div.current").slideUp("normal", function(){
                    $("div#container").removeClass("adv");
                    $("div.current").slideDown("normal");
                });
            });
        
        }
        
      