function email_password() {
	windowprops = "top=0,left=300,width=500,height=350,resizable=yes,scrollbars=yes";
	url = "/wisconsindellsvacation/plannerforgotpassword.cfm";
	window.open(url, "emailpassword", windowprops);
}
function validate_login(form){
	var alertmsg = "";
	mailExp = /^[a-z0-9][a-z_\-0-9\.\-]+@[a-z_\-0-9\.]+\.[a-z]{2,4}$/i;	
	if (form.email.value == ""){
		alertmsg = alertmsg + "Please enter your Email Address!\n";
	}
	else if (!mailExp.test(form.email.value)){
		alertmsg = alertmsg + "Please enter a valid Email Address\n";
	}
	if (form.password.value == ""){
		alertmsg = alertmsg + "Please enter your Password!\n";
	}
	if (alertmsg == ""){
		return true;
	}
	else {
		alert(alertmsg);
		return false;
	}
}
function validate_register(form){
	
	var alertmsg = "";
	
	if (form.firstname.value == ""){
		alertmsg = alertmsg + "Please enter your First Name.\n";
	}
	if (form.lastname.value == ""){
		alertmsg = alertmsg + "Please enter your Last Name.\n";
	}

	mailExp = /^[a-z0-9][a-z_\-0-9\.\-]+@[a-z_\-0-9\.]+\.[a-z]{2,4}$/i;	
	if (form.email.value == ""){
		alertmsg = alertmsg + "Please enter your Email Address.\n";
	}
	else if (!mailExp.test(form.email.value)){
		alertmsg = alertmsg + "Please enter a valid Email Address\n";
	}
	else if (form.confirm_email.value == ""){
		alertmsg = alertmsg + "Please enter your Confirmed Email Address\n";
	}
	else if (form.confirm_email.value != form.email.value){
		alertmsg = alertmsg + "Email Address and Confirm Email Address are not the same\n";
	}
	if (form.passwd.value == ""){
		alertmsg = alertmsg + "Please enter your Password.\n";
	}
	else if (form.confirm_passwd.value == ""){
		alertmsg = alertmsg + "Please enter your Confirmed Password\n";
	}
	else if (form.confirm_passwd.value != form.passwd.value){
		alertmsg = alertmsg + "Password and Confirm Password are not the same\n";
	}
	else if (form.passwd.value.length < 6){
		alertmsg = alertmsg + "Password must be at least 6 characters long\n";
	}

	if (alertmsg == ""){
		return true;
	}
	else {
		alert(alertmsg);
		return false;
	}
}
function print_itinerary(tripid){
	windowprops = "top=0,left=0,width=800,height=600,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes";
	url = "plannerPrint.cfm?tripid=" + tripid;
	window.open(url, "_blank", windowprops);
}
function remove_itinerary(tripid){
	if(confirm("Are you sure you want to remove this itinerary?")){
		location.href="plannerView.cfm?action=remove_all&tripid=" + tripid;
	}
}
function remove_member(tripid,MemberCode){
	if(confirm("Are you sure you want to remove this business from your itinerary?")){
		location.href="plannerView.cfm?action=remove&MemberCode=" + MemberCode + "&tripid=" + tripid;
	}
}

