var cnt_artist_pics = 0;
var artists_width = 0;
var artists_xpos = 0;
var artists_move_offset = 180;
var artists_moving = false;
var current_artist = 2;

function init()
{
    cnt_artist_pics = $$('div#artists img.artists').length;
    artists_width = cnt_artist_pics * artists_move_offset + 100;
    
    
    $('artists').style.width = artists_width + 'px';
    
    if (current_artist > 2)
    {
        if (current_artist >= cnt_artist_pics)
            current_artist = cnt_artist_pics - 1;
        
        new Effect.Move('artists', {
            duration: 0.7,
            x: -((current_artist - 2) * artists_move_offset), 
            transition: Effect.Transitions.sinoidal,
            beforeStart: function()
            {
                artists_moving = true;
            },
            afterFinish: function()
            {
                artists_moving = false;
            }
        });
        
        artists_xpos -= ((current_artist - 2) * artists_move_offset);
    }
    
     


}

function moveArtistsLeft()
{
    if (artists_moving)
        return;
    
    if (artists_xpos > -artists_width + (4 * artists_move_offset))
    {
        new Effect.Move('artists', {
            duration: 0.7,
            x: -artists_move_offset, 
            transition: Effect.Transitions.sinoidal,
            beforeStart: function()
            {
                artists_moving = true;
            },
            afterFinish: function()
            {
                artists_moving = false;
            }
        });
    
        artists_xpos -= artists_move_offset;
    }
}

function moveArtistsRight()
{
    if (artists_moving)
        return;
    
    if (artists_xpos < 0)
    {
        new Effect.Move('artists', {
            duration: 0.7,
            x: artists_move_offset, 
            transition: Effect.Transitions.sinoidal,
            beforeStart: function()
            {
                artists_moving = true;
            },
            afterFinish: function()
            {
                artists_moving = false;
            }
        });
    
        artists_xpos += artists_move_offset;
    }
}


function showIllFace(left, top)
{
    $('illface').style.display = 'inline';
    $('illface').style.left = left + 'px';
    $('illface').style.top = top + 'px';
}

function hideIllFace()
{
    $('illface').style.display = 'none';
}

var sound2Embed;


