function validate_form(thisForm)
{
	with (thisForm)
	{
		if (validate_email(email_address, "Not a valid e-mail address!") == false)
		{
			email_address.focus(); 
			return false
		}
		else
		{
			popup(400, 170, 'thankyou.html');
			return true;
		}
	}
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
		{
		  	alert(alerttxt);
		  	return false
		}
	}
}

function checkURL(URL)
{
	if (URL.indexOf("?") > -1)
	{
		var list1 = URL.split("?");
		var list2 = list1[1].split("=");
		return list2;
	} 
}

function validate_email(field,alerttxt, flag, width, height, page)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
		{
		  	alert(alerttxt);
		  	return false
		}
		else
		{
			if (flag == true)
			{
				popup(width ,height, page);
			}
			popup('thankyou.html', 'test', 600, 180, 'no');
			return true
		}
	}
}

function validate_form(thisForm, flag, width, height, page)
{
	with (thisForm)
	{
		if (validate_email(email_address, "Not a valid e-mail address!", flag, width, height, page) == false)
		{
			email_address.focus(); 
			return false
		}
	}
}

function popup(page, pname, p_width, p_height, sbars)
{
	var w = p_width + 20;
	var h = p_height + 100;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	
	if (!sbars) sbars = "no";
	
	var page = page;//"thankyou.html";
	windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=no,"
	+ "scrollbars="+ sbars +",menubars=no,toolbars=no,resizable=no,status=yes";
	window.open(page, pname, windowprops);
}	