 
//---------------------------------+
//  Developed by Roshan Bhattarai 
//  Visit http://roshanbh.com.np for this script and more.
//  This notice MUST stay intact for legal use
// ---------------------------------
$(document).ready(function()
{
  $(".menu_body:eq(0)").show();
  //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
  $("#firstpane p.menu_head").click(function()
  {
    lastBlock = $("#a1");
    maxHeight = 200;
    minHeight = 30;

    $(this).css({backgroundImage:"url(img/down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
    $(this).siblings().css({backgroundImage:"url(img/left.png)"});
  });
  //slides the element with class "menu_body" when mouse is over the paragraph
  $("#secondpane p.menu_head").mouseover(function()
  {
    $(this).css({backgroundImage:"url(img/down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
    $(this).siblings().css({backgroundImage:"url(img/left.png)"});
  });

   setInterval( "slideSwitch()", 5000 );
});

function slideSwitch() {
  var $active = $('#slideshow .slide.active');
  if ( $active.length == 0 ) $active = $('#slideshow .slide:last');
  var $next = $active.next().length ? $active.next() : $('#slideshow .slide:first');
  $active.addClass('last-active');
  $next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 2000, function() {
    $active.removeClass('active last-active');
  });
}
