
$(document).ready(function(){
$('ul#MenuItemTabs li a').mouseover(function() { $(this).animate({ color: '#FFA500'},500); }).mouseout(function() { $(this).animate({ color: '#FFFFFF' },500); });

$('ul#MenuItemTabs').after('<div id="slideshowTop"><img class="active" width="970" height="190" src="/WB2.aspx?f=SempliceBlu/faro1-14082011165859-21092011091139.jpg" /></div>');
});

var imgs = ['<img width="970" height="190" src="/WB2.aspx?f=SempliceBlu/camogli3-14082011170136-21092011091148.jpg" />','<img width="970" height="190" src="/WB2.aspx?f=SempliceBlu/mare9-14082011172059-21092011091155.jpg" />','<img width="970" height="190" src="/WB2.aspx?f=SempliceBlu/pesce1-14082011171658-21092011092829.jpg" />','<img width="970" height="190" src="/WB2.aspx?f=SempliceBlu/sub1-14082011171745-21092011092835.jpg" />','<img width="970" height="190" src="/WB2.aspx?f=SempliceBlu/spiaggia6-14082011172306-21092011092841.jpg" />','<img class="active" width="970" height="190" src="/WB2.aspx?f=SempliceBlu/faro1-14082011165859-21092011091139.jpg" />'];


var cnt = imgs.length;
function Slider() { 
$('#slideshowTop').append( imgs[(imgs.length++) % cnt] );

};

$(function() { 
setInterval("Slider()", 2000); 
});

/*** 
Simple jQuery Slideshow Script
Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/
function slideSwitch() {
var $active = $('#slideshowTop img.active');

if ( $active.length == 0 ) $active = $('#slideshowTop img:last');

// use this to pull the images in the order they appear in the markup
var $next =  $active.next().length ? $active.next()
: $('#slideshowTop img:first');

// uncomment the 3 lines below to pull the images in random order

// var $sibs  = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next  = $( $sibs[ rndNum ] );


$active.addClass('last-active');

$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}

$(function() {
setInterval( "slideSwitch()", 4000 );
});
