

// check email

function valid_email(email)
{
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(email);
}


// cast vote

function cast_vote()
{
	var vote_url = document.getElementById('vote_options').options[document.getElementById('vote_options').selectedIndex].value;
	window.open(vote_url,'vote_window','');
}


// open window

function open_window(window_url, window_name, window_width, window_height, window_features) 
{
	switch (window_features)
	{
		case 'lyrics':
			window_features = 'toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1';
			break;
		default:
			window_features = 'toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0';
	}
	var window_settings = 'width=' + window_width + ',height=' + window_height + ',' + window_features;
	var view_window = window.open(window_url, window_name, window_settings);
	view_window.focus();
}


// print page

function print_page()
{
	if (window.print)
	{
		window.print();
	}
	else
	{
		alert("To print this page press Control-P (PC) or Command-P (Mac)")
	}
}