﻿$(document).ready(function() {
    // cross browser transparency for dropdown backgrounds
    $('#primary-navigation li ul').css({opacity: .8});
    $('#primary-navigation').superfish({
        autoArrows: false,
        dropShadows: false,
        hoverClass: 'hovered',
        speed: 'fast'
    });
        
    // apply an arrow on the selected or hovered primary nav item
    var sImg = $("<img src='/images/interface/selected-arrow.png' alt='' />");
    var currItem = $('#primary-navigation li.selected').not('#primary-navigation li li.selected');
    sImg.appendTo(currItem);
    
    //fire a print dialog when the print icon is clicked.
    $('#print').click(function(){
        window.print();
    });
    
    // set the height of the clients-served box to only show one row of logos
    $('#clients-served').css('height','110px');
    
    // click the trigger button and the clients-served box opens and closes
    $('#trigger').toggle(function(){
        var fullHeight = $('#clients').height();
        $('#clients-served').animate({
            height: fullHeight
        }, 500)
        $('#trigger').text("Hide").addClass("expanded");
    }, function(){
        $('#clients-served').animate({
            height: "110"
        }, 500);
        $('#trigger').text("More").removeClass("expanded");
    });
    
    // tabs
    $('#tabs,#press-releases,#in-the-news').tabs();
    
    // reduce top padding for tabs inside of tabs
    $('#press-releases,#in-the-news').css('padding-top','1px');
    
    // "uniform"
    $('select').uniform();
    
    // give some padding to the bottom of the final paragraph
    $('.pub-info:last').not('.publication-summary .pub-info:last').css("padding-bottom","20px");

    // don't use target=_blank.  use a with class new-window instead! :)
    $('a.new-window').bind(
      'click', function(e){
        e.preventDefault();
        window.open(this.href);
        return false;
      }
    );
});
