
function emailLogin (url, divID) {
	var loginDiv = document.getElementById (divID);

	if (cookie.Get ("validated")) {
		location.href = url;
	}
	else {
		loginDiv.innerHTML = "\
			<table cellpadding='0' cellspacing='0' border='0' width='434'>\
			<tr>\
				<td width='12' height='8'></td>\
				<td width='418' valign='top' style='background-repeat:no-repeat'><img src='http://www.acnepractice.com/includes/images/videoplayerHeader.gif'/></td>\
				<td width='4'></td>\
			</tr>\
			<tr>\
				<td>&nbsp;</td>\
				<td valign='top' background='http://www.acnepractice.com/includes/images/videoplayerbackground.jpg' width:350px;'>\
					<center><span class='newinquirytext'>Enter your member ID for access to refills</span></center><br/>\
					<div class='divisioninq1' style='font-family: Helvetica, Arial, sans-serif; font-size:smaller;'>\
						<form method='post' action='../bootcamp/verify_redirect.php?type=firstcontact' onsubmit='return emailCheck(this.email.value)'>\
							<input type='hidden' name='redirect' value='" + url + "'>\
							<b>\
							Your Email</span>&nbsp;<input type='text' name='email' size='30'><br>\
							Member ID</span>&nbsp;<input type='text' name='mem_id' size='30'><br>\
							</b>\
							<br>\
							<span style='padding-left:80px;'><input type='image' src='http://www.acnepractice.com/includes/images/continue.gif'/></span>\
						</form>\
					</div>\
					<span class='forgot' style='font-family: Helvetica, Arial, sans-serif; font-size:smaller;'>Forgot ID? Click <a href='javascript:emailForgotID()'>here</a></span>\
				</td>\
				<td>&nbsp;</td>\
			</tr>\
			<tr>\
				<td height='9'></td>\
				<td valign='top'><img src='http://www.acnepractice.com/includes/images/videoplayerfooter.gif'/></td>\
				<td></td>\
			</tr>\
			</table>\
		";
	}
}

function emailForgotID () {
	window.open ('http://www.theacnepractice.net/bootcamp/newinquiry.html','_blank','height=600,width=900, resizable, scrollbars');
}

function emailCheck (email){	
    var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;

    if (pattern.test (email)) {
		return true;   
    }
    else {   
    	alert ("Please enter a valid e-mail address");
		return false; 
    }
}
