Having trouble closing a specific window

I want a script that will close windows whose name contiains different text. For example, I may have 3 windows that have differnet names, but they all contain the word “isight” in them. Rather than listing every name in the script, I wanted to make a flexible with a variable. That way, it will close all window with the contained text “isight”. This is what I have, but I am getting an error. Any ideas?

 tell application "iChat"
	set windownames to name of windows
	close (window whose windownames contains "Buddy ")
end tell 

here is an example to be simple. When a “isight” window of ichat is visible, I want to be able to close an application. But, the trick is that I have 3 windows that have different names, but all have the word “isight” in their window names. I have 3 isight camera running my security at my home, if you were wondering.

 repeat
	tell application "iChat"
		set windownames to name of windows
		if windownames contains "iSight" then
			tell application "SecuritySpy"
				quit
			end tell
		end if
	end tell
	delay 0.5
end repeat 

Thanks man!