$(document).ready(function(){  
     /*Since all the tabs are hidden with css we are displaying the tab with class .active_tab using fadeIn() 
     function. If you just want it to show with no effect, just put show() instead of fadeIn() */  
    $('.active').fadeIn();  
  
    //when a subnav link is clicked...  
    $('#subNav a').live('click', function(event){  
  
        /*...prevent the default behaviour...*/  
        event.preventDefault();  
  
        /* ...remove the "selected" class from current active link... */  
        $('#subNav .selected').removeClass('selected');  
  
        /* ...and add it to the new active link */  
        $(this).addClass('selected');  
  
        /*...get the href attribute */  
        var container_id = $(this).attr('href');  
  
        //...animate the current sewction by changing it's height and opacity ...'  
        $('.active').animate({  
  
            opacity : 'toggle'  
  
        //...and when that animation ends...  
        },function(){  
  
            //...remove the "active" class from the current active tab...  
            $(this).removeClass('active');  
  
            //...and add that class to the section that corensponds the clicked link...  
            $(container_id).addClass('active');  
  
            //...and animate the new section by using toggle on height and opacity again...  
            $('.active').animate({  
  
                opacity : 'toggle'  
  
            });  
        });  
  
    });
		
		var options = {  
			zoomType: 'innerzoom',  
      preloadImages: true,
			alwaysOn: false
    };
		
		$('.MapZoom').jqzoom(options);
});

// Add "selected" class to the main nav link that is acrtive.
$(function(){
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
		$('#mainNav a').each(function(){
				// and test its normalized href against the url pathname regexp
				if(urlRegExp.test(this.href.replace(/\/$/,''))){
						$(this).addClass('selected');
				}
		});

});
