jQuery(document).ready(function() {
	 	
 	// Selects the first location when window loads
    jQuery('ul#location-nav a').click(function() {  
        jQuery(this).css('outline','none');  
        jQuery('ul#location-nav .current').removeClass('current');  
        jQuery(this).parent().addClass('current');
        var filterVal = jQuery(this).text().toLowerCase().replace(' ','-');  
  
        jQuery('#location > div').each(function() {  
            if(!jQuery(this).hasClass(filterVal)) {  
                jQuery(this).fadeOut(1).addClass('hidden');  
            } else {  
                jQuery(this).fadeIn(1).removeClass('hidden');  
            }  
        });  
  
		map_delay();
        return false;

    });

	// Selects the first location when window loads
	jQuery('#location-nav li a:first').trigger('click');
	
	// Adds '/' between each menu item
	jQuery('#menu-main-menu li:not(:last-child)').append("<span>/</span>");
	
	
	// Gets Google map and embeds it into a div
	function map_delay() {

		var gMapFrame = '<img src="http://ristrettoroasters.com/wp-content/themes/new-ristretto/images/preloader.gif" alt="Loading" /><iframe width="634" height="420" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?msa=0&amp;ie=UTF8&amp;vpsrc=0&amp;msid=213885408039020629494.0004a03929af669ed403d&amp;t=m&amp;ll=45.553968,-122.726898&amp;spn=0.243292,0.676346&amp;output=embed"></iframe>';

		jQuery('#map-embed').html(gMapFrame);		
	};
	
	// Removes border for the last shopping cart item
	jQuery('div.default_product_display:last').css('border-bottom','none');
	
	
});



















