#!/usr/bin/perl



require "config.idx";



$long = $ENV{'QUERY_STRING'};

if ($long) {
	@pairs=split(/&/,$long);
	foreach $item(@pairs) {
		($name,$content)=split (/=/,$item,2);
		$content=~tr/+/ /;
		$content=~ s/%(..)/pack("c",hex($1))/ge;
		if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$content; }
		else { $INPUT{$name} = $content; }
	}
}
else {
	read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
	@pairs = split(/&/, $buffer);
	foreach $pair (@pairs) {
		($name, $value) = split(/=/, $pair);
		$value =~ tr/+/ /;
		$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
		if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; }
		else { $INPUT{$name} = $value; }
	}
}





$d_name = "muncieml_db1";
$d_username = "muncieml_db1";
$d_pass = "\@rockdb1";



if ($INPUT{action} eq "register") { &register; }
else { &main; }


sub register {

#########################################
### Run Checks  #########################
#########################################

if ($INPUT{Accepted} eq "") {
$checkaccept = "You Must Accept The Terms To Register!";
}

if ($INPUT{UserType} eq "") {
$checkUserType = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}

if ($INPUT{FirstName} eq "") {
$checkFirstName = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}

if ($INPUT{LastName} eq "") {
$checkLastName = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}

if ($INPUT{Email} eq "") {
$checkEmail = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}

if ($INPUT{Password} eq "") {
$checkPassword = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}

if ($INPUT{email_block} eq "") {
$checkemail_block = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}

if ($INPUT{email_openhouses} eq "") {
$checkemail_openhouses = "&nbsp;&nbsp;&nbsp;<font color=\"red\" size=\"2\"><b>Required</b></font>";
}



use Mail::CheckUser qw(check_email last_check);
$Mail::CheckUser::Timeout = 5;
$Mail::CheckUser::Sender_Addr = 'myhomes@munciemls.com';
$Mail::CheckUser::Helo_Domain = 'www01.idxnow.com';
if (check_email($INPUT{Email})) {
}
else {
$messagewindow = "E-Mail Address $INPUT{Email} Is Not Valid: " . last_check()->{reason};
&main;
exit 0;
}


unless ($INPUT{FirstName} && $INPUT{LastName} && $INPUT{Email} && $INPUT{Password} && $INPUT{Accepted} && $INPUT{UserType}) {
print "Content-type: text/html\n\n";
$messagewindow = "You Left Off Required Fields!";
&main;
exit 0;
}



#########################################
### End Run Checks  #####################
#########################################

use DBI;
my $dsn = "DBI:mysql:database=$d_name;host=localhost";
my $dbh = DBI->connect($dsn, $d_username, $d_pass, {RaiseError => 1}) || die $DBI::errstr;
my $hasth = $dbh->prepare("select email from users where email = '$INPUT{Email}'");
$hasth->execute;
while (($email) = $hasth->fetchrow_array()) {
print "Content-type: text/html\n\n";
$messagewindow = "The User $INPUT{Email} Is Already Registered!  If You Lost Your Password You May <a href=\"lostpassword.idx?Email=$INPUT{Email}\">Retrieve It Here</a>!";
&main;
exit 0;
}

$INPUT{Email} =~ s/\"/CHR2/gi;
$INPUT{Email} =~ s/\'/CHR1/gi;
$INPUT{FirstName} =~ s/\"/CHR2/gi;
$INPUT{FirstName} =~ s/\'/CHR1/gi;
$INPUT{LastName} =~ s/\"/CHR2/gi;
$INPUT{LastName} =~ s/\'/CHR1/gi;
$new_firstname = ucfirst(lc($INPUT{FirstName}));
$new_lastname = ucfirst(lc($INPUT{LastName}));
$INPUT{Address} =~ s/\"/CHR2/gi;
$INPUT{Address} =~ s/\'/CHR1/gi;
$INPUT{City} =~ s/\"/CHR2/gi;
$INPUT{City} =~ s/\'/CHR1/gi;
$INPUT{State} =~ s/\"/CHR2/gi;
$INPUT{State} =~ s/\'/CHR1/gi;
$INPUT{Zip} =~ s/\"/CHR2/gi;
$INPUT{Zip} =~ s/\'/CHR1/gi;
$INPUT{Password} =~ s/\"/CHR2/gi;
$INPUT{Password} =~ s/\'/CHR1/gi;
$INPUT{TimeToMove} =~ s/\"/CHR2/gi;
$INPUT{TimeToMove} =~ s/\'/CHR1/gi;
$INPUT{realtor} =~ s/\"/CHR2/gi;
$INPUT{realtor} =~ s/\'/CHR1/gi;
$INPUT{FoundBy} =~ s/\"/CHR2/gi;
$INPUT{FoundBy} =~ s/\'/CHR1/gi;
$INPUT{UserType} =~ s/\"/CHR2/gi;
$INPUT{UserType} =~ s/\'/CHR1/gi;
$INPUT{myERAAgent} =~ s/\"/CHR2/gi;
$INPUT{myERAAgent} =~ s/\'/CHR1/gi;
$INPUT{Phone} =~ s/\"/CHR2/gi;
$INPUT{Phone} =~ s/\'/CHR1/gi;

#########  CHECK TO SEE IF THEY REALLY SELECTED A REALTOR OR NOT AND CHANGE IF THEY DID ####################

$inputrealtor = "$INPUT{myERAAgent}";

if ($inputrealtor ne "") {
$inputrealtor = "Yes";
}

###########################################################################################################

$oasth = $dbh->do("insert into users values ('','$INPUT{Email}',PASSWORD('$INPUT{Password}'),'$new_firstname','$new_lastname','$INPUT{Address}','$INPUT{City}','$INPUT{State}','$INPUT{Zip}','$INPUT{TimeToMove}','$inputrealtor',now(),now(),'$INPUT{FoundBy}','$INPUT{UserType}','$INPUT{myERAAgent}','$INPUT{Phone}','','','','y','$INPUT{email_openhouses}')");

my $pasth = $dbh->prepare("select last_insert_id()");
$pasth->execute();
while (($lastnumber) = $pasth->fetchrow_array()) {
$thelastnumber = $lastnumber;
}






if ($INPUT{realtor} eq "No") {

my $yasth = $dbh->prepare("select mlsid from agents where leadsystem = 'Enrolled' and display = '1' ORDER BY RAND() limit 1");
$yasth->execute;
	while (($agent_mls_id) = $yasth->fetchrow_array()) {
	$assigned_to_who = $agent_mls_id;
	}
	$assigned_to_who = "notassigned" unless $assigned_to_who;
}
else {
$assigned_to_who = $INPUT{myERAAgent};
}

$fasth = $dbh->do("insert into leadtracking values ('$thelastnumber','','','','','','','$assigned_to_who','','','')");

$dbh->disconnect();


open(MAIL,"|/usr/sbin/sendmail -t");
print MAIL "To: $INPUT{Email}\n";
print MAIL "From: info\@eagle-online.com\n";
print MAIL "Subject: $INPUT{FirstName}, Welcome To MuncieMLS.com!\n";
print MAIL "Content-type: text/html\n\n";
print MAIL qq~
<html>
<head>
<title>E-Mailer</title>
<link rel="stylesheet" TYPE="text/css" href="http://www.munciemls.com/includes/style.css">
</head>
<body bgcolor="white" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0">
<br><br>
<center>
<table border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td valign="top" width="600">
<img src="http://www.munciemls.com/images/emailheader.gif"><br>
<table border="0" cellspacing="0" cellpadding="15" width="100%">
<tr>
<td valign="top" width="100%">
<font size="2">
$new_firstname $new_lastname,<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thank you for registering at www.MuncieMLS.com!<br><br>
<b>Your login information for future reference is</b><br>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><b>E-Mail</b></td>
<td>$INPUT{Email}</td>
</tr>
<tr>
<td><b>Password</b></td>
<td>$INPUT{Password}</td>
</tr>
</table>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With your newly created MuncieMLS.com MyHomes account, you have access to all residential, commercial, investment, and land for sale currently listed within the cooperating brokers of the Mid-Eastern Indiana Association Of REALTORS IDX exchange program!  You may also save searches and receive daily email notifications of new or updated listings that meet your saved search criteria.  If you find a certain property and you wish to keep it to view it at later you can save it directly into your MyHomes account and even create a note for later reference!<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Eagle Real Estate, Inc. looks forward to serving you.    If at anytime you have questions or comments regarding the use of MuncieMLS.com please email info\@eagle-online.com.<br><br><br>
</font>
</td>
</tr>
</table>
<img src="http://www.munciemls.com/images/emailfooter.gif"><br><br><br>
</td>
</tr>
</table>
</center>
</body>
</html>
~;
close(MAIL);

$send_body =qq~
<html>
<head>
<title>E-Mailer</title>
<link rel="stylesheet" TYPE="text/css" href="http://www.munciemls.com/includes/style.css">
</head>
<body bgcolor="white" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0">
<br><br>
<center>
<table border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td valign="top" width="600">
<img src="http://www.munciemls.com/images/emailheader.gif"><br>
<table border="0" cellspacing="0" cellpadding="15" width="100%">
<tr>
<td valign="top" width="100%">
<font size="2">
$new_firstname $new_lastname,<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thank you for registering at www.MuncieMLS.com!<br><br>
<b>Your login information for future reference is</b><br>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><b>E-Mail</b></td>
<td>$INPUT{Email}</td>
</tr>
<tr>
<td><b>Password</b></td>
<td>$INPUT{Password}</td>
</tr>
</table>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With your newly created MuncieMLS.com MyHomes account, you have access to all residential, commercial, investment, and land for sale within the Mid-Eastern Indiana Association Of REALTORS!  You may also save searches and receive daily email notifications of new or updated listings that meet your saved search criteria.  If you find a certain property you wish to keep to look at later you can save it directly into your MyHomes account and even create a note for later reference!<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Eagle Real Estate, Inc. looks forward to serving you.    If at anytime you have questions or comments regarding the use of MuncieMLS.com please email info\@eagle-online.com.<br><br><br>
</font>
</td>
</tr>
</table>
<img src="http://www.munciemls.com/images/emailfooter.gif"><br><br><br>
</td>
</tr>
</table>
</center>
</body>
</html>
~;

######## RECORD COPY OF EMAIL IN DATABASE #################
@evariables = ("$thelastnumber","info\@eagle-online.com","Registration -> $new_firstname, Welcome To MuncieMLS.com!","$send_body");
$esql_query = "INSERT INTO emailstousers values ('',?,now(),?,?,?)";
my $zzaasth = $dbh->do($esql_query, undef, @evariables);
###########################################################

print "Set-cookie: userid=$thelastnumber\-$INPUT{Email}\n";
print "Content-type: text/html\n\n";
if ($INPUT{referrer}) {
print qq~
<html><head><title>Logging in...</title>
<meta http-equiv="Refresh" content="2; URL=http://$INPUT{referrer}.MuncieMLS.com">
</head>
<body>
<br><br><br><center><font face=verdana size=4>Logging in...</font><br><font face=Tahoma size=2>If you are not redirected in 5 seconds, <a href="myhomes.idx">click here</a>.
~;
}
else {
print qq~
<html><head><title>Logging in...</title>
<meta http-equiv="Refresh" content="2; URL=http://www.munciemls.com/myhomes.idx">
</head>
<body>
<br><br><br><center><font face=verdana size=4>Logging in...</font><br><font face=Tahoma size=2>If you are not redirected in 5 seconds, <a href="myhomes.idx">click here</a>.
~;
}
$dbh->disconnect();

}


