function an_alert(txt)
{
	//alert(txt);
}

var g_home_urls = new Array("http://www.al-noisa.org", "http://al-noisa.org", "http://radio.al-noisa.org", "http://hetprogramma.al-noisa.org");

function check_home_urls(url)
{
	for (var i = 0; i < g_home_urls.length; i++)
	{
		if (url.indexOf(g_home_urls[i]) == 0)
		{
			return true;
		}
	}

	return false;
}

function goto_url(url)
{
an_alert("goto " + url);
//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_frames()
{
return;
	if (self.parent.frames.length != 0)
	{
	an_alert("self.parent.frames.length: " + self.parent.frames.length);
		goto_url(self.location.href);
	}
	else if ( !check_home_urls(top.location.href) )
	{
	an_alert("top.location.href: " + top.location.href);
		goto_url(g_home_urls[0]);
	}
}

function disableSubmitButton(form,disable)
{
	if (document.all || document.getElementById)
	{
		for (i = 0; i < form.length; i++)
		{
			var formobj = form.elements[i];
			if (formobj.type.toLowerCase() == "submit")
				formobj.disabled = disable;
		}
	}
}

function validateEmailAddress(email)
{
	var at = email.indexOf("@");
	if (at <= 0)
		return false;
	var dot = email.substring(at + 1, email.length).indexOf(".");
	if (dot < 0)
		return false;
	return true;
}

