function renderUI(res) {  
            // enable/disable "Get Friends" button  
            var connected = (res.user != null && res.user.isConnected);  
            //document.getElementById('btnGetFriends').disabled = !connected;  
  
            // clear friend list if not connected  
            if (!connected)  
                document.getElementById('friends').innerHTML = "";  
        }  
  
        // Get the user's friends  
        function getFriends() {  
        	gigya.services.socialize.getFriendsInfo(conf, { callback: getFriends_callback });  
        }  
  
        // Use the reponse of getFriends and render HTML to display the first five friends.  
        function getFriends_callback(response) {  
            //document.getElementById('btnGetFriends').disabled = false;  
            document.getElementById('friends').innerHTML = "";  
            if (response.errorCode == 0) {  
                var array = response.friends.asArray();  
                var html = "You have " + array.length + " friends, here are a few of them:<BR/>";  
                html += "<table cellpadding=20><tr>";  
                for (var i = 0; i < Math.min(10, array.length); i++) {  
                    html += "<td align=center valign='bottom'>";  
                    if (array[i].thumbnailURL)  
                        html += "<img width='25' height='25' src='"   
                        + array[i].thumbnailURL + "' ><br>";  
                    html += array[i].nickname + "</td>";  
                }  
                html += "</tr></table>";  
                document.getElementById('friends').innerHTML = html;  
            } else {  
                alert('Error :' + response.errorMessage);  
            }  
  
        } 
