//rotating thumb functions
var changing_thumbs = new Array();
function changeThumb(index, i, num_thumbs, path)
{
    if (changing_thumbs[index])
    {
        hidden_image_id = (i + 1) % num_thumbs;          
        document.getElementById(index).src = path + "110_80_" + i + ".jpg";
        document.getElementById("hidden_image").src = path + "110_80_" + hidden_image_id + ".jpg";  
        //alert(path + "110_80_" + i + ".jpg");
        i = i % num_thumbs; 
        i++;
        setTimeout("changeThumb('" + index + "'," + i + ", " + num_thumbs + ", '" + path + "')", 1000);
    }
}    
function startThumbChange(index, num_thumbs, path)
{    
    changing_thumbs[index] = true;    
    changeThumb(index, 1, num_thumbs, path);
}
function endThumbChange(index, path)
{
    changing_thumbs[index] = false;
    document.getElementById(index).src = path + "110_80_1.jpg";
}

function close_promo()
{
     document.getElementById('floatdiv').style.display = "none";
     Set_Cookie( 'promo', 'promo', 1, '/', '', '' );

}

function Set_Cookie( name, value, expires, path, domain, secure )
{
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime( today.getTime() );

    /*
    if the expires variable is set, make the correct
    expires time, the current script below will set
    it for x number of days, to make it for hours,
    delete * 24, for minutes, delete * 60 * 24
    */
    if ( expires )
    {
    expires = expires * 1000 * 60 * 60 ;
    }
    var expires_date = new Date( today.getTime() + (expires) );

    document.cookie = name + "=" +escape( value ) +
    ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
}
