Simple JQuery working in some areas, not in others
<p>After I added a slideshow to the site I am working on, some web components that use Jquery stopped working. However the newly added slideshow that also uses JQuery works as expected. </p>

<p>After some debugging, I found out exactly what JQuery is working and what isn't from the code below. I added a comment to my code to indicate that point.</p>

<p>I am importing my jquery library in the header and the code below is the last code before the closing <code>&lt;body&gt;</code> tag. </p>

<pre><code>&lt;!--SLIDESHOW--&gt;    
    $(document).ready(function() {
        var options = {};

        if (document.location.search) {
            var array = document.location.search.split('=');
            var param = array[0].replace('?', '');
            var value = array[1];

            if (param == 'animation') {
                options.animation = value;
            }
            else if (param == 'type_navigation') {
                if (value == 'dots_preview') {
                    $('.border_box').css({'marginBottom': '40px'});
                    options['dots'] = true;
                    options['preview'] = true;
                }
                else {
                    options[value] = true;
                    if (value == 'dots') $('.border_box').css({'marginBottom': '40px'});
                }
            }
        }

        $('.box_skitter_large').skitter(options);

        // Highlight
        $('pre.code').highlight({source:1, zebra:1, indent:'space', list:'ol'});

           //**** everything above works, everything below this point does not! ****/
        $(".expandButton").click(function(ev){
            $(ev.target).closest(".company-container").find(".expand").css("height", "140px");
            $(ev.target).closest(".company-container").find(".expand").toggle("fast");
        });         
        $(".emailLink, .email-popup").click(function(e){
            e.stopPropagation();
            $(e.target).closest(".company-container").find(".expand").css("height", "140px");
            $(e.target).closest(".company-container").find(".email-popup").show("fast");
            $(e.target).closest(".company-container").find(".phone-popup").hide();
            $(e.target).closest(".company-container").find(".address-popup").hide();
        });
        $(".addressLink, .address-popup").click(function(e){
            e.stopPropagation();
            $(e.target).closest(".company-container").find(".expand").css("height", "550px");
            $(e.target).closest(".company-container").find(".address-popup").show("fast");
            var address = $(e.target).closest(".company-container").find(".address").html(); //get address text
            if(!($(e.target).closest(".company-container").find(".map").length)){ //check if it was loaded
                $(e.target).closest(".company-container").find(".address-popup").html('&lt;iframe class="map" style="margin-top:45px;" width="575" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q='+ address +' &amp;amp;aq=&amp;amp;ie=UTF8&amp;amp;hq=&amp;amp;hnear='+address+'&amp;amp;t=m&amp;amp;z=14&amp;amp;iwloc=A&amp;amp;output=embed"&gt;&lt;/iframe&gt;'); 
            }
            $(e.target).closest(".company-container").find(".email-popup").hide();
            $(e.target).closest(".company-container").find(".phone-popup").hide();
        });
        $(".phoneLink, .phone-popup").click(function(e){
            e.stopPropagation();
            $(e.target).closest(".company-container").find(".expand").css("height", "140px");
            $(e.target).closest(".company-container").find(".phone-popup").show("fast");
            $(e.target).closest(".company-container").find(".email-popup").hide();
            $(e.target).closest(".company-container").find(".address-popup").hide();
        });
        $(document).click(function(e) {
             if (!(e.target.class === "email-popup" || e.target.class === "phone-popup")) {
                $(".email-popup, .phone-popup, .address-popup").hide("fast");                
             }
             $(".expand").css("height","140px");
        });     
        $(".tagKeyword").hover(function(){
            $(this).css("background-color","#fff");
            $(this).css("color","blue");
            $(this).css("box-shadow","none");
        });
        $(".tagKeyword").mouseleave(function(){
            $(this).css("background-color","#eee");
            $(this).css("color","#556");
            $(this).css("box-shadow","1px 1px 2px #ccc");
        });
        $(".search-container").hover(function(){
            $(".search-container").css("background","url(./images/menu/menu-middle.png)");
        });
        $(".searchfield").Watermark("search");
    });
</code></pre>
