/* General Javascript include */

function Shrink() {
    window.clearInterval(myinterval);
    myinterval = window.setInterval('PerformeScale()',50);
}
function PerformeScale() {
    currentscale += (endscale - currentscale)/2
    setFlashHeight(flashid,currentscale)
    if (currentscale <= endscale+2) { 
        window.clearInterval(myinterval);
        setFlashHeight(flashid,endscale)
    }
}
function Expand() {
    window.clearInterval(myinterval);
    myinterval = window.setInterval('PerformeScaleExpand()',50);
}
function PerformeScaleExpand() {
    currentscale += (startscale - currentscale)/2
    setFlashHeight(flashid,currentscale)
    if (currentscale >= startscale-2) { 
        window.clearInterval(myinterval);
        setFlashHeight(flashid,startscale)
    }
}
function setFlashHeight(divid, newH){
    document.getElementById(divid).style.height = newH+"px";
}


window.onload = function(){
    var boolLoggedIn = false;
    if ( typeof( window[ 'auth_uid' ] ) != "undefined" ) {
        if(auth_uid) {
            boolLoggedIn = true;
        }
    }
    if (boolLoggedIn) {            
        $('#sign_in').hide();
        $('#sign_out').show(); 
        
        $('#username').html(auth_uid);
        $('#username').attr('title', 'Show user info');
    } else {
        $('#sign_in').show();
        $('#sign_out').hide();
    }
    if(typeof onLoad == 'function'){
        onLoad();
    }
    $('#sign_in div').addClass("content");
    $('#sign_out div').addClass("content");
    $('li:has(a)').parents('ul').addClass('square');
}
