$(function(){

    // fix PNGs in IE
    if($.browser.msie && ($.browser.version.substr(0,2)=="5." || $.browser.version.substr(0,2)=="6.") ){
        $('img, #intro, .close').ifixpng();
    }
    
    //Expanding text
    /*
    if ($('body').hasClass('contact')) {
        $('.item-more').after('<p class="hook"><a href="javascript:void(0);" class="read-more">Hide details</a></p>');
        $('p.hook a').click(function() {
            if ($(this).text() == 'Expand details') {
                $(this).text('Hide details');
                $(this).addClass('close');
                $(this).parent().prev().slideDown();
            }
            else {
                $(this).text('Expand details');
                $(this).parent().prev().slideUp();
            }
        });
    }
    */
         $(".map a").overlay({
                expose: {
                        color: '#333',
                        loadSpeed: 200,
                        opacity: 0.9
                },
        onBeforeLoad: function () {
                        $('#showmap img').hide();
                },
        // when overlay is opened, load our map
        onLoad: function() {
                        var imgurl = this.getTrigger().attr('href');
                        $('#showmap img').attr('src', imgurl);
        }
        });
    
        $('#showmap img').load(function(){$(this).show();});


        
        $("ul#primary_nav ul").show();
        $("ul#primary_nav").supersubs({ 
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason.
        /**/
});

