tell application "iChat"
	
	activate
	
	set chat_message to {}
	
	set chat_string to ("Vuoi giocare a Big Bang " & game_name & " per Mac OS X? (Se non ce l'hai, fammelo sapere e te lo mando in un clic!)" as string)
	
	set chat_message to chat_message & chat_string
	
	set chat_message to chat_message & "Quando sei pronto per giocare, apri la chiave della partita che ti mando."
	
	repeat with j from 1 to the number of services
		repeat with i from 1 to the number of accounts of item j of services
			
			if (id of item i of accounts of item j of services as string) is equal to target_id then
				
				set user_status to status of item i of accounts of item j of services
				set user_idle to idle time of item i of accounts of item j of services
				
				if user_status is available and user_idle is 0 then
					
					repeat with k from 1 to the number of items of chat_message
						send item k of chat_message to item i of accounts of item j of services
					end repeat
					
					--send ("Big Bang " & game_name & "" as string) to item i of accounts of item j of services
					
					set frontmost to true
					
					return true
					
				end if
			end if
			
		end repeat
	end repeat
	
	return false
end tell
