jQuery().ready(function(){
  jQuery('#under_navigate').accordion({
    active: false,
    navigation: true,
    event: 'mouseover',
    autoheight: false,
    animated: 'easeslide',
    header: '.head',
    selectedClass: 'menuactive'
  });
});

jQuery().ready(function(){
  jQuery('#under_our_news').accordion({
    active: false,
    navigation: true,
    event: 'mouseover',
    autoheight: true,
    animated: 'easeslide',
    header: 'dt'
  });
});

jQuery().ready(function(){
  jQuery('#under_our_career').accordion({
    active: false,
    navigation: true,
    event: 'mouseover',
    autoheight: true,
    animated: 'easeslide',
    header: 'dt'
  });
});

jQuery().ready(function(){
  jQuery('#under_our_rss').accordion({
    active: false,
    navigation: true,
    event: 'mouseover',
    autoheight: true,
    animated: 'easeslide',
    header: 'dt'
  });
});

function toggleLoginForm(loginForm) {
  if (loginForm.style.display == 'none') {
    new Effect.BlindDown(loginForm, {duration:0.5}); return false;
  }
  else {
    new Effect.BlindUp(loginForm, {duration:0.5}); return false;
  }
}

/* client testimonials */
getTestimonials = function () {  
  t = setTimeout('getIt()', 5000);      
}
getIt = function () {
  jQuery.get('phpinclude/getNextTestimonial.php', null, showIt);
}
function showIt (data) {
  jQuery('#testimonial').html(data);
  getTestimonials();
}
jQuery().ready(getIt);
/* end client testimonials */

/* slideshow */
var images = new Array();

var imageIndex = 1;

var imgPreloader = new Image();

var img;

function slideshow() {

  img = document.getElementById('slideshow_image');

  imgPreloader.src = images[0];

  imgPreloader.onload = swapImage;

  var te = setInterval('preloadImage()', 7000);

}



function preloadImage() {

  imgPreloader.src = images[imageIndex];

  imageIndex ++;

  if (imageIndex == images.length) imageIndex = 0;

}


function swapImage() {

  new Effect.Fade('slideshow_image', {

    duration: 0.5,

    afterFinish: function() {

      $('slideshow_image').src = imgPreloader.src;

      new Effect.Appear('slideshow_image', {duration:1});

    }

  });


}

window.onload = slideshow;