sub main {

if ($INPUT{FoundBy}) {
$buildFoundBy = "<option value=\"$INPUT{FoundBy}\">$INPUT{FoundBy}</option>";
}

if ($INPUT{UserType}) {
$buildUserType = "<option value=\"$INPUT{UserType}\">$INPUT{UserType}</option>";
}

if ($INPUT{Accepted}) {
$buildAccepted = " checked";
}

if ($INPUT{TimeToMove}) {
$buildTimeToMove = "<option value=\"$INPUT{TimeToMove}\">$INPUT{TimeToMove}</option>";
}

unless ($INPUT{State}) {
$getstateselected = "selected";
}

if ($INPUT{State}) {
$getstate = "<option value=\"$INPUT{State}\" selected>$INPUT{State}</option>";
}

if ($INPUT{realtor} eq "Yes") {
$checkYesrealtor = " checked";
}
else {
$checkNorealtor = " checked";
}


unless ($INPUT{myERAAgent} ne "") {
$checkYesrealtor = " checked";
}

if ($INPUT{email_block} eq "Yes") {
$checkYesemail_block = " checked";
}
else {
$checkNoemail_block = " checked";
}

if ($INPUT{email_openhouses} eq "Yes") {
$checkYesemail_openhouses = " checked";
}
else {
$checkNoemail_openhouses = " checked";
}

if ($INPUT{myERAAgent}) {
$buildmyERAAgent = "<option value=\"$INPUT{myERAAgent}\">$INPUT{myERAAgent}</option>";
}

print "Content-type: text/html\n\n";

use DBI;
my $dsn = "DBI:mysql:database=$d_name;host=localhost";
my $dbh = DBI->connect($dsn, $d_username, $d_pass, {RaiseError => 1}) || die $DBI::errstr;
my $zasth = $dbh->prepare("select mlsid,firstname,lastname from agents where display = '1' order by lastname asc");
$zasth->execute;
while (($mlsid,$firstname,$lastname) = $zasth->fetchrow_array()) {
$agentbuildlist .= "<option value=\"$mlsid\">$lastname, $firstname</option>\n";
}

print qq~
<html>
<head>
<title>Muncie Indiana MLS Property Search - Residential, Commercial, Investment, Lots & Land - Eagle Real Estate & Auctions Inc.</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="description" CONTENT="MuncieMLS.com Online MLS Property Search Throughout East Central Indiana.  Albany, Eaton, Muncie, New Castle, Yorktown, Gaston, Redkey, Dunkirk, Parker City, Farmland, Selma, Hartford City, Cowan, Daleville, Chesterfield.  Looking to browse homes throughout east central indiana or contact an agent?  Visit us anytime 24 hours a day, 7 days a week.  We are "Always There For You!"   We specialize in residential, commercial, condominiums, and subdivison development throughout east central Indiana.">
<meta name="keywords" content="MuncieMLS.com Online MLS Property Search - Residential, Commercial, Investment, Lots & Land, Muncie Relocation, Muncie Homes, Muncie Real Estate, auction services, auction">
<META name="robots" content="index,follow">
<META NAME="revisit-after" CONTENT="30 days">
<LINK REL="SHORTCUT ICON" HREF="images/eaglerealestate.ico">
~;

&header;

print qq~
<td valign="top" width="581">
<script language="Javascript">
function checkMail()
{
	var x = document.registerform.Email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+/;
	if (filter.test(x));
	else alert('Sorry! You have entered an invalid email address!  Please check your email address  (Example: Username\@aol.com)');
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td colspan="2">
<img src="images/headers/register.gif" height="33" width="581" alt="Register For A FREE MyHomes Account"><Br>
</td>
</tr>
</table>

<table border="0" cellpadding="3" width="581" cellspacing="0">
<tr>
<td valign="top" width="100%">
<center><img src="images/register_top.gif"><a href="myhomes.idx"><img src="images/register_login.gif" border="0"></a></center><br>
<font size="2"><b>Just fill out the following form to become INSTANTLY registered!<br></b></font>
</font>
</td>
</tr>
<tr>
<td valign="top" width="100%">
		<form name="registerform" method="post" action="register.idx">
		<input type=hidden name=action value=register>
		<input type=hidden name=referrer value=$INPUT{referrer}>
		<table border="0" cellspacing="0" cellpadding="0" width="100%">
		<tr>
		<td>
			<table border="0" cellpadding="3" cellspacing="0" width="100%">
				<tr>
					<td colspan="2" valign="top">
						<table border="0" cellpadding="3" cellspacing="1" width="100%" bgcolor="#000066">
						<tr>
						<td valign="top" bgcolor="#C6E1FC">
						<center><font color="red" size="1"><b>$checkaccept $messagewindow</b></font></center>
						<center>
						<label for="Accepted"><input id="Accepted" type="checkbox" name="Accepted"$buildAccepted>  <b><u>I have read and agree to the MuncieMLS.com</u></label> <a href="javascript:save=window.open('terms_popup.html','save','width=320, height=325, scrollbars=yes'); save.focus();">Terms And Conditions</a></b></center></td>
						</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td width="50%"><font size="2"><b>Please tell us how you found MuncieMLS.com</b></font></td>
					<td width="50%">
						<select name="FoundBy" class="form">
						$buildFoundBy
						<option value="">-- Choose One --</option>
						<option value="Search Engine">Search Engine</option>
						<option value="Business card">Business Card</option>
						<option value="REALTOR Recommendation">REALTOR Recommendation</option>
						<option value="Homes and Lifestyles Magazine">Homes and Lifestyles Magazine</option>
						<option value="The Star Press">The Star Press</option>
						<option value="Other">Other</option>
						</select> 
					</td>
				</tr>
				<tr>
					<td width="50%" bgcolor="#e2e2e2">
						<font size="2"><b>I Am A
					</td>
					<td width="50%" bgcolor="#e2e2e2">
							<select name="UserType" class="form">
							$buildUserType
							<option value="">-- Choose Type --</option>
							<option value="Buyer">Buyer</option>
							<option value="Seller">Seller</option>
							<option value="Seller & Buyer">Seller & Buyer</option>
							<option value="Investor">Investor</option>
							<option value="Real Estate Professional">Real Estate Professional</option>
							<option value="Other">Other</option>
						</select>$checkUserType
 					</td>
				</tr>
				<tr>
					<td><font size="2"><b>First Name</b></font></td><td><input type="text" name="FirstName" value="$INPUT{FirstName}" class="form">$checkFirstName</td>
				</tr>
				<tr>
					<td bgcolor="#e2e2e2"><font size="2"><b>Last Name</b></font></td><td bgcolor="#e2e2e2"><input type="text" name="LastName" value="$INPUT{LastName}" class="form">$checkLastName</td>
				</tr>
				<tr>
					<td><font size="2"><b>Phone Number</b></font></td><td bgcolor=""><input type="text" name="Phone" value="$INPUT{Phone}" class="form"></td>
				</tr>
				<tr>
					<td bgcolor="#e2e2e2"><font size="2"><b>Email</b></font><br>MuncieMLS will automatically communicate with your email system to verify your email address is valid.</td><td bgcolor="#e2e2e2"><input type="text" name="Email" size="30" onFocusOut="javascript:checkMail();" value="$INPUT{Email}" class="form">$checkEmail</td>
				</tr>
				<tr>
					<td><font size="2"><b>Password</b></font></td><td bgcolor=""><input type="password" name="Password" value="$INPUT{Password}" class="form">$checkPassword</td>
				</tr>
				<tr>
					<td bgcolor="#e2e2e2"><font size="2"><b>Address</b></font></td><td bgcolor="#e2e2e2"><input type="text" name="Address" value="$INPUT{Address}" class="form"></td>
				</tr>
				<tr>
					<td><font size="2"><b>City</b></font></td><td bgcolor=""><input type="text" name="City" value="$INPUT{City}" class="form"></td>
				</tr>
				<tr>
					<td bgcolor="#e2e2e2"><font size="2"><b>State</b></font></td><td bgcolor="#e2e2e2">
				<select name="State" class="form">
$getstate
<option value="">-- Choose One --</option>
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option> 
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="District of Columbia">District of Columbia</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois">Illinois</option>
<option value="Indiana" $getstateselected>Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisiana">Louisiana</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota">Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana">Montana</option>
<option value="Nebraska">Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Ohio">Ohio</option>
<option value="Oklahoma">Oklahoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania">Pennsylvania</option>
<option value="Rhode Island">Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virgin Islands">Virgin Islands</option>
<option value="Virginia">Virginia</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyoming">Wyoming</option></select><br>
					</td>
				</tr>
				<tr>
					<td><font size="2"><b>Zip Code</b></font></td><td><input type="text" name="Zip" value="$INPUT{Zip}" class="form"></td>
				</tr>
				<tr>
					<td bgcolor="#e2e2e2"><font size="2"><b>What Is Your Time Frame For Your Next Real Estate Transaction?</b></font></td>
					<td bgcolor="#e2e2e2">
						<select name="TimeToMove" class="form">
						$buildTimeToMove
						<option value="Immediately">Immediately</option>
						<option value="1-2Months">1 - 2 Months</option>
						<option value="3-4Months">3 - 4 Months</option>
						<option value="5-6Months">5 - 6 Months</option>
						<option value="6-1YrMonths">6 Months - 1 Year</option>
						<option value="1YrUp">1 Year or Longer</option>
						</select>
					</td>
				</tr>
				<tr>
					<td><font size="2"><b>Are You Currently Working With An Eagle Agent?</b></font></td>
					<td><input type="radio" value="Yes" Name="realtor"$checkYesrealtor> Yes  	<input type="radio" value="No" Name="realtor"$checkNorealtor> No<br>

					<select name="myERAAgent" class="form">
					$buildmyERAAgent
					<option value="">-- If Yes, Choose Agent --</option>
					<option value="">==========================</option>
					$agentbuildlist
					</select>
				</td>
				</tr>
				<tr>
					<td><font size="2"><b>Could we remind you when new open houses are posted on our website?</b></font></td>
					<td><input type="radio" value="y" Name="email_openhouses" checked> Yes  	<input type="radio" value="n" Name="email_openhouses"> No$checkemail_openhouses<br>
				</td>
				</tr>
				<tr>
					<td colspan="2"><center><br><input type=submit value="Complete Registration"></center></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
		</form>
		</td>
	</tr>
</table>
</td>

~;


&footer;

}



