$(document).ready(function() {
$('.hotspot').hover(
function() {
clearInterval(rotator);
idx = $('.hotspot').index(this);
old = $('.hotspot').index(this);
$('#hot_img').css('background-image', 'url('+ $('#hotspot_'+ idx +'_img').attr('src') +')');
$('#hot_title').attr('href', $('#hotspot_'+ idx +'_url').html());
$('#hot_title').html($('.hotspot:eq('+ idx +') > b').html());
$('#hot_text').html($('#hotspot_'+ idx +'_text').html());
$('.onfeatitem').removeClass('onfeatitem');
$(this).addClass('onfeatitem');
},
function() {
rotator = setInterval(hotspot, 3000);
}
);
all = $('.hotspot').size();
rotator = setInterval(hotspot, 3000);
$('.hotspot').click(function() { $(this).blur(); });
});
function hotspot() {
current = (old + 1) % all;
$('.hotspot:eq('+ old +')').removeClass('onfeatitem');
$('.hotspot:eq('+ current +')').addClass('onfeatitem');
idx = $('.hotspot').index($('.hotspot:eq('+ current +')'));
// alert(idx);
$('#hot_img').fadeTo('slow', 0.33, function() {
$('#hot_img').css('background-image', 'url('+ $('#hotspot_'+ idx +'_img').attr('src') +')');
$('#hot_img').fadeTo('slow', 1, function() {
});
});
$('#hot_title').attr('href', $('#hotspot_'+ idx +'_url').html());
$('#hot_title').html($('.hotspot:eq('+ idx +') > b').html());
$('#hot_text').html($('#hotspot_'+ idx +'_text').html());
old = current;
}