$(function(){

    $(".jq-ui").button();
        
   var url = window.location.pathname, 
        urlRegExp = new RegExp(url.replace(/\/$/,'') + "$"); // create regexp to match current url pathname and remove trailing slash if present as it could collide with the link in navigation in case trailing slash wasn't present there
        // now grab every link from the navigation
        $('div#sidebar nav#section a, section#account-menu nav a').each(function(){
            // and test its normalized href against the url pathname regexp
            if(urlRegExp.test(this.href.replace(/\/$/,''))){
                $(this).addClass('curpage');
            }
        });
    
    $(".newsletter_pop").click(function(){
        
        $( "#mc_embed_signup" ).dialog({ 
            width: 500, 
            title: 'Hugo Naturals Newsletter Signup',
        });
    });
    
    $(".csc_pop").click(function(){
        
        $( "#card-csc" ).dialog({ 
            width: 300, 
            title: 'Credit Card CSC Location'
        });
    });
    

});
