/**
 */
$(document).ready(function() {
  /**
   *
   */
  var navDuration            = 333;
  var navDuration2           = 272;
  var navPadding             = "0.25em";

  $('#nav li a').hover(function() {
      $(this).animate({ 
        textIndent : navPadding
      }, navDuration);            
  }, function() {
      $(this).animate({ 
        textIndent : '0'
      }, navDuration);
  });
  
  $('#sections-menu li a').hover(function() {
      $(this).animate({ 
        textIndent : navPadding
      }, navDuration2);            
  }, function() {
      $(this).animate({ 
        textIndent : '0'
      }, navDuration2);
  });
  
  /**
   * If this is the home page, turn the #page-banner images into a slideshow
   */
  /*if ($('body').attr('id') == 'home') {
    
    var hostURL = 'http://www.mmsny.org/';// http://www.mmsny.local/
    // array of image paths for preloading
    var imgPaths = new Array();
    imgPaths[0] = hostURL+'/wp-content/uploads/2009/08/default_header_photo.jpg';
    imgPaths[1] = hostURL+'/wp-content/uploads/2009/08/programs_header_photo.jpg';
    imgPaths[2] = hostURL+'/wp-content/uploads/2009/08/about_header_photo.jpg';
    imgPaths[3] = hostURL+'/wp-content/uploads/2009/08/admissions_header_photo.jpg';
    imgPaths[4] = hostURL+'/wp-content/uploads/2009/08/parents-090109.jpg';
    
    $('<img />').attr('src', imgPaths[0]);
    $('<img />').attr('src', imgPaths[1]);
    $('<img />').attr('src', imgPaths[2]);
    $('<img />').attr('src', imgPaths[3]);
    $('<img />').attr('src', imgPaths[4]);
    
    // $(function() {
      // var: set up the slideshow HTML
      var markup = '<div id="slideshow">'
      + '<img class="thumbnail thumbnail full banner" src="'+imgPaths[0]+'"><img class="thumbnail thumbnail full banner" src="'+imgPaths[1]+'"><img class="thumbnail thumbnail full banner" src="'+imgPaths[2]+'">'
      + '<img class="thumbnail thumbnail full banner" src="'+imgPaths[3]+'"><img class="thumbnail thumbnail full banner" src="'+imgPaths[4]+'">'
      + '</div>';
      
      // $('#page-banner img').remove();
      
      // replace the single static image with all of our preloaded slideshow images
      $('#page-banner img').replaceWith(markup);
      
      // create the slideshow
      $('#page-banner #slideshow').cycle({
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        easing: 'swing',
        speed: '2000'
      });
    // });
  }*/
  
  /*$('#page-banner img').css({
    'opacity' : '0'
  });
  $('#page-banner img').animate(
    {'opacity':'0'}, 
    {queue:false, duration:1000}
  ).stop().animate(
    {'opacity':'1'}, 
    {queue:false, duration:2000}
  );*/
  
});