/**
 * @author Leandro Antonello
 */

// GLOBAL VARIABLES

$(document).ready( function()
{
    /*
    var screenWidth = $(document.body).width();
    var screenHeigth = $(document.body).height();

    //alert("screen sizes: "+ screenWidth +"x"+ screenHeigth);

    $('#swf-div').css({
        width: screenWidth,
        heigth: screenHeigth
    });
    */

    var token = getToken();
    var fvars = 'file=json.php&browser=true';
    var movie = "media/swf/site_v3.swf?tk=" + token + "&" + fvars;

    $('#flash').flash({
        swf: movie,
        width: '800',
        height: '500',
        scale: 'noscale',
        //wmode: 'transparent',
        allowScriptAccess: 'always',
        quality: 'high',
        menu: false,
        flashVars: fvars
    });
});

function getToken()
{
    return new Date().getTime() / 1000.0;
}

function microtime(get_as_float)
{
    var now = new Date().getTime() / 1000;
    var s = parseInt(now);

    return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
}


function getToken()
{
    var now = new Date();
    
    var hours   = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var millis  = now.getMilliseconds();
    
    return hours * minutes * seconds * millis;
}