I'm currently using php to monitor ip addresses of my visitors via an ifarme as the external site I'm using can't access my mysql database....unfortunately because the php is checked in an iframe I am unable to redirect problem user to a "You are barred" page...

Can this be done with Javascript?

I'm looking for a script which:

1)Checks a users ip address...
2)Compares it to ip addresses held within the script.
If true redirect to a new page.
If false continue loading the page as it stands.

I have 3 ip addresses which need the script needs to compare against.

I can insert javascript into the page but not php

I have no understanding of Javascript and would appreciate any assistance you can offer.