So, I am creating a flash game for Facebook. I want to ask how to set up a friend invitation dialog as follows:

I need to do something like an image:
1. Submit a life support system;
2. List of friends who used the application (game);
3. The ability to search for the exact friend;
4. Ability to select all friends by pressing 1 button;
5. List of all friends;
, Send lives system. 0 , . " ", . , , ?
" "
, ? ( ), :

:
<a href="#" onclick="FbRequest('This page is amazing, check it out!','4d5da12cbbb0');">Send Request</a>
<script type="text/javascript">
function FbRequest(message, data){
FB.ui({method:'apprequests',message:message,data:data,title:'Share this site with your friends'},
function(response){
}
);
}
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
window.fbAsyncInit = function() {
FB.init({
appId : '00000000000000',
session : {},
status : true,
cookie : true,
xfbml : true
});
};
</script>
, (50, max) ?
script, (50 ) . , "Firefox" "-" → "", .
:
javascript:elms=document.getElementsByName("checkableitems[]");for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()};
.
script php , . :
window.onload = function () {
window.onload =FbRequest('This page is amazing, check it out!','4d5da07acbbb0');
setTimeout(function() {Select()},9000);
}
function Select() {
var elms = document.getElementsByName("checkableitems[]");for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()};
}
? .