function slideSwitch()
{
var $active = $('#slideshow DIV.active');
var $totalImages = $('slideshow div.slideImages');
if ( $active.length == 0 ) $active = $('#slideshow div.slideImages:last');
var $next = $active.next().length ? $active.next()
: $('#slideshow div.slideImages:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
var indexOfActiveClass = $('#slideshow div.slideImages').index( $('.active') );
$('#slideShowPagination span').removeClass('active')
$('#slideShowPagination span:eq('+eval(indexOfActiveClass) +')').addClass('active');
});
}
var cInt;
$(function() {
// prabeen
var $totalImages = $('#slideshow div.slideImages').length;
for (var i = 1 ; i<= $totalImages ; i++ )
{
if (i == 1 )
$('#slideShowPagination').append('');
else
$('#slideShowPagination').append('');
}
cInt = setInterval( "slideSwitch()", 5000 );
});
$(document).ready(function()
{
$('span.pagination').click(function()
{
$('#slideshow div.slideImages').removeClass('active');
var _eq = $(this).html() - 1;
$('span.pagination').removeClass('active');
$(this).addClass('active');
$('#slideshow div.slideImages:eq('+ _eq +')').addClass('active');
clearInterval(cInt);
cInt = setInterval("slideSwitch()", 5000 );
});
});
$(document).ready(function(){
$(".mainNavigation li a").wrapInner("");
$(".mainNavigation li ul:last").addClass("last");
$("#slideshow div:first").addClass("active");
$('.mainNavigation li').each(function() {
$(this).hover(
function () {
$(this).find("ul").css({'display' : 'block', 'z-index' : '999'});
},
function () {
$(this).find("ul").css("display", "none");
}
);
});
$('.mainNavigation li').each(function() {
var mwidth = $(this).find("ul").width() - "20";
$(this).find("ul").find("span").css("width" , mwidth + "px");
});
});