function poptastic(url)
{
	newwindow=window.open(url,'name', 'height=400,width=400,location=false');
	if (window.focus) {newwindow.focus()}
}

function popadmin(url)
{
	newwindow=window.open(url,'name','height=500,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
	if (window.focus) {newwindow.focus()}
}

function checkphone(e){
	var goodphone="";
	var phone=String(e.value);
	phone=phone.replace(/[^0-9]/g,'');
	var vlen=phone.length;

	if (phone)
		{

		if (vlen=='10' && !isNaN(phone))
			{
			goodphone="("+phone.slice(0,3)+") "+phone.slice(3,6)+"-"+phone.slice(6);
			e.value=goodphone;
			}
		else
			{
			alert("The phone number you have entered is invalid. Please enter only 10 numbers including the area code.");
			globalvar = e;
			setTimeout("globalvar.focus();", 1);
			setTimeout("globalvar.select();", 1);
			}
		}
	else
		{
		e.value=phone;
		}
}

function checkemail(e){
	var email=String(e.value);
	if (email){
		if(!email.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)) {
			alert("The email address you have entered is invalid.");
			globalvar = e;
			setTimeout("globalvar.focus();", 1);
			setTimeout("globalvar.select();", 1);
		}
	}
}