function quoteFontSize(){
  var quote = $('.sidebar p');
  var quoteLength = quote.text().split(" ").length;
  
  if ((quoteLength >= 1) && (quoteLength < 25)){
    quote.css({ 'font-size' : '16px' })
  }
  else if ((quoteLength > 25) && (quoteLength < 56)) {
    quote.css({ 'font-size' : '14px' })
  }
  else { quote.css({ 'font-size' : '12px' }) }
}

$(document).ready(function(){
    
    if ($('div.network-schools')) {
      $("ul.side-nav li.page_item ul").parent("li").accordion({ autoHeight: false });
    } else {
      $("ul.side-nav li.page_item ul").parent("li").accordion({ active: false, autoHeight: false, collapsible: true});
    }

    
    $("ul.nav li").live("click", function(){
      if ($(this).parent('ul').hasClass('nav') && $('a', this).attr('href') != 'http://members.usinetworkschools.org/') {return false;}
    });
    
    $("ul.nav").superfish({ autoArrows:  false});
    $(".control button").live("click", function(){
      $(this).addClass("active");
    });
  $("div.carousel p").hide();
    // $("div.carousel p").fadeOut('slow');
    // $("div.carousel li").hover(
    //   function(){
    //     $(this).find('p').fadeIn('slow');
    //   },
    //   function(){
    //     $(this).find('p').fadeOut('slow');
    //   }
    // );
    
    $("div.carousel").jCarouselLite({
      btnNext: ".next",
      btnPrev: ".prev",
      auto: 4000,
      speed: 700,
      visible: 1
    });
    
    quoteFontSize();
    // $("ul.nav li ul").css({display: "none"}); // Opera Fix

    // $("ul.nav li").mouseover(function(){
    //   $(this).find('ul:first').css({visibility: "visible"}).show(268);
    // },function(){
    //   $(this).find('ul:first').css({visibility: "hidden"});
    // });


})