function GetInviteHash(){ const hshh="hash: "; const hshe="},"; var cont=ge('content').innerHTML; var invhash=cont.substring(cont.indexOf(hshh)+hshh.length,cont.length); invhash=invhash.substring(0,invhash.indexOf(hshe)); eval('invhash='+invhash); //alert(invhash); return invhash; } function InvateMyFriend(){ Ajax.Post({ url: 'friends_ajax.php', onDone: function(ajaxObj, responseText) { friends_Data = eval('(' + responseText + ')'); my_friends.length=0; curinv=0; invcnt=0; cshag=1; each(friends_Data.friends, function(i, item) { my_friends[my_friends.length] = item[0]; }); invcnt=my_friends.length; for(i=0; i<my_friends.length; i++){ friend_pack[friend_pack.length]=my_friends[i]; if ((friend_pack.length==invinc) || (i==(my_friends.length-1))){ //alert(friend_pack.join(",")); setTimeout('Ajax.Post({url: "groups_ajax.php?act=a_invite_friends", query: {friends: "'+friend_pack.join(",")+'", gid: ge("mid").value, hash: GetInviteHash()}, onDone: InviteProc});',1500*cshag); cshag++; friend_pack.length=0; } } } }); }