var g_home_urls = new Array("http://dj.godswil.com", "http://dj.godswil.nl");

// Check frames

var cf_mask = 0x0;

function cf_alert(txt, mask)
{
  if (typeof(mask) != "undefined" && mask != null && (mask & cf_mask) != 0)
  {
    alert(txt);
  }
}

function goto_replace_url(url)
{
cf_alert('exit');
//return;
    var ver = parseInt(navigator.appVersion, 10);
    if (    ((navigator.appName == "Netscape") && (ver >= 3))
         || ((navigator.appName == "Microsoft Internet Explorer") && (ver >= 4)) )
	{
      top.location.replace(url);
    }
	else
	{
      self.open(url, "_top", "", false);
    }
}

function check_home_urls()
{
  for (var i = 0; i < g_home_urls.length; i++)
  {
    if (top.location.href.indexOf(g_home_urls[i]) == 0)
	{
	  return 0;
	}
  }

  return -1;
}

function check_frames(nr_frames)
{
cf_alert('check_frames ' + self.location.href + '\n\nnr_frames: ' + nr_frames + '\nself.parent: ' + self.parent + '\ntypeof self.parent: ' + typeof(self.parent) + '\nself.parent.frames.length: '+ self.parent.frames.length, 0x4);
if (navigator.appName != "Netscape")
{
  cf_alert('check_frames ' + self.location.href + '\n\ntop.location: ' + top.location + '\ntypeof top.location: ' + typeof(top.location) + '\ntypeof top.location.href: ' + typeof(top.location.href), 0x8);
}
    if (   typeof self.parent == "undefined"
        || self.parent.frames.length != nr_frames
		|| typeof top.location == "undefined"
		|| (   navigator.appName != "Netscape"
			&& typeof top.location.href != "string"
			&& typeof top.location.href != "unknown")
		|| (   navigator.appName != "Netscape"
			&& typeof top.location.href == "string"
			&& check_home_urls() != 0
			&& top.location.href.indexOf("http://babelfish.altavista.com/") != 0
			&& top.location.href.indexOf("http://translate.google.com/") != 0))
    {
cf_alert('goto: '+ g_home_urls[0], 0x2);
		goto_replace_url(g_home_urls[0]);
    }
}

check_frames(0);
