/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function onLoginEvent() {

    window.location.reload();

}


function onConnected(user_id) {

//    update_user_box();

}

function onNotConnected() {
 //   showdiv("fb-login");

}


function update_user_box() {
    
    var user_box = document.getElementById("fb-user");
    user_box.innerHTML = "<span>" + "Benvenuto, <fb:name uid='loggedinuser' useyou='false'></fb:name>." +
    "<fb:profile-pic uid='loggedinuser' facebook-logo='false'></fb:profile-pic>" +
    "</span>";

    FB.XFBML.Host.parseDomTree();

}


function hidediv(id) {
    //safe function to hide an element with a specified id
    if (document.getElementById) { // DOM3 = IE5, NS6
        document.getElementById(id).style.display = 'none';
    }
    else {
        if (document.layers) { // Netscape 4
            document.id.display = 'none';
        }
        else { // IE 4
            document.all.id.style.display = 'none';
        }
    }
}

function showdiv(id) {
    //safe function to show an element with a specified id

    if (document.getElementById) { // DOM3 = IE5, NS6
        document.getElementById(id).style.display = 'block';
    }
    else {
        if (document.layers) { // Netscape 4
            document.id.display = 'block';
        }
        else { // IE 4
            document.all.id.style.display = 'block';
        }
    }
}
