var $=jQuery.noConflict();
var curent = 0;
var slideshowTimer = null;
function isVisible(obj) { return (obj.css('display') == 'block'); }
function doSlideshow(objid, start, time, navId){
if(!$('#' + objid) || !isVisible($('#' + objid))){
if(slideshowTimer != null){
clearTimeout(slideshowTimer);
slideshowTimer = null;
}
return;
}
if(start){
clearTimeout(slideshowTimer);
slideshowTimer = null;
}
var currObj = $('#' + objid + ' li.current');
var nextObj = currObj.next();
if($('#' + objid + ' li:last').hasClass('current')){
nextObj = $('#' + objid + ' li:first');
}
nextObj.addClass('current');
nextObj.css('opacity', 0).css('z-index','2');
currObj.removeClass('current').css('z-index','1');
currObj.animate({opacity:0}, 1200);
nextObj.animate({opacity:1}, 1200);
$('.button a').attr('href', nextObj.find('.hide').attr('href'));
if(navId != ''){
$('#' + navId + ' .'+currObj.attr('id')).removeClass('active');
$('#' + navId + ' .'+nextObj.attr('id')).addClass('active');
}
slideshowTimer = setTimeout('doSlideshow("' + objid + '", false, ' + time + ',"' + navId + '");', time);
}
$(document).ready(function () {
if ($('#slidepics LI').size() > 0){
$('#slidepics LI:last').addClass('current');
doSlideshow('slidepics', true, 5000, '');
}
});

