nb_move_available = null;
current_move = 0;
next_scene_is_at_right = true;

function nextSlide(){
    next_scene_is_at_right = true;

    var initial = $('#flashscenesmagavenue .thumbs_banner li.active');
    //get the next li or loop to the beginning
    element = $(initial).next();

    if($(element).length == 0)
        element = $('#flashscenesmagavenue .thumbs_banner li:first-child');
    
    $(element).addClass('active');
    initial.removeClass('active');

    //get the thumb id
    var id = $(element).attr("id").split('scene_thumb_');
    loadScene(id[1]);
}
function prevSlide(){
    next_scene_is_at_right = false;

    var initial = $('#flashscenesmagavenue .thumbs_banner li.active');
    //get the next li or loop to the beginning
    element = $(initial).prev();

    if($(element).length == 0)
        element = $('#flashscenesmagavenue .thumbs_banner li:last-child');
    
    $(element).addClass('active');
    initial.removeClass('active');

    //get the thumb id
    var id = $(element).attr("id").split('scene_thumb_');
    loadScene(id[1]);
}

function loadScene(id_scene){
    $('#flashscenesmagavenue').find('.screen_scene:visible').fadeTo(300, 0, function(){
        $(this).hide();
        $('#flashscenesmagavenue').find('#screen_scene_' + id_scene).css('opacity', '0').show().fadeTo(500, 1);
    });
    return false;
}

function onSceneMove(){
	return true;
}

$(function () {
	/* set cluetip parameters */
	$('a.cluetip')
		.cluetip({
			local:true,
			cursor: 'pointer',
			attribute:'accesskey',
			cluetipClass: 'product_scene',
			dropShadow: false,
			dropShadowSteps: 0,
			showTitle: false,
			tracking: true,
			sticky: false,
			mouseOutClose: true,
			closeText: '',
			fx: {             
		    open:       'fadeIn',
		    openSpeed:  'fast'
		  }
		})
		.css('opacity', 0.8);
});

