function validateEmail(email, msg, optional)
{
	if (!email.value && optional)
	{
		return true;
	}

	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!re_mail.test(email.value))
	{
		alert(msg);
		email.focus();
		email.select();
		return false;
	}

	return true;
}

function venueSelect(venuevalue)
{
	venue = venuevalue.options[venuevalue.selectedIndex].value;

	if (venue != ' [ Select A Venue ] ')
	{
		newpage = '/tickets/venues/' + venue;
		window.location.href = newpage;
	}
}

function launchwin(winurl,winname,winfeatures,w,h)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	//Only to be used from Flash. In all other cases, use other method.

	var newwin;

	if (screen)
	{
		leftpos = screen.width - w;
		leftpos = leftpos / 2;
		toppos = screen.height -h;
		toppos = toppos / 2;
		leftpos = Math.round(leftpos);
		toppos = Math.round(toppos);
	}

	winfeatures=winfeatures+',left='+leftpos+',top='+toppos;

	newwin = window.open(winurl,winname,winfeatures);
    newwin.focus();
}
