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)
{
    var ver = parseInt(navigator.appVersion, 10);
cf_alert('Navigator: ' + navigator.appName + '\nVersion: ' + ver + '\n\nGoto: ' + url, 0x1);
//return;
    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_frames()
{
cf_alert('check_frames'
+ '\nself: ' + self
+ '\ntop: ' + top
+ '\nself != top: ' + (self != top), 0x2);
	var result = 0;
    if (self != top)
	{
cf_alert('check_frames'
+ '\nself.parent: ' + self.parent
+ '\ntop: ' + top
+ '\nself.parent != top: ' + (self.parent != top), 0x2);
		if (self.parent != top)
		{
			result = 1;
		}
		else
		{
cf_alert('navigator.appName: ' + navigator.appName, 0x2);
			if (navigator.appName != "Netscape")
			{
cf_alert('typeof top.location: ' + typeof top.location
+ '\ntypeof top.location.href: ' + typeof top.location.href, 0x2);
				if (   typeof top.location == "object"
					&& typeof top.location.href == "string")
				{
cf_alert('top.location.href: ' + top.location.href, 0x2);
					if (   top.location.href.indexOf("http://radio.godswil.com") != 0
						&& top.location.href.indexOf("http://radio.godswil.nl") != 0
						&& top.location.href.indexOf("http://babelfish.altavista.com/") != 0
						&& top.location.href.indexOf("http://translate.google.com/") != 0)
					{
						result = 1;
					}
				}
				else
				{
					result = 1;
				}
			}
			else
			{
				result = 1;
			}
		}
	}

	if (result)
    {
cf_alert('goto: '+ 'radio.godswil.com', 0x2);
		goto_replace_url("http://radio.godswil.com/");
    }
}

function setControl(id)
{
    var strControl = '';
    if (document.layers)
	  strControl = '<layer id="'+id+'"></layer>';
    else if (document.all || document.getElementById)
	  strControl = '<span id="'+id+'"></span>';
    document.write(strControl);
}

function getControl(id)
{
    if (document.layers)
	  return document.layers[id];
    else if (document.all && !document.getElementById)
	  return document.all[id];
    else if (document.getElementById)
	  return document.getElementById(id);
    return null;
}
