// JavaScript Document
// hover effect
var $SL = jQuery.noConflict();
$SL(document).ready(function() {
  $SL('div.demo-show h3').add('div.demo-show2 h3').hover(function() {
    $SL(this).addClass('hover');
  }, function() {
    $SL(this).removeClass('hover');
  });
});

// independently show and hide
$SL(document).ready(function() {
  $SL('div.demo-show:eq(0) > div').hide();  
  $SL('div.demo-show:eq(0) > h3').click(function() {
    $SL(this).next().slideToggle('fast');
  });
});

// one showing at a time

$SL(document).ready(function() {
  $SL('div.demo-show:eq(1) > div:gt(0)').hide();  
  $SL('div.demo-show:eq(1) > h3').click(function() {
    $SL(this).next('div:hidden').slideDown('fast')
    .siblings('div:visible').slideUp('fast');
  });
});


//simultaneous showing and hiding

$SL(document).ready(function() {
  $SL('div.demo-show2:eq(0) > div').hide();
  $SL('div.demo-show2:eq(0) > h3').click(function() {
    $SL(this).next('div').slideToggle('fast')
    .siblings('div:visible').slideUp('fast');
  });
});

//queued showing and hiding
$SL(document).ready(function() {
  $SL('div.demo-show2:eq(1) > div').hide();  
  $SL('div.demo-show2:eq(1) > h3').click(function() {
    var $SLnextDiv = $SL(this).next();
    var $SLvisibleSiblings = $SLnextDiv.siblings('div:visible');

    if ($SLvisibleSiblings.length ) {
      $SLvisibleSiblings.slideUp('fast', function() {
        $SLnextDiv.slideToggle('fast');
      });
    } else {
       $SLnextDiv.slideToggle('fast');
    }
  });
});


