String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

function showtab2(name)
{
	window.document.getElementById('feedback_Form').style.display = "none";
	//if (window.document.getElementById('feedback_Good') != null)
	//	window.document.getElementById('feedback_Good').style.display = "none";
	window.document.getElementById('feedback_'+name).style.display = "block";

	return false;
}

function isValidEmail(email)
{
	var regex = new RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$");
	if (!regex.test(email))
	{
		return false;
	}
	return true;
}

function validateEmail(control)
{
	var parentid = control.id.substring(0, control.id.lastIndexOf("_")+1);
	var email = window.document.getElementById(parentid+"txtEmail").value.trim();
	if (!isValidEmail(email))
	{
		alert("Please enter a valid email address.");
		return false;
	}
	return true;
}

