var MAESTRO = {
  layout: {
    init: function() {
      // IE6 .png fix
            $('#header').supersleight({
                shim: '/images/blank.gif'
            });       
                        
            // font replacement
            Cufon.replace('#main h1');
            Cufon.replace('.nav a, .subnav a, #footer a', {
                hover: true
            });
            
            // get IE to behave
            Cufon.now();
            
            // set sidebar height to equal main col height
            MAESTRO.utilities.equal_height('#sidebar', '#main');
            
            // open links in new windows
            $('a.external').click(function() {
                window.open(this.href);
                return false;
            });
            
            // make red bullets for sidebar
            var $lis = $('#sidebar li').addClass('red-bullet');
            $lis.wrapInner('<span class="black-text">');

    }
  },
  
  careers: {
    init: function() {
      $('#open-positions').accordion({
        autoHeight: false,
        collapsible: true,
        active: false,
        icons: {
          'header': 'plus-sign',
          'headerSelected': 'minus-sign'
        }
      });
      
      
      $('.ui-accordion').bind('accordionchange', function(event, ui) {  
      }); 
    },
    
    application: function() {
      // send AJAX request to Sinatra app
      // respond with either errors or success message
      // $('input[type!="submit"], select').addClass('error-input');
      // $('input[type="submit"]').click(function() {
      //   var job_title = $('input#job_title')
      //   var first_name = 
      //   var last_name =
      //   var email = 
      //   var primary_phone =
      //   var alt_phone =
      //   var cover_letter =
      //   var resume =
      //   $.post('/careers/apply', function(data) {
      //     $('.notification').text(data);
      //   });
      // });
    }
  },
  
  utilities: {
    equal_height: function(target, reference) {
      var highest = Math.max($(reference).height(), $(target).height());
      $(target).height(highest);
    }
  }
  
};
