I suspect, though am not positive, that the Invalid window error is being generated due to the cross usage of $scid and $scon.
Thus said, and my apologies to the owner of this script, those looking for an alternative might want to consider [url=http://www.hawkee.com/snippet/5366/]this[/url