// JavaScript Document
function slideSwitch() {
var $active = $('#mvPanel li.active');
var $next = ($active.next().length ? $active.next() : $('#mvPanel li:first'));
var $activeThumb = $('#mvThumbnail li.active');
var $nextThumb = ($activeThumb.next().length ? $activeThumb.next() : $('#mvThumbnail li:first'));
$active.fadeOut('slow').removeClass("active");
$next.fadeIn('slow').addClass("active");
$activeThumb.removeClass("active");
$nextThumb.addClass("active");

}
$(function() {
rotateSwitch = function(){
play=setInterval( "slideSwitch()", 5000 );
};
rotateSwitch();
$("#mvThumbnail a").hover(function() {
$('#mvPanel li.active').fadeOut('slow').removeClass('active');
$('#mvThumbnail li.active').removeClass('active');
var num=($(this).attr("rel"));
$($('#mvPanel li')[num]).fadeIn('slow').addClass('active');
$($('#mvThumbnail li')[num]).addClass('active');
clearInterval(play);
}, function() {
rotateSwitch(); 

});
}); 


