#!/usr/bin/perl

# 2963 sub add_percentage     (add the lead percentage to agents)

require "cgi-lib.pl";
require "Maps.pm";

#&ReadParse;
&parse_form;

use CGI qw(:standard);
use Fcntl qw(:flock);
use DBI;
use File::Listing qw(parse_dir);
use LWP::Simple;

require "0_variables.txt";	# Go and get the variables.

#PLACED AT LINE 254
$foreclosure_html = &foreclosure_map;
$max_foreclosures = ($max_foreclosures+7);

$banner_ad ="There are currently $max_foreclosures distressed homes in our $area database";

#$max_foreclosures = int($max_foreclosures*2);

#$foreclosure_html = &foreclosure_by_city_map;

# $foreclosure_html = &foreclosure_map;
#############################################################################

# Check Referring URL
#&check_url;

# Retrieve Date

if ($form{'banner'}eq"") {
$header = $banner;
} else {
$header = $form{'banner'};
}

&navigation;

##############################################################
if ($form{'return'} eq "Y") {&get_date;}
        else {&get_date; &firsttime;}

##############################################################
if ($form{'search_with_no_save'}) {
&return_html;
}

##############################################################
if ($form{'save_my_search'}) {
&savemysearch;
}

##############################################################
if ($form{'save_search'}) {
&savesearch;
}

#if ($form{'donot_save_search'}) {
#&donot_save_search;
#}



##############################################################
if ($form{'signmeup'}) {
&signmeup;
}

##############################################################
if ($form{'page2'}) {
&page2;
}

if ($form{'home'}) {
&firsttime;
}

if ($form{'search'}) {
&firsttime;
}


if ($form{'8000credit'}) {
&buyer_credit;
}



if ($form{'basics'}) {
&basics;
}

if ($form{'how'}) {
&how_to_buy;
}

if ($form{'finance'}) {
&financing;
}

if ($form{'downpayment'}) {
&downpayment;
}

if ($form{'glossary'}) {
&glossary;
}

if ($form{'contact'}) {
&contact;
}


##############################################################
if ($form{'page3'}) {
&page3;
}

##############################################################
if ($form{'send_free_report'}) {
&free_report;
}


##############################################################
# Send E-Mail
#&send_mail;


# Send E-Mail to the Sender
#&send_mail2;

#Write the database
#&write_database;


sub check_url {

   if ($ENV{'HTTP_REFERER'}) {
      foreach $referer (@referers) {
         if ($ENV{'HTTP_REFERER'} =~ /$referer/i) {
            $check_referer = '1';
	    last;
         }
      }
   }
   else {
      $check_referer = '0';
   }

   if ($check_referer != 1) {
      &error('bad_referer');
   }

}


sub get_date {

   @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
   @months = ('January','February','March','April','May','June','July',
	      'August','September','October','November','December');

   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
   if ($hour < 10) { $hour = "0$hour"; }
   if ($min < 10) { $min = "0$min"; }
   if ($sec < 10) { $sec = "0$sec"; }
$year += "1900";

   $date = "$months[$mon] $mday, $year $hour\:$min\:$sec";
$time_stamp = time();
$followupdate = $time_stamp+86400;
($secA,$minA,$hourA,$mdayA,$monA,$yearA,$wdayA,$ydayA,$isdstA) = localtime($followupdate);
$yearA += "1900";

use Time::Local;
$followupdate = timelocal(0,0,0,$mdayA,$monA,$yearA);
$followupdate = $followupdate-14399;

}


sub return_html {

      $count=1;

       open (DATABASE, "$database1");
        while (<DATABASE>)
        {
       $count++;
      }
      close (DATABASE);

      open (FILE, ">>$database1");
      flock(FILE, LOCK_EX);
      print FILE "$date|$count|$form{'property_id'}|$form{'address'}|$form{'zip_code'}|$form{'city'}|$form{'county'}|$form{'min_price'}|$form{'max_price'}|$form{'min_bedrooms'}|$form{'min_bathrooms'}\n";
      close (FILE);

      print "Location: http://www.mlsfinder.com/oh_cbr/ihome?action=newsearchsession&tmp_property_type=$form{'property_type'}&property_id=$form{'property_id'}&address=$form{'address'}&zip_code=$form{'zip_code'}&city=$form{'city'}&county=$form{'county'}&min_price=$form{'min_price'}&max_price=$form{'max_price'}&min_bedrooms=$form{'min_bedrooms'}&min_bathrooms=$form{'min_bathrooms'} \n\n";

}

sub firsttime {
#      &reverse_id;
      $count=1;

       open (DATABASE, "$page1");
        while (<DATABASE>)
        {
       $count++;
      }
      close (DATABASE);

      open (FILE, ">>$page1");
      flock(FILE, LOCK_EX);
      print FILE "$count|$date|$ENV{'REMOTE_ADDR'}|$reverseIP|$form{'referrer'}\n";
      close (FILE);


    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onload="setupMap()" onload="OnLoad()" onunload="GUnload()">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675>
<center>
    <table width="500" bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="8"><tr><td  class="body">
<FORM method=POST action="/cgi-bin/foreclosure.pl">
		<input type="hidden" name="sendwhere" value="quicksearch" />
		<input name="action" value="newsearchsession" type="hidden">
		<INPUT type="hidden" name="return" Value="Y">

  		<input type="hidden" name="referrer" value="$form{'referrer'}" />
  		<input type="hidden" name="website" value="$form{'website'}" />
  		<input type="hidden" name="area" value="$form{'area'}" />
  		<input type="hidden" name="banner" value="$form{'banner'}" />

        <input type="hidden" value="$form{'total_properties'}" name="total_properties">


<table width="100%" cellpadding="3" cellspacing="0" border="0"><tr>
<td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">Select Search Area:</td>
<td><select name="city" size="4" style="width: 160px;>
$city_options
</select></td></tr><tr>

<td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">Style of Home:</td>
<td colspan="2" style="text-align: left; height: 35px; padding-left: 4px; vertical-align: middle;">
    <SELECT  name="style" size="3" style="width: 160px;">

					<option value="1 STORY">1 STORY</option>

					<option value="2 STORY">2 STORY</option>

					<option value="BI-LEVEL">BI-LEVEL</option>

					<option value="CAPE COD">CAPE COD</option>

					<option value="SPLIT LEVEL">SPLIT LEVEL</option>

			</SELECT>
    </td></tr><tr>

<td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">List Price:</td>
<td  style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
                     <select name="min_price" style="width: 160px;">
                        <option value="">Select Minimum Price</option>
                        <option value="\$25,000">\$25,000</option>
                        <option value="\$50,000">\$50,000</option>
                        <option value="\$75,000">\$75,000</option>
                        <option value="\$100,000">\$100,000</option>
                        <option value="\$125,000">\$125,000</option>
                        <option value="\$150,000">\$150,000</option>
                        <option value="\$175,000">\$175,000</option>
                        <option value="\$200,000">\$200,000</option>
                        <option value="\$225,000">\$225,000</option>
                        <option value="\$250,000">\$250,000</option>
                        <option value="\$275,000">\$275,000</option>
                        <option value="\$300,000">\$300,000</option>
                        <option value="\$350,000">\$350,000</option>
                        <option value="\$400,000">\$400,000</option>
                        <option value="\$450,000">\$450,000</option>
                        <option value="\$500,000">\$500,000</option>
                        </select>
                        <br>
                        <select name="max_price" style="width: 160px;">
                        <option value="">Select Maximum Price</option>
                        <option value="\$50,000">\$50,000</option>
                        <option value="\$75,000">\$75,000</option>
                        <option value="\$100,000">\$100,000</option>
                        <option value="\$125,000">\$125,000</option>
                        <option value="\$150,000">\$150,000</option>
                        <option value="\$175,000">\$175,000</option>
                        <option value="\$200,000">\$200,000</option>
                        <option value="\$225,000">\$225,000</option>
                        <option value="\$250,000">\$250,000</option>
                        <option value="\$275,000">\$275,000</option>
                        <option value="\$300,000">\$300,000</option>
                        <option value="\$350,000">\$350,000</option>
                        <option value="\$400,000">\$400,000</option>
                        <option value="\$450,000">\$450,000</option>
                        <option value="\$500,000">\$500,000</option>
                        <option value="\$550,000">\$550,000</option>
                        <option value="\$600,000 plus">\$600,000 plus</option>
                        </select>
        </td></tr><tr>

    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Bedrooms:</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
     <SELECT name="min_bedrooms" style="width: 160px;">
						<OPTION value="">Please Select</option>
						<OPTION value="Don't Care">Don't Care</option>
                        <OPTION value="1 or more">1 or more</option>
                        <OPTION value="2 or more">2 or more</option>
                        <OPTION value="3 or more">3 or more</option>
                        <OPTION value="4 or more">4 or more</option>
                        </SELECT>
     </td>
     <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

    </td></tr><tr>
    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Bathrooms:</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
    <SELECT name="min_bathrooms" style="width: 160px;">
        <OPTION value="">Please Select</option>
        <OPTION value="Don't Care">Don't Care</option>
        <OPTION value="1 or more">1 or more</option>
        <OPTION value="2 or more">2 or more</option>
        </SELECT>
     </td><td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

     </td></tr><tr>

    </td></tr><tr>
    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Garage:</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
    <SELECT name="garage" style="width: 160px;">
        <OPTION value="">Please Select</option>
        <OPTION value="Don't Care">Don't Care</option>
        <OPTION value="Off Street">Off Street Parking</option>
        <OPTION value="Car Port">Car Port</option>
        <OPTION value="1 car or more">1 car or more</option>
        <OPTION value="2 car or more">2 car or more</option>
        <OPTION value="3 car or more">3 or more</option>
        </SELECT>
     </td></tr><tr>

     <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;"></td>
<td  style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

<INPUT type = "SUBMIT" name="page3" VALUE="Select & Click Here">
</center>

</td></tr></table>


					<td>
                    <img src="$map" alt="" border="0" align="">
					</td></tr></table>


<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>

<P>
</td>
</tr></table>
</center>
</td>
</tr></table>
</body>
</html>

ENDHTML


 }


sub page2 {

      $count=1;

       open (DATABASE, "$page2");
        while (<DATABASE>)
        {
       $count++;
      }
      close (DATABASE);

      open (FILE, ">>$page2");
      flock(FILE, LOCK_EX);
      print FILE "$count|$date|$ENV{'REMOTE_ADDR'}|$ENV{'HTTP_REFERER'}|$form{'city'}|\n";
      close (FILE);

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";
    print "</head>\n";

print <<ENDHTML;
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />

</head>
<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->


</td><td width=675>

<center>
<table><tr>
<FORM method=POST action="/cgi-bin/foreclosure.pl">

  		<input type="hidden" name="referrer" value="$form{'referrer'}" />
  		<input type="hidden" name="website" value="$form{'website'}" />
  		<input type="hidden" name="area" value="$form{'area'}" />
  		<input type="hidden" name="banner" value="$form{'banner'}" />

  		<INPUT type=\"hidden\" name=\"city\" Value=\"$city_search\">
  		<INPUT type=\"hidden\" name=\"return\" Value=\"Y\">
  		<input type="hidden" value="$form{'total_properties'}" name="total_properties">

<td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">Style of Home:</td>
<td colspan="2" style="text-align: left; height: 35px; padding-left: 4px; vertical-align: middle;">
    <SELECT  name="style" size="4" multiple style="width: 190px;">

					<option value="1 STORY">1 STORY</option>

					<option value="2 STORY">2 STORY</option>

					<option value="BI-LEVEL">BI-LEVEL</option>

					<option value="CAPE COD">CAPE COD</option>

					<option value="SPLIT LEVEL">SPLIT LEVEL</option>

			</SELECT>
    </td></tr><tr>

<td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">List Price:</td>
<td  style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
                     <select name="min_price" style="width: 160px;">
                        <option value="">Select Minimum Price</option>
                        <option value="\$25,000">\$25,000</option>
                        <option value="\$50,000">\$50,000</option>
                        <option value="\$75,000">\$75,000</option>
                        <option value="\$100,000">\$100,000</option>
                        <option value="\$125,000">\$125,000</option>
                        <option value="\$150,000">\$150,000</option>
                        <option value="\$175,000">\$175,000</option>
                        <option value="\$200,000">\$200,000</option>
                        <option value="\$225,000">\$225,000</option>
                        <option value="\$250,000">\$250,000</option>
                        <option value="\$275,000">\$275,000</option>
                        <option value="\$300,000">\$300,000</option>
                        <option value="\$350,000">\$350,000</option>
                        <option value="\$400,000">\$400,000</option>
                        <option value="\$450,000">\$450,000</option>
                        <option value="\$500,000">\$500,000</option>
                        </select>
        </td>
        <td style="text-align: left; width: 200px; height: 35px; vertical-align: middle; padding-left: 4px">
        <select name="max_price" style="width: 160px;">
                        <option value="">Select Maximum Price</option>
                        <option value="\$50,000">\$50,000</option>
                        <option value="\$75,000">\$75,000</option>
                        <option value="\$100,000">\$100,000</option>
                        <option value="\$125,000">\$125,000</option>
                        <option value="\$150,000">\$150,000</option>
                        <option value="\$175,000">\$175,000</option>
                        <option value="\$200,000">\$200,000</option>
                        <option value="\$225,000">\$225,000</option>
                        <option value="\$250,000">\$250,000</option>
                        <option value="\$275,000">\$275,000</option>
                        <option value="\$300,000">\$300,000</option>
                        <option value="\$350,000">\$350,000</option>
                        <option value="\$400,000">\$400,000</option>
                        <option value="\$450,000">\$450,000</option>
                        <option value="\$500,000">\$500,000</option>
                        <option value="\$550,000">\$550,000</option>
                        <option value="\$600,000 plus">\$600,000 plus</option>
                        </select>
    </td></tr><tr>
    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Bedrooms:</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
     <SELECT name="min_bedrooms" style="width: 160px;">
						<OPTION value="">Please Select</option>
						<OPTION value="Don't Care">Don't Care</option>
                        <OPTION value="1 or more">1 or more</option>
                        <OPTION value="2 or more">2 or more</option>
                        <OPTION value="3 or more">3 or more</option>
                        <OPTION value="4 or more">4 or more</option>
                        </SELECT>
     </td>
     <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

    </td></tr><tr>
    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Full Bathrooms:</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
    <SELECT name="min_bathrooms" style="width: 160px;">
        <OPTION value="">Please Select</option>
        <OPTION value="Don't Care">Don't Care</option>
        <OPTION value="1 or more">1 or more</option>
        <OPTION value="2 or more">2 or more</option>
        </SELECT>
     </td><td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

     </td></tr><tr>

    </td></tr><tr>
    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Garage:</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
    <SELECT name="garage" style="width: 160px;">
        <OPTION value="">Please Select</option>
        <OPTION value="Don't Care">Don't Care</option>
        <OPTION value="Off Street">Off Street Parking</option>
        <OPTION value="Car Port">Car Port</option>
        <OPTION value="1 car or more">1 car or more</option>
        <OPTION value="2 car or more">2 car or more</option>
        <OPTION value="3 car or more">3 or more</option>
        </SELECT>
     </td><td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

     </td></tr><tr>

    <td style="text-align: right; height: 15px; font-family: Arial; color: #990000; font-size: 13px; font-weight: bold;">
    Age of Home</td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">
    <select name="age_of_home" style="width: 160px;">
		<option value="">Please Select</option>
		<OPTION value="Don't Care">Don't Care</option>
		<option value="New Construction">New Construction</option>
		<option value="Less than 10 years">Less than 10 years</option>
		<option value="10 to 25 years">10 to 25 years</option>
		<option value="25 to 50 years">25 to 50 years</option>
		<option value="50 to 75 years">50 to 75 years</option>
		<option value="75 years or older">75 years or older</option>
        </select>
    </td>
    <td style="text-align: left; width: 200px; padding-left: 4px; height: 35px; vertical-align: middle;">

    </td></tr></table>
    <INPUT type = "SUBMIT" name="page3" VALUE="Select Your Criteria & Click Here">
    </td></tr></table>
<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</body>
</html>

ENDHTML
 }


sub page3 {



if ($form{'city'} eq "") {$city_search = $default_city_search
} else {$city_search = $form{'city'}
}

# Here's the javascript code that we include in the document.
      $count=1;

       open (DATABASE, "$page3");
        while (<DATABASE>)
        {
       $count++;
      }
      close (DATABASE);

      open (FILE, ">>$page3");
      flock(FILE, LOCK_EX);
      print FILE "$count|$date|$ENV{'REMOTE_ADDR'}|$form{'city'}|$form{'style'}|$form{'min_price'}|$form{'max_price'}|$form{'min_bedrooms'}|$form{'max_bedrooms'}|$form{'min_bathrooms'}|$form{'max_bedrooms'}|$form{'garage'}|$form{'age_of_home'}\n";
      close (FILE);

    print "Content-type: text/html\n\n";
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
    print '<html xmlns="http://www.w3.org/1999/xhtml">';
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
<script src="http://www.columbusohioforeclosure.com/php/js/jquery.nyroModal.custom.js"></script>
<script src="http://www.columbusohioforeclosure.com/php/js/local.js"></script>

 <link href="http://www.columbusohioforeclosure.com/php/styles/nyroModal.css" rel="stylesheet" type="text/css" />

</head>

<body onload="javascript:\$('#testclick').click()" background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" >

<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
</td><td width=675>

<form id="modalpo" name="contact_form" action="/cgi-bin/foreclosure.pl"  class="nyroModal">

<center>

<font size=6 color=blue>Foreclosure Listings for $city_search<p></font>

<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=dddddd>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=211004439&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211004439&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/211004439_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211004439&search_id=24931&next=><b>8275 Robinson Rd</b>,</a><br>


		 Mount Sterling, 43143<br>3 Bedrooms<br>2 Bathrooms, 1 Half Bathrooms<br>Residential<br><b>Style:</b> Detached Single Family <br>One Story<br>\$0 </div>

		 <div align=right><font size=1 color=black> MLS#211004439 Courtesy of HER Real Living</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=eeeeee>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=211007324&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211007324&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/211007324_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211007324&search_id=24931&next=><b>819 Main St</b>,</a><br>


		 Coshocton, 43812<br>2 Bedrooms<br>2 Bathrooms, 1 Half Bathrooms<br>Residential<br><b>Style:</b> Detached Single Family <br>Two Story<br>\$0 </div>

		 <div align=right><font size=1 color=black> MLS#211007324 Courtesy of Anderson & Co., Realtors</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=dddddd>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=211005944&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211005944&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/211005944_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211005944&search_id=24931&next=><b>8890 Hagerty Rd</b>,</a><br>


		 Ashville, 43103<br>4 Bedrooms<br>3 Bathrooms<br>
Residential<br><b>Style:</b> Detached Single Family <br>One Story<br>\$0 </div>

		 <div align=right><font size=1 color=black> MLS#211005944 Courtesy of Anderson & Co., Realtors</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=eeeeee>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=211006564&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211006564&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/211006564_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211006564&search_id=24931&next=><b>90 2nd Ave</b>,</a><br>


		 Pataskala, 43062<br>3 Bedrooms<br>2 Bathrooms<br>
Residential<br><b>Style:</b> Detached Single Family <br>One Story<br>\$0 </div>

		 <div align=right><font size=1 color=black> MLS#211006564 Courtesy of Keller Williams Greater Cols</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=dddddd>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=211005992&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211005992&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/211005992_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211005992&search_id=24931&next=><b>5274 Rampart Rd</b>,</a><br>


		 Columbus, 43207<br>4 Bedrooms<br>2 Bathrooms<br>
Residential<br><b>Style:</b> Attached Single Family <br>One Story<br>\$1,000 </div>

		 <div align=right><font size=1 color=black> MLS#211005992 Courtesy of Century 21 Frank Frye Real Est</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=eeeeee>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=210046459&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210046459&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/210046459_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210046459&search_id=24931&next=><b>14 Reeb Ave</b>,</a><br>


		 Columbus, 43207<br>2 Bedrooms<br>1 Bathrooms<br>
Residential<br><b>Style:</b> Attached Single Family <br>Two Story<br>\$1,999 </div>

		 <div align=right><font size=1 color=black> MLS#210046459 Courtesy of Coldwell Banker King Thompson</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=dddddd>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=210005394&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210005394&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/210005394_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210005394&search_id=24931&next=><b>508 Miller Ave</b>,</a><br>


		 Columbus, 43205<br>3 Bedrooms<br>1 Bathrooms<br>
Residential<br><b>Style:</b> Detached Single Family <br>Two Story<br>\$4,000 </div>

		 <div align=right><font size=1 color=black> MLS#210005394 Courtesy of Vision Realty, Inc.</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=eeeeee>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=210046469&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210046469&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/210046469_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210046469&search_id=24931&next=><b>234 Brehl Ave</b>,</a><br>


		 Columbus, 43222<br>2 Bedrooms<br>1 Bathrooms<br>
Residential<br><b>Style:</b> Detached Single Family <br>Two Story<br>\$5,900 </div>

		 <div align=right><font size=1 color=black> MLS#210046469 Courtesy of Majestic Realty</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=dddddd>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=211005812&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211005812&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/211005812_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=211005812&search_id=24931&next=><b>1624 Harvard Ave</b>,</a><br>


		 Columbus, 43203<br>3 Bedrooms<br>1 Bathrooms<br>
Residential<br><b>Style:</b> Detached Single Family <br>Two Story<br>\$5,900 </div>

		 <div align=right><font size=1 color=black> MLS#211005812 Courtesy of Coldwell Banker King Thompson</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>
	<TABLE cellpadding=1 cellspacing=3 border=0 WIDTH="100%">
	<tr bgcolor=eeeeee>
		<td width=15>
			<div align=center><a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=photo_gallery&listing_mls=210041688&search_id=24931" target=_new class="hintanchor" onMouseover="showhint('Click to see popup photo gallery', this, event, '100px')" alt="Click to see popup photo gallery"><!-- img src=http://www.agenthelper.net/pics/camera-small.gif align=abs_middle border=0><font size=2>View all photos</font --></a>
		</td>
		<td valign=top width=200>
			<div align=left>

			<a href="http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210041688&search_id=24931&next="><img src="http://2ihp1xawc.myutilitydomain.com/photos/210041688_1.jpg" width="200" height="150" border="0"></a>

		</td>
		<td valign=top> <a href=http://www.stevebarlow.net/cgi-bin/public_search.cgi?action=show&listing_mls=210041688&search_id=24931&next=><b>1594 Kenmore Rd</b>,</a><br>

		 Innis Crest<br>
		 Columbus, 43211<br>3 Bedrooms<br>1 Bathrooms<br>
Residential<br><b>Style:</b> Detached Single Family <br>Two Story<br>\$6,000 </div>

		 <div align=right><font size=1 color=black> MLS#210041688 Courtesy of RE/MAX Town Center, LLC</font></div>

		</td>
		<td>

		</td>
	<tr>
	<tr>
		<td colspan=4 height=1 bgcolor=black>
		</td>
	</tr>
	</table>





<div style="width:800px;margin:0 auto"><a id="testclick" href="#test" class="nyroModal" ><font size=5>To Get Your Free List of Foreclosures<br>Please Click Here</font></a></div>


  <form action="/cgi-bin/foreclosure.pl" method="post" >
  <INPUT type="hidden" id="f0" name="zip_code" Value="$form{'zip_code'}">
<INPUT type="hidden" id="f1" name="city" Value="$city_search">
<INPUT type="hidden" id="f2" name="property_id" Value="$form{'property_id'}">
<INPUT type="hidden" id="style" name="style" Value="$form{'style'}">
<INPUT type="hidden" id="f3" name="min_price" Value="$form{'min_price'}">
<INPUT type="hidden" id="f4" name="max_price" Value="$form{'max_price'}">
<INPUT type="hidden" id="f5" name="min_bedrooms" Value="$form{'min_bedrooms'}">
<INPUT type="hidden" id="f6"  name="min_bathrooms" Value="$form{'min_bathrooms'}">
<INPUT type="hidden" id="f7"  name="garage" Value="$form{'garage'}">
<INPUT type="hidden" id="f8"  name="age_of_home" Value="$form{'age_of_home'}">
<INPUT type="hidden" id="f9" name="return" Value="Y">
<input type="hidden" id="f10" name="referrer" value="$form{'referrer'}">
<input type="hidden" id="f11" name="website" value="$form{'website'}">
<input type="hidden" id="f12" name="area" value="$form{'area'}">
<input type="hidden" id="f13" name="banner" value="$form{'banner'}">
<input type="hidden" id="f14" name="save_search" value="savesearch">

                  <input id="f15" type="hidden" value="$data" name="data">
                  <input id="f16" type="hidden" value="$admin_email" name="recipient">
                    <input id="f17" type="hidden" value="$admin_name ($admin_email)" name="from">
                    <input id="f18" type="hidden" value="email,fname,lname,phone" name="required">
                    <input id="f19" type="hidden" value="order:fname,lname,email,phone,message" name="sort">
                    <input id="f20" type="hidden" value="$url/thanks.html" name="redirect">
                    <input id="f21" type="hidden" value="Thanks For The Mail" name="title">
                    <input id="f22" type="hidden" value="Thanks for The Email" name="return_subject">
                    <input id="f23" type="hidden" value="#ffffff" name="bgcolor">
<div id="oki">
<table  width="500" border="0" class="nyroModal" id="test" style="display: none;">

    <tr>
    <td class="style3" colspan="2"><center><font size=4 color=red>Please Provide the Following Information<br>for Your Free List of Foreclosures</font><P> </td>
    </tr>

   <tr>
    <td class="style3" align=right valign=top>Email:</td>
    <td align=left><input name="email" id="f24" maxlength="80"><br><input id="understand" type="radio" name="understand" value="understand" checked><font size=2 color=blue>Please send me automatic daily updates</font><input id="understand" type="radio" name="understand" value="understand"><font size=2 color=blue>No thanks</font></td>
  </tr>
  <tr>
    <td class="style3" align=right>Name:</td>
    <td align=left><input id="f25"" name="fname" maxlength="30"></td>
  </tr>
  <!--
  <tr>
    <td class="style3" align=right>Last Name:</td>
    <td align=left><input  name="lname" id="f26" maxlength="30"></td>
  </tr>
  -->
  <tr>
    <td class="style3" align=right>Phone:</td>
    <td align=left><input name="dayphone" id="f27"" maxlength="30"></td>
  </tr>
  <tr><td><img height="20" src="/space.jpg" width="1" border="0" name=""></td><td><center> <font color=red size=2><div id="err" style="float:left;font-weight:bold;display:none;"></div></font></center><br></td></tr>
  <tr>
    <td class="style3" align=right>Do you currently own or rent?</td>
    <td align=left><select id="f28"  name="own_or_rent">
        <option value="" selected="selected">Please Select</option>
        <option value="own">Currently Own</option>
        <option value="rent">Currently Rent</option>
        </select>
	</td>
    </tr>

  <tr>
    <td class="style3" align=right>Have you been pre-approved with a lender?</td>
    <td align=left><select id="f29"  name="pre_qualified">
        <option value="" selected="selected">Please Select</option>
        <option value="yes">Yes, I am working with a lender</option>
        <option value="no">No, I still need to get pre-approved</option>
        </select>
	</td>
    </tr>

  <tr>
    <td class="style3" align=right>When do you plan to buy?</td>
    <td align=left><select id="f30" name="plan_to_buy">
        <option value="" selected="selected">Please Select</option>
        <option value="less than 30 days">Within the next 30 days</option>
        <option value="one to three months">One to three months</option>
        <option value="three to six months">Three to six months</option>
        <option value="within the next year">Within the next year sometime</option>
        </select>
	</td>
    </tr>

    <tr>
    <td><img height="20" src="/space.jpg" width="1" border="0" name=""></td><td></td></tr>
    <tr>
    <td class="style3" align=right>Other details you would like to have?</td>
    <td align=left><TEXTAREA id="f31"  name=\"other_details\" Rows=5 COLS=35 Size=\"200\" value=\"\"></TEXTAREA></td>
  </tr>
  <tr>
    <td></td>
    <td><div id="but1"><INPUT type = "button" onclick="checkData()" name="save_search" VALUE="Click For Your FREE List of Foreclosures"></div> <br>
  </td>
  </tr>
  </form>


<script type="text/javascript">

\$(function() {
  \$('.nyroModal').nyroModal();

});



</script>

  </table>
</div>
    <img src="/space.jpg" width="10" height="500" alt="" border="0" align="" class="proba">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4006214-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


ENDHTML

print "</body>";
print "</html>";

 }


sub basics {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

<h1><img src=/images/foreclosurebasics.jpg width=230 height=25 /></h1>
    <p>There are a 3 common types of discounted sales;</p>
<ul>
<li>Bank Owned Homes or Foreclosures </li>
<li>Government Owned or HUDs/VAs  </li>
<li>Pre-Foreclosure's or Short Sales  </li>
</ul>
<p><img src=/images/foreclosures.jpg width=245 height=25 /></p>
<p>Here is the general process on how a foreclosure comes to be:</p>
<ol start=1 type=1>
  <li>A home owner stops making house payments;</li>
  <li>After a period of about 3 months the mortgage holder files a law suit to regain ownership of their collateral through the foreclosure process.</li>
  <li>6-12 months later, the home is put up for sale through the county Sheriff auction.;</li>
  <li>The bidding will begin at 2/3rds of the appraised value of the home;</li>
  <ol start=1 type=a>
    <li>If the home is valued at \$100,000 the bidding will begin at 2/3rds of that        value or in this case, \$66,666.</li>
  <li>The bank will bid up to what they are owed on the house unless the house is       worth less than what's owed;</li>
  <ol start=1 type=a>
    <li>For example, let's say the person who owned the home worth $100,000 owes \$120,000.</li>
  </ol>
</ol>
<ol>
  <ol>
    <ol>
      <li>The bank will bid up to \$100,000. If someone else bids more than \$100,000 - the bank will receive more than what the home is worth and will be satisfied with someone else purchasing the home.</li>
      <li>In this example, the person purchasing the home at the sheriff  sale is at a disadvantage. Why? They are buying the home blind without seeing  the inside condition or having a home inspection. They are also paying fair  market value in a buyer's market.</li>
    </ol>
  </ol>
</ol>
<ol start=5 type=1>
  <ol start=2 type=a>
    <li>Another example, let's say the person who owned the home only owed $70,000.</li>
  </ol>
</ol>
<ol>
  <ol>
    <ol>
      <li>The bank should bid only up to \$70,000 since they will be made  whole. Again, someone bidding against the bank is buying the home blind but is saving a significant amount of money.</li>
      <li>It is possible that the bank will bid above \$70,000 since they know the home is worth more and they could possibly make money on selling the home to the public. Not likely, but it has happened before.</li>
    </ol>
  </ol>
</ol>
</ol>
<ol start=5 type=1>
  <li>After the auction, where the bank most-likely buys the house back, the previous owner has 30 days under Ohio law to pay the bank what is owed and get their home back.</li>
  <li>Once the 30 day Right of Redemption period has passed, the bank will enter the home and usually trash the property out, winterize the property (drain water from the lines to prevent pipes bursting), and begin the process to market and sell the property.</li>
  <li>Within 30 - 90 days, the bank will list the home for sale on the market with a Realtor. The bank, for whatever reason, will not deal outside of a Realtor. Even though they don't listen to us when we tell them what it's truly worth.</li>
  <li>Once the home comes on the market - it's up for sale.</li>
  <li>You can now view the home with me, make an offer on the home, and do an       inspection on the property.</li>
  <li>Can't give away my secrets on how to make an offer more appealing to a bank, get a lower price, and how to structure the contract to protect you as a home buyer on the internet. For one, other agents may use my tactics and two, they are specific to each property and it's history.</li>
</ol>
<p>As you can tell, from the day someone stops making a payment  to the day the home is listed for sale can be around 13 months. Once you make  an offer and it is accepted by the bank, you can expect to close and get the  keys within 30 days.</p>
<p><img src=/images/HUDs.jpg width=245 height=25 /></p>
<p>The process on how a HUD comes to be is exactly the same. The only difference between a HUD and a Foreclosure is that when the people stopped making payments on their house: the loans they had were government backed.</p>
<p>FHA backed loans that go through the process of foreclosure are bought back by the mortgage holder and then sold to HUD who then pays the bank and eventually puts the property back on the market as a HUD Owned Home.</p>
<p>Buyers who wish to place a bid on a HUD Owned Home must use a HUD Approved real estate Broker.  All agents asscoiated with this web site are HUD Approved Brokers and have extensive training in successfully helping buyers purchse HUD Owned Homes.</p>
<p>Those who are going to occupy the home as their primary  residence get first dibs. HUD will only look at offers from owner occupants the first 10 days the home is on the market. Investors are able to make bids on day 11.</p>
<p>All bidding is done online. Bid results are posted the next day online at 10:30.</p>
<p>If you were the successful bid, a HUD contract package will be printed and everything must be submitted in writing to a office in New Jersey. They will review the package once they get it, sign it, and email a copy back to your HUD Approved Broker.</p>
<p>There are quite a few tricks on how to get a HUD way below market value. We also know from the dealing with New Jersey office quite often what HUD looks for when an offer is submitted, increasing the chances it's accepted.</p>
<p>From the day you make an offer to closing is about 45-55 days.</p>
<p><img src=/images/shortsales.jpg width=245 height=25 /></p>
<p>These are more complicated than the previous two scenarios and where our expertise comes in.</p>
<p>A short sale is where the bank agrees to take less than  what's owed on the mortgage to sell the home before foreclosure takes place.</p>
<p>Most people, agents included think that how much is owed on the house is the most important number. This is WRONG. The most important number is what is the home worth.</p>
<p>Knowing how many mortgages is important as well. For example, if there are 3 or more mortgages - the short sale will be next to impossible. If there are 2 mortgages - it will be a challenge but it may be doable based on the circumstances. If there is 1 mortgage - home run.</p>
<p>We can pin-point what the bank will accept in a short sale. We also have a list of contacts at each bank - most are the head of the short sale department for each bank. Unfortunately, the short sale relys heavily on the listing agent - and most agents don't know how to work the short sale properly.  We will do what we can from our side, but you must warned upfront that although short sales represent some very good buys they are also much more difficult to get approved and eventually to closing.</p>
<p>
</font>


<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }


sub how_to_buy {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

  <h1><img src="images/howtobuy.jpg" width="245" height="25" /></h1>
  <p>This quick walk thru will give you an over view of the home buying process.</p>
<p><img src="images/getpreapproved.jpg" width="245" height="25" /></p>
<p>The first step is to get pre-approved for a mortgage. There are a couple reasons for this. The first reason to make a pre-approval your first step is negotiating power. You, as a home buyer, will have much more leverage with a seller when you have a pre-approval in your hand. Especially if there is another buyer interested in the home who is not pre-approved.</p>
<p>The second reason you want to be pre-approved is if you find a Foreclosure Property the seller won't even look at an offer without a pre-approval.</p>
<p>Pre-approval's are free - some lenders may want to charge you an application fee but if a lender asks you for such a fee, just ask them if it can be paid after you've found a house. Such a fee goes towards the costs of appraising the home you select. If you haven't made an offer yet - there is no point in paying for the appraisal. Make sense?</p>
<p><img src="images/findahome.jpg" width="245" height="25" /></p>
<p>After you've been pre-approved for a loan, it's time to go look for a home. Think about the things you would like for your new home to have.  What is important to you like style of home, how many beds, baths, garage, backyard, family room and so on.  What would the perfect house have but remember not even the new builds will have everything you want so be flexible.  Many times you will have to settle for less than the perfect house but if you can get 5 or 6 out of 10 wants to match you are doing pretty good.</p>
<p>Once you've figured out your wants then let's select a few homes as possibilities and schedule a time to go and take a look. Sometimes when we start to look for the perfect home you'll identify other wants and sometimes you'll decide that something you really wanted isn't really needed but we won't know until we start to look.</p>
<p><img src="images/makeanoffer.jpg" width="245" height="25" /></p>
<p>Now that we've looked at a handful of homes, and you've found one you want to buy - we'll write the offer. As Foreclosure Specialist we'll make sure your bests interests as a home buyer are represented and that all I's are dotted and T's are crossed.</p>
<p>Because we have helped hundreds of people just like buy a home we have the experience to show you how certain terms in a contract look to a bank or a seller, and how to present your offer in the most advantageous way.</p>
<p><img src="images/homeinspection.jpg" width="245" height="25" /></p>
<p>Every offer we write is contingent upon a home inspection. This means, if we get into contract on a home - we'll have an opportunity to inspect the home for problems. If the inspector comes back and finds some issues with the home you will have a few options.</p>
<p>You can either walk away from the deal and find a new home, or we can re-negotiate the price of the home or ask the seller to make certain repairs. Lastly, we can buy the property as is and continue with the purchase.</p>
<p>We will make sure you know and understand all of your options! Home inspections are a great opportunity for you to get to know your home.</p>
<p><img src="images/closing.jpg" width="245" height="25" /></p>
<p>After the home inspection, and the lender has the money ready to go - it's time to close on your new home.</p>
<p>You'll do a final walk-thru of the home right before the closing to make sure everything is the way it should be. Again, we're watching your back and keeping your bests interests at heart.</p>
<p>After the walk-thru, we'll head to the closing where you'll get to spend about an hour signing paperwork - depending on what type of loan you get.</p>
<p>Once your done signing - we'll shake your hand and hand you your new keys.</p>
<p>Congratulations, you're now a home owner. </p>
<p>



<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }



 sub financing {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

    <h1><img src="images/financing101.jpg" width="230" height="25" /></h1>
    <table width="490" border="0">
      <tr>
        <td width="398" align="left" valign="top"><p>How you finance your home will determine how good your investment will be. Many home buyers pay too much interest, points and other hidden fees to lenders costing them thousands, maybe even tens of thousands od dollars. Other's may not find the right lender and not even be able to buy the home at all. We are not loan people, we are Foreclosure Specialist whose number 1 job is to look out for you and your best interest.  We have the experience and a whole stable of lenders we can reccomend if needed to get you with the right lender for your particular situation.</p>
          <p><img src="images/thebasics.jpg" width="245" height="25" /></p>
        <p>Generally to qualify for a home mortgage you need to have the following: Reasonably good credit, stable income, enough money for the down  payment and closing costs, and not too much debt in relationship to your  income.</p>
<p><img src="images/creditqualifying.jpg" width="245" height="25" /></p>
</td>

        <td width="82" align="left" valign="top"><!-- MLCALC BEGIN -->
<script type="text/javascript"><!--
mlcalc_default_calculator = 'mortgage';
mlcalc_currency_code      = 'USD';
mlcalc_form_size          = 'small';
mlcalc_interest_rate      = '6.5';
mlcalc_purchase_price     = '150,000';
mlcalc_loan_amount        = '150,000';
mlcalc_property_tax       = '1,500';
mlcalc_property_insurance = '1,000';
mlcalc_down_payment       = '3';
//--></script>
<script type="text/javascript" src="http://www.mlcalc.com/widget.js"></script>
<noscript><a href="http://www.mlcalc.com/">Mortgage loan calculator</a></noscript>
<!-- MLCALC END --></td>
      </tr>
    </table>
<p>Underwriters are looking for current stability. Your last 2 years of credit history will have the greatest impact on whether you qualify for a loan or not. For most loans, you should not have any payments more than 30 days late on rent or a previous mortgage for the one year period preceding your mortgage application. </p>
    <p>For other bills there should not be any late payments for the last 6 months and there should not be many late payments on your entire history. Most credit problems that are more than 3 years old will probably be ignored if you haven't had any problems recently. </p>
    <p><img src="images/downpayment.jpg" width="245" height="25" /></p>
    <p>Different loan programs have different requirements.  Eligible veterans can get loans with no down payment. Some loans in certain  areas require no down payment. We also have lenders that offer No Down Payment - 100% financing products, even if you are not a first time home buyer or a  veteran! Typical conventional loan products require 5% or more down. FHA loans  are available with as little as 3% down including closing costs.</p>
    <p><img src="images/creditqualifying.jpg" width="245" height="25" /></p>
    <p>Closing costs are the necessary evils people have to  pay to buy a home. They include the following fees: Credit report; Appraisal;  Closing Company; Origination; Tax Service; Document Preparation; Survey; Title  Insurance; Flood Certification; Hazard Insurance; Mortgage Insurance, Tax  Escrow; Discount Points and more! The costs vary depending on the property,  your lender and the arrangements you have made with the seller. There are also  programs available where the buyer pays reduced or no closing costs! We would be happy to share these with you and tell you if you qualify for these programs. </p>
    <p><img src="images/typesofloans.jpg" width="245" height="25" /></p>
    <p><img src="images/fha.jpg" width="245" height="25" /></p>
    <p>FHA loans are insured by the Federal Government.  You pay a mortgage insurance premium like on a conventional loan, but the FHA  program allows for a little more flexibility than most conventional plans.  There are maximum loan limits established depending on where you live. Typical  FHA loans are available with as little as a 3% down payment. FHA also has  rehabilitation loans available for owner occupants, lower down payment plans  for veterans and inexpensive homes, condominium and multi-family property  financing. </p>
    <p><img src="images/conventional.jpg" width="245" height="25" /></p>
    <p>Conventional loans are popular loans for most  people. Most programs require that you put at least 5% down. If you put less  than 20% down you will be required to pay a private mortgage insurance premium  to insure against default. Generally speaking, Conventional loans are more  difficult to qualify for than FHA loans.</p>
    <p><img src="images/va.jpg" width="245" height="25" /></p>
    <p>VA loans are available only to eligible veterans  and to the veteran's unmarried surviving spouse if the veteran died of a  service connected disability. The primary advantage of VA loans is that they  offer no down payment financing to the veteran. VA loans are almost always the  best way for a veteran to buy a home.</p>
    <p>


<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }



sub downpayment {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

    <h1><img src="images/downpaymenthelp.jpg" width="245" height="25" /></h1>
    <p><img src="images/huds100down.jpg" width="245" height="25" /></p>
    <p>As far as downpayment programs go - this HUD incentive is unbeatable. \$100 and you buy the house! What's the catch? None. HUD wants people to buy their homes, and they know they'll make more money off of you using one of their loans than they will off of a one time sale. Owner occupants only..</p>
    <p>\$100 Down payment for any HUD home purchased using FHA financing.</p>
    <p>\$2,500 Credit at closing to be used for closing costs, lower mortgage amount, and lender-approved repairs.</p>
<p><img src="images/ohfa.jpg" width="245" height="25" /></p>
    <p>The Ohio Housing Finance Agency program (OHFA) offers a  30-year, fixed-rate mortgage at a below market interest rate. The low interest  rate and fixed term enables the Agency to create homeownership opportunities  for those who could not otherwise afford to purchase a home.</p>
    <p>The current program provides home buyers with the  flexibility of choosing a mortgage rate that best fits their needs through a  two-tiered structure. This includes a 2% downpayment assistance grant to  qualified borrowers based on the purchase price of the home.</p>
    <p>The program is available to first-time homebuyers (persons  not owning or occupying their principle residence in the last three years), or  anyone purchasing a home in a targeted area.</p>
    <p><img src="images/charities.jpg" width="245" height="25" /></p>
    <p>The charitie programs are about to become a thing of the  past. The way the charitie programs like AmeriDream and Nehimeah work is that  the seller contributes 3% of the purchase price to one of these charities. The  charitie then turns around, and makes a donation to you so that you can make  your down payment on your home. The negative to this is that, as a buyer we  need to build the 3% contribution into the purchase price. Basically, if the  seller walks away with the same amount of money in their pocket - they don't  mind giving you a &quot;contribution&quot; of 3%.</p>
<p>The Fed's are in the midst of shutting these programs down  due to inflating home values. I don't have the crystal ball, but don't be too  surprised if the Feds put this termination on hold due to the current housing  crunch or even introduce a similiar program of their own.</p>
    <p>For now, the charities are there - in the coming months so  far as we know, they will no longer be exsitent. So use them while you still  can!</p>
    <p><img src="images/usda.jpg" width="245" height="25" /></p>
<p>USDA loans are from the Depratment of Agricultural. They are  intended for more rural areas and are target for those who's good credit and  steady income are not enough to qualify for a home loan at a commercial lending  institution, such as a bank, savings and loan or mortgage company.</p>
    <p>More rural families and individuals may be eligible to  become homeowners with the help of a USDA guaranteed home loan. When the  federal government agrees to guarantee a loan, lending institutions can help  buyers while incurring less risk. Through USDA’s Guaranteed Rural Housing Loan  Program, low- and moderate- income people can qualify for mortgages even  without a down payment.    </p>
    <p>


<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }



sub glossary {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

  <h3><a name="A" id="A"></a>A&nbsp;&nbsp;</h3>
  <dl>
    <dt> Abstract of Title </dt>
    <dd> The condensed history of a title to a particular parcel of real estate, consisting of a summary of the original grant and all subsequent conveyances and encumbrances affecting the property and a certification by the abstractor that the history is complete and accurate. </dd>
    <dt> Acceleration Clause </dt>
    <dd> The clause in a mortgage or deed of trust that can be enforced to make the entire debt due immediately if the borrower defaults on an installment payment or other covenant. </dd>
    <dt> Adjustable Rate Mortgage (Arm) </dt>
    <dd> A loan with an interest rate that fluctuates based on a specified financial index, such as Treasury securities, or the 11th District Cost of Funds, etc. </dd>
    <dt> Alienation Clause </dt>
    <dd> A term of a mortgage which requires that the borrower pay in full the principal and interest due upon the sale of the property. ( See Acceleration or Due-on-Sale Clause) </dd>
    <dt> Amortization </dt>
    <dd> The repayment of a debt in installments. </dd>
    <dt> Appraisal </dt>
    <dd> A valuation or an estimation of value of property by disinterested persons of suitable qualifications; the process of ascertaining a value of an asset or liability that involves expert opinion rather than explicit market transactions. </dd>
    <dt> Assessor </dt>
    <dd> A municipality employee who estimates the value of properties for the purpose of taxes. </dd>
    <dt> Assignment </dt>
    <dd> The method by which a right or contract is transferred from one person (the assignor) to another (the assignee). </dd>
    <dt> Assumable Mortgage </dt>
    <dd> A mortgage that can be taken over ("assumed") by the buyer when a home is sold. If interest rates have risen, an assumable mortgage at a low rate may prove a selling point for the property. </dd>
  </dl>
  <h3><a name="B" id="B"></a>B&nbsp;&nbsp;</h3>
  <dl>
    <dt> Balloon Payment </dt>
    <dd> A final payment of a mortgage loan that is considerably larger than the required periodic payments because the loan amount was not fully amortized. </dd>
    <dt> Bankruptcy </dt>
    <dd> An action filed in a federal bankruptcy court that allows a creditor to reorganize or discharge credit obligations due to insolvency. A property owner may halt foreclosure action by filing bankruptcy. Bankruptcies remain on a credit record for seven years and can severely limit a person's ability to borrow.
      <ul>
        <li> Chapter 7 - "Debtor Wipeout" The court oversees the liquidation of the debtors' non-exempt assets, distributing the cash proceeds proportionally amongst their creditors. </li>
        <li> Chapter 11 - This is a business reorganization proceeding. </li>
        <li> Chapter 13 - "Debtor Workout" This is the almost-automatic choice of most trustors seeking to use a bankruptcy filing to delay the in- evitable trustee's sale as long as they can. The purpose of this proceeding is to give a "wage earner" time for rehabilitation . . . a temporary respite free from the collection efforts of creditors. </li>
      </ul>
    </dd>
    <dt> BPO </dt>
    <dd> Brokers Price Opinion. (BPO) An appraisal of a property usually done by a real estate agent or broker. </dd>
    <dt> Breach </dt>
    <dd> The breaking or violating of a law, a right, obligation, engagement, or duty, either by commission or omission. </dd>
  </dl>
  <h3><a name="C" id="C"></a>C&nbsp;&nbsp;</h3>
  <dl>
    <dt> Certificate of Sale </dt>
    <dd> A certificate issued at a judicial sale that entitles the buyer to receive a deed after confirmation of court for the purchase of the property. </dd>
    <dt> Closing Costs </dt>
    <dd> Expenses supplementary to the sale of real estate, which includes loan, title and appraisal fees. </dd>
    <dt> Cloud on Title </dt>
    <dd> Any outstanding claim that contradicts the title record, if valid, would impair the owners title. </dd>
    <dt> Condemnation </dt>
    <dd> A judicial or administrative proceeding to exercise the power of eminent domain, through which a government agency takes private property for public use and compensates the owner. </dd>
    <dt> Contingency </dt>
    <dd> A specified condition that must be fulfilled before a contract becomes firm and binding. </dd>
    <dt> Contract </dt>
    <dd> An agreement between two or more persons that creates an obligation to do or not to do a particular thing. </dd>
    <dt> Conventional Loan </dt>
    <dd> A loan that requires no insurance or guarantees. </dd>
    <dt> Conveyance </dt>
    <dd> A written instrument that transfers title to or an interest in land from one party to another (i.e. a deed, an assignment, a bill of sale, etc.) </dd>
  </dl>
  <h3><a name="D" id="D"></a>D&nbsp;&nbsp;</h3>
  <dl>
    <dt> Debt Ratio </dt>
    <dd> To compare the total monthly payments of all of the borrower's debts (including the mortgage) with the gross monthly income of the borrower. It evaluates the borrower's ability to pay mortgage. Also called Debt-to-Income ratio. </dd>
    <dt> Debtor </dt>
    <dd> An entity that owes a debt; one who owes a debt. </dd>
    <dt> Decree of Foreclosure </dt>
    <dd> A court order to set out the outstanding amount on a delinquent mortgage in order to sell the property to pay the mortgagee. </dd>
    <dt> Deed </dt>
    <dd> A written instrument that, when executed and delivered, conveys title to or an interest in real estate. </dd>
    <dt> Deed in lieu of foreclosure </dt>
    <dd> A process whereby the owner, with the approval of the lender, deeds the property to the lender to avoid foreclosure. Lenders are generally reluctant to accept a "deed in lieu" unless the title is free and clear of any other encumbrances junior to theirs and the owners execute an estoppel affidavit acknowledging that they are acting volitionally, with informed consent. </dd>
    <dt> Default </dt>
    <dd> The failure to make payments in full, on time or at all or to live up to any other obligations placed on the borrower by the loan agreement. </dd>
    <dt> Deficiency judgment </dt>
    <dd> A judgment entered in a lawsuit when a property is sold for less than the amount of the loan. </dd>
    <dt> Delinquency </dt>
    <dd> A condition when the payment is being late but not yet in default. </dd>
    <dt> Demand Letter </dt>
    <dd> Also known as a Breach Letter or Notice of Intent to Foreclose. Notice to the borrower that he/she is in "breach" of the terms of the Note and advising of the right to "cure" the default. </dd>
    <dt> Due-on-Sale Clause </dt>
    <dd> A clause in a mortgage which requires that the mortgage be paid out in full upon the sale of the property. </dd>
    <dt> Due Diligence </dt>
    <dd> Such a measure of prudence, activity, or assiduity, as is properly to be expected from a reasonable and prudent man under the particular circumstance. </dd>
  </dl>
  <h3><a name="E" id="E"></a>E&nbsp;&nbsp;</h3>
  <dl>
    <dt> Earnest Money Deposit </dt>
    <dd> A deposit made by a purchaser of real estate used as a down payment as evidence of good faith. </dd>
    <dt> Easement </dt>
    <dd> A right of way allowing someone to cross over another's property for certain purposes, such as power lines or water mains. </dd>
    <dt> Encroachment </dt>
    <dd> A fixture that illegally intrudes into or invades the property or encloses a portion of it, diminishing its width or area. </dd>
    <dt> Encumbrance </dt>
    <dd> Anything, such as a mortgage, tax, or judgment lien, an easement, a restriction on the use of the land or an outstanding dower right that may diminish the value or use and enjoyment of a property. </dd>
    <dt> Equity </dt>
    <dd> The surplus of value which may remain after existing liens are deducted from the property. </dd>
    <dt> Escrow Account </dt>
    <dd> A bank account generally held in the name of the depositor and an escrow agent which is returnable to the depositor or paid to a third person on the fulfillment of a condition. </dd>
  </dl>
  <h3><a name="F" id="F"></a>F&nbsp;&nbsp;</h3>
  <dl>
    <dt> Fair Market Value </dt>
    <dd> The amount at which property would change hands between a willing buyer and a willing seller, neither being under any compulsion to buy or sell and both having reasonable knowledge of the relevant facts. </dd>
    <dt> Fannie Mae </dt>
    <dd> Its an official name of the Federal National Mortgage Association which is one of the largest agencies that buys mortgages from lenders and resells them as securities on the secondary mortgage market. </dd>
    <dt> FHA </dt>
    <dd> Stands for Federal Housing Administration. It's a branch of H.U.D. It's basic function is to direct housing in a way that Congress mandates by issuing mortgage insurance to institutional lenders on the loans they make. With such loan insurance, lenders are willing to lend with smaller down payments and at lower rates of interest. </dd>
    <dt> FHA Loans </dt>
    <dd> A loan program offering low-rate mortgages to buyers who are willing to make a down payment as small as 3 percent. </dd>
    <dt> First Mortgage </dt>
    <dd> A mortgage that is in first position and has priority as a lien over all other mortgages. </dd>
    <dt> Foreclosure </dt>
    <dd> A legal procedure whereby property used as security for a debt is sold to satisfy the debt in the event of default in payment of the mortgage note or default of other terms in the mortgage document. The foreclosure procedure brings the rights of all parties to a conclusion and passes the title in the mortgaged property to either the holder of the mortgage or a third party who may purchase the realty at the foreclosure sale, free of all encumbrances affecting the property subsequent to the mortgage. </dd>
  </dl>
  <h3><a name="G" id="G"></a>G&nbsp;&nbsp;</h3>
  <dl>
     <dt> Good Faith Estimate </dt>
    <dd> Institutional lender estimates the costs a borrower will incur, including inspection fees and loan-processing charges. </dd>
    <dt> Grantee </dt>
    <dd> The person (buyer) to whom the title of the property is granted. </dd>
    <dt> Grantor </dt>
    <dd> The person (seller) who grants title to another person (buyer). </dd>
  </dl>
  <h3><a name="H" id="H"></a>H&nbsp;&nbsp;</h3>
  <dl>
    <dt> Home Equity Loan </dt>
    <dd> Owners who borrow against the equity in their homes. </dd>
    <dt> HUD 1 Statement </dt>
    <dd> A form, usually given by a bank, that includes the costs of purchasing a home. </dd>
  </dl>
  <h3><a name="I" id="I"></a>I&nbsp;&nbsp;</h3>
  <dl>
    <dt> Instrument </dt>
    <dd> A legal written document. </dd>
  </dl>
  <h3><a name="J" id="J"></a>J&nbsp;&nbsp;</h3>
  <dl>
    <dt> Judgment </dt>
    <dd> The final decision of the court resolving the dispute and determining the rights and obligations of the parties. </dd>
    <dt> Judicial Foreclosure </dt>
    <dd> A foreclosure process which is executed via a court action. </dd>
    <dt> Junior lien </dt>
    <dd> A lien that is subordinate or junior to a senior lien. </dd>
  </dl>
  <h3><a name="L" id="L"></a>L&nbsp;&nbsp;</h3>
  <dl>
    <dt> Land Contract </dt>
    <dt> Lien </dt>
    <dd> A claim or charge on a property for payment of some debt, obligation or duty. </dd>
    <dt> <i>Lis pendens</i> </dt>
    <dd> A term meaning "legal action pending" that gives notice of an action or proceeding affecting the title of the property. </dd>
    <dt> Loss Mitigation Department </dt>
    <dd> A department which helps homeowners avoid foreclosure; the lender tries to help a borrower who has been unable to make loan payments and is in danger of defaulting on his or her loan </dd>
  </dl>
  <h3><a name="M" id="M"></a>M&nbsp;&nbsp;</h3>
  <dl>
    <dt> Marketable Title </dt>
    <dd> A title with no claims or defects that could otherwise hinder a property being sold. </dd>
    <dt> Mechanic's lien </dt>
    <dd> A claim created by state statutes for the purpose of securing priority of payment of the price or value of work performed and materials furnished in erecting or repairing a building or other structure, and as such, attaches to the land as well as buildings and improvements erected thereon. </dd>
    <dt> Mortgage </dt>
    <dd> An interest in land created by a written instrument providing security for the performance of a duty or the payment of a debt. </dd>
  </dl>
  <h3><a name="N" id="N"></a>N&nbsp;&nbsp;</h3>
  <dl>
    <dt> Notice of Default (NOD) </dt>
    <dd> A notice that is sent out by the lender when a mortgage payment is late in an attempt to cure or make the loan current. </dd>
    <dt> Notice of Sale </dt>
    <dd> The notice of an impending foreclosure sale required by the state. It recites the legal description of the property being foreclosed upon and gives the time, date and place of the pending sale. </dd>
  </dl>
  <h3><a name="O" id="O"></a>O&nbsp;&nbsp;</h3>
  <dl>
    <dt> Offer to Purchase </dt>
    <dd> A contract expressing of a person's willingness to purchase a certain property on terms expressed in the offer. </dd>
  </dl>
  <h3><a name="P" id="P"></a>P&nbsp;&nbsp;</h3>
  <dl>
    <dt> Power of Attorney </dt>
    <dd> A written document signed by the owner which authorizes someone else to act in behalf of the owner. Sometimes referred to as "POA" </dd>
    <dt> Power of Sale </dt>
    <dd> A clause commonly inserted in mortgages and deeds of trust that are in default, giving the mortgagee (or trustee) the right and power to advertise and sell the mortgaged property at public auction to satisfy the debt. </dd>
    <dt> Pre-Foreclosure </dt>
    <dd> Term used to discuss delinquent properties before they go to the foreclosure auction. </dd>
  </dl>
  <h3><a name="Q" id="Q"></a>Q&nbsp;&nbsp;</h3>
  <dl>
    <dt> Quit Claim Deed </dt>
    <dd> A deed of conveyance that releases any title, interest, or claim, which the grantor may have in the premises. </dd>
  </dl>
  <h3><a name="R" id="R"></a>R&nbsp;&nbsp;</h3>
  <dl>
    <dt> Real Estate Owned (REO) </dt>
    <dd> Property acquired back by the lender after it has gone to auction. </dd>
    <dt> Recorder </dt>
    <dd> A public official that is responsible for keeping all the records of real estate transactions. </dd>
    <dt> Redemption Period </dt>
    <dd> The time allotted to the mortgagor to reclaim his/her property after it has been sold at an auction. Not all states have a redemption period. </dd>
  </dl>
  <h3><a name="S" id="S"></a>S&nbsp;&nbsp;</h3>
  <dl>
    <dt> Second Mortgage </dt>
    <dd> A second loan placed upon a property in addition to an existing first loan. </dd>
    <dt> Sheriff's Sale </dt>
    <dd> The sale of a property to satisfy a debt or judgment. </dd>
    <dt> Short Sale </dt>
    <dd> The sale of a property under or at market value that's lower than the loan balance. </dd>
    <dt> Survey </dt>
    <dd> The process by which a parcel of land is measured and its boundaries and contents set forth. </dd>
  </dl>
  <h3><a name="T" id="T"></a>T&nbsp;&nbsp;</h3>
  <dl>
    <dt> Tax Deed </dt>
    <dd> A type of deed used to convey title after real property is sold at auction by public authority for non-payment of taxes. </dd>
    <dt> Tax Lien </dt>
    <dd> A lien on real estate in favor of a state or local government that may be foreclosed on for the non-payment of taxes. </dd>
    <dt> Title </dt>
    <dd> Evidence of ownership of land. </dd>
    <dt> Title Insurance </dt>
    <dd> An insurance policy that provides protection for lenders and buyers against any losses caused by defects in the title. </dd>
    <dt> Title Search </dt>
    <dd> A search within the public records to determine ownership and that there are no claims or liens against the property. </dd>
    <dt> Trust Account </dt>
    <dd> A special account used by a broker or escrow agent to safeguard funds for a buyer or seller. </dd>
  </dl>
  <h3><a name="U" id="U"></a>U&nbsp;&nbsp;</h3>
  <dl>
  </dl>
  <h3><a name="V" id="V"></a>V&nbsp;&nbsp;</h3>
  <dl>
    <dt> VA Loans </dt>
    <dd> A program that allows the purchase of a house without a down payment to most veterans. </dd>
   </dl>
  <h3><a name="W" id="W"></a>W&nbsp;&nbsp;</h3>
  <dl>
    <dt> Warranty Deed </dt>
    <dd> Deed in which the grantor warrants good clear title. </dd>
  </dl>


<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }


sub contact {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

    <h1><img src="images/contactus.jpg" width="230" height="25" /></h1>
    <form id="form1" name="CONTACT_ME" method="post" action="/cgi-bin/contact.pl">
      <table width="490" border="0">
        <tr>
          <td width="95" align="left" valign="top">First Name:</td>
          <td colspan="2"><label>
            <input type="text" name="fname" id="fname" />
          </label></td>
        </tr>
        <tr>
          <td width="95" align="left" valign="top">Last Name:</td>
          <td colspan="2"><label>
            <input type="text" name="lname" id="lname" />
          </label></td>
        </tr>
        <tr>
          <td align="left" valign="top">Email:</td>
          <td colspan="2"><label>
            <input type="text" name="email" id="email" />
          </label></td>
        </tr>
        <tr>
          <td align="left" valign="top">Phone:</td>
          <td colspan="2"><label>
            <input type="text" name="phone" id="phone3" />
          </label></td>
        </tr>
        <tr>
          <td align="left" valign="top">Message:</td>
          <td colspan="2"><textarea name="message" id="message" cols="45" rows="5"></textarea></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td width="333"><label>
            <input type="submit" name="button" id="button" value="Click to Send" />
          </label></td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>


<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }


sub buyer_credit {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->

<p class="subhead1"><b>\$8,000  Home Buyer Tax Credit at a Glance</b></p>
                  <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; color: #333333;">The information on this page pertains to the American Recovery and Reinvestment Act of 2009.</p>
                  <ul style="color:#333333;">
                    <li>The tax credit is for first-time home buyers only. For the tax credit program, the IRS defines a first-time home buyer as someone who has not owned a principal residence during the three-year period prior to the purchase.</li>
                    <li>The tax credit does not have to be repaid.</li>
                    <li>The tax credit is equal to 10 percent of the home&rsquo;s purchase price up to a maximum of \$8,000.</li>
                    <li>The credit is available for homes purchased on or after January 1, 2009 and before December 1, 2009.</li>
                    <li>Single taxpayers with incomes up to \$75,000 and married couples with incomes up to \$150,000 qualify for the full tax credit.</li>
                  </ul>
<P>
<p class="subhead1"><b>Frequently Asked Questions About the Home Buyer Tax Credit</b></p>
                        <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; color: #333333;">The American Recovery and Reinvestment Act of 2009 authorizes a tax credit of up to \$8,000 for qualified first-time home buyers purchasing a principal residence on or after January 1, 2009 and before December 1, 2009.<br /><br />The following questions and answers provide basic information about the tax credit. If you have more specific questions, we strongly encourage you to consult a qualified tax advisor or legal professional about your unique situation.</p>
                <!--content end -->
                        	<ol>
                                <li><a href="#1">Who is eligible to claim the tax credit?</a></li>
                                <li><a href="#2">What is the definition of a first-time home buyer?</a></li>
                                <li><a href="#3">How is the amount of the tax credit determined?</a></li>
                                <li><a href="#4">Are there any income limits for claiming the tax credit?</a></li>
                                <li><a href="#5">What is &quot;modified adjusted gross income&quot;?</a></li>
                                <li><a href="#6">If my modified adjusted gross income (MAGI) is above the limit, do I qualify for any tax credit?</a></li>
                                <li><a href="#7">Can you give me an example of how the partial tax credit is determined?</a></li>
                                <li><a href="#8">How is this home buyer tax credit different from the tax credit that Congress enacted in July of 2008?</a></li>
                                <li><a href="#9">How do I claim the tax credit? Do I need to complete a form or application?</a></li>
                                <li><a href="#10">What types of homes will qualify for the tax credit?</a></li>
                                <li><a href="#11">I read that the tax credit is &quot;refundable.&quot; What does that mean?</a></li>
                                <li><a href="#12">I purchased a home in early 2009 and have already filed to receive the \$7,500 tax credit on my 2008 tax returns. How can I claim the new \$8,000 tax credit instead?</a></li>
                                <li><a href="#13">Instead of buying a new home from a home builder, I hired a contractor to construct a home on a lot that I already own. Do I still qualify for the tax credit?</a></li>
                                <li><a href="#14">Can I claim the tax credit if I finance the purchase of my home under a mortgage revenue bond (MRB) program?</a></li>
                                <li><a href="#15">I am not a U.S. citizen. Can I claim the tax credit?</a></li>
                                <li><a href="#16">Is a tax credit the same as a tax deduction?</a></li>
                              <li><a href="#17">I bought a home in 2008. Do I qualify for this credit?</a></li>
                                <li><a href="#18">Is there any way for a home buyer to access the money allocable to the credit sooner than waiting to file their 2009 tax return?</a></li>
                                <li><a href="#19">The Secretary of Housing and Urban Development has announced that HUD will allow &quot;monetization&quot; of the tax credit. What does that mean?</a></li>
                                <li><a href="#20">If I&rsquo;m qualified for the tax credit and buy a home in 2009, can I apply the tax credit against my 2008 tax return?</a></li>
                                <li><a href="#12">For a home purchase in 2009, can I choose whether to treat the purchase as occurring in 2008 or 2009, depending on in which year my credit amount is the largest?</a></li>
                    		</ol>
           	<br />
                            <!--content start -->
                            <ol>
                                <li><a name="1" id="1"></a><b>Who is eligible to claim the tax credit?</b><br />
                                 First-time home buyers purchasing any kind of home new or resal are eligible for the tax credit. To qualify for the tax credit, a home purchase must occur on or after January 1, 2009 and before December 1, 2009. For the purposes of the tax credit, the purchase date is the date when closing occurs and the title to the property transfers to the home owner. A limited exception exists for certain contract for deed purchases and installment sale purchases. <a href="http://www.irs.gov/newsroom/article/0,,id=206291,00.html" target="_blank">See the IRS website for more detail</a>. <br />
                              <br /></li>
                                <li><a name="2" id="2"></a><b>What is the definition of a first-time home buyer?</b><br />
                               	 The law defines &quot;first-time home buyer&quot; as a buyer who has not owned a principal residence during the three-year period prior to the purchase. For married taxpayers, the law tests the homeownership history of both the home buyer and his/her spouse.<br /><br />For example, if you have not owned a home in the past three years but your spouse has owned a principal residence, neither you nor your spouse qualifies for the first-time home buyer tax credit. However, unmarried joint purchasers may allocate the credit amount to any buyer who qualifies as a first-time buyer, such as may occur if a parent jointly purchases a home with a son or daughter. Ownership of a vacation home or rental property not used as a principal residence does not disqualify a buyer as a first-time home buyer. <br /><br /></li>
                                <li><a name="3" id="3"></a><b>How is the amount of the tax credit determined?</b><br />
                           	   The tax credit is equal to 10 percent of the home&rsquo;s purchase price up to a maximum of \$8,000. <br /><br /></li>
                                <li><a name="4" id="4"></a><b>Are there any income limits for claiming the tax credit?</b><br />
                               	 Yes. The income limit for single taxpayers is \$75,000; the limit is \$150,000 for married taxpayers filing a joint return. The tax credit amount is reduced for buyers with a modified adjusted gross income (MAGI) of more than \$75,000 for single taxpayers and \$150,000 for married taxpayers filing a joint return.  The phaseout range for the tax credit program is equal to \$20,000. That is, the tax credit amount is reduced to zero for taxpayers with MAGI of more than \$95,000 (single) or \$170,000 (married) and is reduced proportionally for taxpayers with MAGIs between these amounts. <br /><br /></li>
                                <li><a name="5" id="5"><b></a>What is &quot;modified adjusted gross income&quot;?</b><br />
                           	     Modified adjusted gross income or MAGI is defined by the IRS. To find it, a taxpayer must first determine "adjusted gross income" or AGI. AGI is total income for a year minus certain deductions (known as "adjustments" or "above-the-line deductions"), but before itemized deductions from Schedule A or personal exemptions are subtracted. On Forms 1040 and 1040A, AGI is the last number on page 1 and first number on page 2 of the form. For Form 1040-EZ, AGI appears on line 4 (as of 2007). Note that AGI includes all forms of income including wages, salaries, interest income, dividends and capital gains.<br /><br />To determine modified adjusted gross income (MAGI), add to AGI certain amounts of foreign-earned income.  See IRS Form 5405 for more details. <br /><br /></li>
                                <li><a name="6" id="6"></a><b>If my modified adjusted gross income (MAGI) is above the limit, do I qualify for any tax credit?</b><br />
                               	 Possibly. It depends on your income. Partial credits of less than \$8,000 are available for some taxpayers whose MAGI exceeds the phaseout limits. <br /><br /></li>
                                <li><a name="7" id="7"></a><b>Can you give me an example of how the partial tax credit is determined?</b><br />
                               	 Just as an example, assume that a married couple has a modified adjusted gross income of \$160,000. The applicable phaseout to qualify for the tax credit is \$150,000, and the couple is \$10,000 over this amount. Dividing \$10,000 by the phaseout range of \$20,000 yields 0.5. When you subtract 0.5 from 1.0, the result is 0.5. To determine the amount of the partial first-time home buyer tax credit that is available to this couple, multiply \$8,000 by 0.5. The result is $\4,000.<br /><br />
                               	Here&rsquo;s another example: assume that an individual home buyer has a modified adjusted gross income of \$88,000. The buyer&rsquo;s income exceeds \$75,000 by \$13,000. Dividing \$13,000 by the phaseout range of \$20,000 yields 0.65. When you subtract 0.65 from 1.0, the result is 0.35. Multiplying \$8,000 by 0.35 shows that the buyer is eligible for a partial tax credit of \$2,800.<br />
                               	<br />Please remember that these examples are intended to provide a general idea of how the tax credit might be applied in different circumstances. You should always consult your tax advisor for information relating to your specific circumstances. <br /><br /></li>
                                <li><a name="8" id="8"></a><b>How is this home buyer tax credit different from the tax credit that Congress enacted in July of 2008?</b><br />
                               	 The most significant difference is that this tax credit does not have to be repaid. Because it had to be repaid, the previous &quot;credit&quot; was essentially an interest-free loan. This tax incentive is a true tax credit. However, home buyers must use the residence as a principal residence for at least three years or face recapture of the tax credit amount. Certain exceptions apply. <br /><br /></li>
                                <li><a name="9" id="9"></a><b>How do I claim the tax credit? Do I need to complete a form or application?</b><br />
                               	 Participating in the tax credit program is easy. You claim the tax credit on your federal income tax return. Specifically, home buyers should complete IRS Form 5405 to determine their tax credit amount, and then claim this amount on line 67 of the 1040 income tax form for 2009 returns (line 69 of the 1040 income tax form for 2008 returns). No other applications or forms are required, and no pre-approval is necessary. However, you will want to be sure that you qualify for the credit under the income limits and first-time home buyer tests. Note that you cannot claim the credit on Form 5405 for an intended purchase for some future date; it must be a completed purchase.  <br /><br /></li>
                                <li><a name="10" id="10"></a><b>What types of homes will qualify for the tax credit?</b><br />
                               	 Any home that will be used as a principal residence will qualify for the credit. This includes single-family detached homes, attached homes like townhouses and condominiums, manufactured homes (also known as mobile homes) and houseboats. The definition of principal residence is identical to the one used to determine whether you may qualify for the $250,000 / $500,000 capital gain tax exclusion for principal residences.<br /><br />It is important to note that you cannot purchase a home from your ancestors (parents, grandparents, etc.), your lineal descendants (children, grandchildren, etc.) or your spouse. Please consult with your tax advisor for more information. <a href="http://www.irs.gov/pub/irs-pdf/f5405.pdf">Also see IRS Form 5405</a>. <br /><br /></li>
                                <li><a name="11" id="11"></a><b>I read that the tax credit is &quot;refundable.&quot; What does that mean?</b><br />
                               	 The fact that the credit is refundable means that the home buyer credit can be claimed even if the taxpayer has little or no federal income tax liability to offset. Typically this involves the government sending the taxpayer a check for a portion or even all of the amount of the refundable tax credit.<br /><br />For example, if a qualified home buyer expected, notwithstanding the tax credit, federal income tax liability of \$5,000 and had tax withholding of \$4,000 for the year, then without the tax credit the taxpayer would owe the IRS \$1,000 on April 15th. Suppose now that the taxpayer qualified for the \$8,000 home buyer tax credit. As a result, the taxpayer would receive a check for \$7,000 (\$8,000 minus the \$1,000 owed). <br /><br /></li>
                                <li><a name="12" id="12"></a><b>I purchased a home in early 2009 and have already filed to receive the \$7,500 tax credit on my 2008 tax returns. How can I claim the new \$8,000 tax credit instead?</b><br />
                           	     Home buyers in this situation may file an amended 2008 tax return with a 1040X form.  You should consult with a tax advisor to ensure you file this return properly.  <br /><br /></li>
                                <li><a name="13" id="13"></a><b>Instead of buying a new home from a home builder, I hired a contractor to construct a home on a lot that I already own. Do I still qualify for the tax credit?</b><br />
                               	 Yes. For the purposes of the home buyer tax credit, a principal residence that is constructed by the home owner is treated by the tax code as having been &quot;purchased&quot; on the date the owner first occupies the house. In this situation, the date of first occupancy must be on or after January 1, 2009 and before December 1, 2009.<br /><br />In contrast, for newly-constructed homes bought from a home builder, eligibility for the tax credit is determined by the settlement date. <br /><br /></li>
                                <li><a name="14" id="14"></a><b>Can I claim the tax credit if I finance the purchase of my home under a mortgage revenue bond (MRB) program?</b><br />
                               	 Yes. The tax credit can be combined with the MRB home buyer program. Note that first-time home buyers who purchased a home in 2008 may <em>not</em> claim the tax credit if they are participating in an MRB program. <br />
                           	  <br /></li>
                                <li><a name="15" id="15"></a><b>I am not a U.S. citizen. Can I claim the tax credit?</b><br />
                           	     Maybe. Anyone who is not a nonresident alien (as defined by the IRS), who has not owned a principal residence in the previous three years and who meets the income limits test may claim the tax credit for a qualified home purchase. The IRS provides a definition of &quot;nonresident alien&quot; in IRS Publication 519. <br /><br /></li>
                                <li><a name="16" id="16"></a><b>Is a tax credit the same as a tax deduction?</b><br />
                           	     No. A tax credit is a dollar-for-dollar reduction in what the taxpayer owes. That means that a taxpayer who owes \$8,000 in income taxes and who receives an \$8,000 tax credit would owe nothing to the IRS.<br /><br />A tax deduction is subtracted from the amount of income that is taxed. Using the same example, assume the taxpayer is in the 15 percent tax bracket and owes \$8,000 in income taxes. If the taxpayer receives an \$8,000 deduction, the taxpayer&rsquo;s tax liability would be reduced by \$1,200 (15 percent of \$8,000), or lowered from \$8,000 to \$6,800. <br /><br /></li>
                              <li><a name="17" id="17"></a><b>I bought a home in 2008. Do I qualify for this credit?</b><br /> No, but if you purchased your first home between April 9, 2008 and January 1, 2009, you may qualify for a <a href="http://www.irs.gov/newsroom/article/0,,id=204671,00.html" target="_blank">different tax credit</a>. Please consult with your tax advisor for more information. <br /><br /></li>
                                <li><a name="18" id="18"></a><b>Is there any way for a home buyer to access the money allocable to the credit sooner than waiting to file their 2009 tax return?</b><br /> Yes. Prospective home buyers who believe they qualify for the tax credit are permitted to reduce their income tax withholding. Reducing tax withholding (up to the amount of the credit) will enable the buyer to accumulate cash by raising his/her take home pay. This money can then be applied to the downpayment.<br /><br />Buyers should adjust their withholding amount on their W-4 via their employer or through their quarterly estimated tax payment. IRS Publication 919 contains rules and guidelines for income tax withholding. Prospective home buyers should note that if income tax withholding is reduced and the tax credit qualified purchase does not occur, then the individual would be liable for repayment to the IRS of income tax and possible interest charges and penalties.<br /><br />
                                In addition, rule changes made as part of the economic stimulus legislation allow home buyers to claim the tax credit and participate in a program financed by tax-exempt bonds. As a result, some state housing finance agencies have introduced programs that provide short-term  second mortgage loans that may be used to fund a downpayment. In Ohio the 'Ohio Housing Finaance Association is able to use the First Time Home Buyer Tax Credit to help with your Down Payment and Closing Cost.  For more information about this program please <a href="http://www.ncsha.org/uploads/HTCA%20Announcement%20_2_.pdf" target="_blank">Click Here For More Information</a>. <br /><br /></li>

                                <li><a name="19" id="19"></a><b>The Secretary of Housing and Urban Development has announced that HUD will allow &quot;monetization&quot; of the tax credit. What does that mean?</b><br /> It means that HUD will allow buyers using FHA-insured mortgages to apply their anticipated tax credit toward their home purchase immediately rather than waiting until they file their 2009 income taxes to receive a refund. These funds may be used for certain downpayment and closing cost expenses.<br /><br />Under the guidelines announced by HUD, non-profits and FHA-approved lenders  will be allowed to give home buyers short-term loans of up to \$8,000.<br /><br />The guidelines also allow government agencies, such as state housing finance agencies, to facilitate home sales by providing longer term loans secured by second mortgages.<br /><br />Housing finance agencies and other government entities may also issue tax credit loans, which home buyers may use to satisfy the FHA 3.5 percent downpayment requirement.<br /><br />In addition, approved FHA lenders will also be able to purchase a home buyer&rsquo;s anticipated tax credit to pay closing costs and downpayment costs above the 3.5 percent downpayment that is required for FHA-insured homes.<br /><br /></li>
                                <li><a name="20" id="20"></a><b>If I&rsquo;m qualified for the tax credit and buy a home in 2009, can I apply the tax credit against my 2008 tax return?</b><br /> Yes. The law allows taxpayers to choose (&quot;elect&quot;) to treat qualified home purchases in 2009 as if the purchase occurred on December 31, 2008. This means that the 2008 income limit (MAGI) applies and the election accelerates when the credit can be claimed (tax filing for 2008 returns instead of for 2009 returns). A benefit of this election is that a home buyer in 2009 will know their 2008 MAGI with certainty, thereby helping the buyer know whether the income limit will reduce their credit amount.<br /><br />Taxpayers buying a home who wish to claim it on their 2008 tax return, but who have already submitted their 2008 return to the IRS, may file an amended 2008 return claiming the tax credit. You should consult with a tax professional to determine how to arrange this. <br /><br /></li>
                                <li><a name="21" id="21"></a><b>For a home purchase in 2009, can I choose whether to treat the purchase as occurring in 2008 or 2009, depending on in which year my credit amount is the largest?</b><br /> Yes. If the applicable income phaseout would reduce your home buyer tax credit amount in 2009 and a larger credit would be available using the 2008 MAGI amounts, then you can choose the year that yields the largest credit amount. </li>
                            </ol>
<!--content end -->




<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }


sub template {

    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
 <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
 <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body background="background.gif" bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>
<table width="800" bgcolor="#FFFFFF" border="0"><tr><td>
<table width=800><tr><td>
<img src="$url/$header" width="800" height="143" alt ="$page_title" border="0" align=""><br>
<table width=800><tr><td bgcolor=#990000><center><font size=4 color=#FFFFFF><b>$banner_ad</center></font></b></td></tr></table>
<br>

<center>
<table border=0><tr>
<!--
<td width=125 align=left valign=top>
<table border =0><tr><td>
<img src="/space.jpg" width="1" height="15" />
$navigation
</td></tr></table>
-->

</td><td width=675 valign=top>
<font size="3" face="Tahoma">
<!-- ===================================================================== -->




<!-- ===================================================================== -->
</td></tr></table>

<img src="/space.jpg" width="10" height="500" alt="" border="0" align="">
<br>
<center>
<font size=2 face="Tahoma">This web site courtesy of<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" />
$company<br>
$street<br>
$city<br>

<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></center>
</td></tr></table>
ENDHTML

print "</body>";
print "</html>";

 }




sub savesearch  {
$email_address = $form{'email'};

if ($email_address =~ /^[^@]+@([-\w]+\.)+[A-Za-z]{2,4}$/) {

my @names = split(/ /,$form{'fname'});
$fname_cap = ucfirst lc $names[0];
$lname_cap = ucfirst lc $names[1];

#if ($dayphone =~ /^(?:\(?([0-9]{3})\)?[-. ]?)?([0-9]{3})[-. ]?([0-9]{4})$/)
$dayphone = $form{'dayphone'};
if ($dayphone =~ m/\d/) {
    $dayphone = $form{'dayphone'};
} else {
    $dayphone = "";
    $lname_cap = ucfirst lc $form{'dayphone'};
    $form{'dayphone'} = "";
}

$city_name = $form{'city'};
$city_name =~ s/\s/%20/g;

$school_district = $form{'field30'};
$school_district =~ s/\s/%20/g;

$other_details = $form{'other_details'};
$other_details =~ s/\r\n|\n/<br>/g;


&assign_which_agent;
&insert_coh_saved_search;
&send_mail_savesearch;
&send_mail_savesearch2;


my $url = "http://$agent_agent_website/cgi-bin/public_search.cgi?action=resume_search&search_id=$search_id";
print "Location: $url\n\n";


#print "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=http://$agent_agent_website/cgi-bin/public_search.cgi?action=resume_search&search_id=$search_id\">\n";


      open(ASSIGNED, ">>$notesdatabase/$time_stamp.txt") || die('Cannot open output file');
      flock(ASSIGNED, LOCK_EX);
      print ASSIGNED "$time_stamp|$days[$wday] $months[$mon] $mday, $year|$hour\:$min|Client Assigned to $agent_username|Computer Generated|$form{'agent'}\n";
      close(ASSIGNED);

      open(ASSIGNEDB, ">>$notesdatabase/$time_stamp.txt") || die('Cannot open output file');
      flock(ASSIGNEDB, LOCK_EX);
      print ASSIGNEDB "$time_stamp|$days[$wday] $months[$mon] $mday, $year|$hour\:$min|$contents and Sent for $form{'city'}|Computer Generated|$form{'agent'}\n";
      close(ASSIGNEDB);

      open(ASSIGNEDC, ">>$notesdatabase/$time_stamp.txt") || die('Cannot open output file');
      flock(ASSIGNEDC, LOCK_EX);
      print ASSIGNEDC "$time_stamp|<b>EMAIL SENT: </b><br>$days[$wday] $months[$mon] $mday, $year|$hour\:$min|A Foreclosure list was sent.<br><a href=\"http://$agent_agent_website/cgi-bin/public_search.cgi?action=resume_search&search_id=$search_id\" target=new>Click Here To See The Foreclosure List That Was Sent</a>|Computer Generated|$form{'agent'}\n";
      close(ASSIGNEDC);

      chmod(0777, "$notesdatabase/$time_stamp.txt");

      $count=1;
       open (DATABASE, "$page4");
        while (<DATABASE>)
        {
       $count++;
      }
      close (DATABASE);


      open (FILE, ">>$page4");
      flock(FILE, LOCK_EX);
      print FILE "$count|$ENV{'REMOTE_ADDR'}|$time_stamp|$date|$fname_cap|$lname_cap||$form{'city'}|$dayphone|$form{'eveningphone'}|$form{'email'}|$form{'own_or_rent'}|$form{'min_price'}|$form{'max_price'}|$form{'style'}|$form{'min_bedrooms'}|$form{'min_bathrooms'}|$form{'garage'}|$form{'age_of_home'}|$other_details|$form{'website'}|$form{'pre_qualified'}|$form{'plan_to_buy'}|0|$form{'referrer'}|$form{'area'}|\n";
      close (FILE);

      open (FILE2, ">>$database");
      flock(FILE2, LOCK_EX);
      print FILE2 "$time_stamp|$date|$fname_cap|$lname_cap|$agent_username|$form{'city'}|$dayphone|$form{'eveningphone'}|$form{'email'}|$form{'own_or_rent'}|$form{'min_price'}|$form{'max_price'}|$form{'style'}|$form{'min_bedrooms'}|$form{'min_bathrooms'}|$form{'garage'}|$form{'age_of_home'}|$other_details|$form{'website'}|$form{'pre_qualified'}|$form{'plan_to_buy'}|0|$form{'referrer'}|$form{'area'}|$form{'field24'}|$yearA|$months[$monA]|$mdayA|yes|Computer Generated|$form{'field30'}|$form{'field31'}|$search_id|yes|$form{'field34'}|$followupdate||||$agent_username|\n";
      close (FILE2);

      open (FILE3, ">>$database_master");
      flock(FILE3, LOCK_EX);
      print FILE3 "$time_stamp|$date|$fname_cap|$lname_cap|$agent_username|$form{'city'}|$dayphone|$form{'eveningphone'}|$form{'email'}|$form{'own_or_rent'}|$form{'min_price'}|$form{'max_price'}|$form{'style'}|$form{'min_bedrooms'}|$form{'min_bathrooms'}|$form{'garage'}|$form{'age_of_home'}|$other_details|$form{'website'}|$form{'pre_qualified'}|$form{'plan_to_buy'}|0|$form{'referrer'}|$form{'area'}|$form{'field24'}|$yearA|$months[$monA]|$mdayA|yes|Computer Generated|$form{'field30'}|$form{'field31'}|$search_id|yes|$form{'field34'}|$followupdate||||$agent_username|\n";
      close (FILE3);

    $dbh = DBI->connect("DBI:mysql:database=$serverDb;host=$serverName;port=$serverPort;mysql_socket=$mysqlsocket",$serverUser,$serverPass);


    $SQL = "INSERT INTO `foreclosure_columbus` ( `id` , `date_entered` , `fname` , `lname` , `agent` , `area` , `phone` , `blank` , `email` , `rent_own` , `price_low` , `price_high` , `style` , `beds` , `baths` , `garage` , `age` , `remarks` , `web_page` , `pre_qual` , `plan_to_move` , `drip_email` , `referral_page` , `city_of_origin` , `lead_warmth` , `follow_up_year` , `follow_up_month` , `follow_up_day` , `send_drip_emails`, `team_leader` )
VALUES ('$time_stamp', '$date', '$fname_cap', '$lname_cap', '', '$form{'city'}', '$form{'dayphone'}', '$form{'eveningphone'}', '$form{'email'}', '$form{'own_or_rent'}', '$form{'min_price'}', '$form{'max_price'}', '$form{'style'}', '$form{'min_bedrooms'}', '$form{'min_bathrooms'}', '$form{'garage'}', '$form{'age_of_home'}', '$other_details', '$form{'website'}', '$form{'pre_qualified'}', '$form{'plan_to_buy'}', '0', '$form{'referrer'}', '$form{'area'}', '', '', '', '', '', '')";

$Select = $dbh->prepare($SQL);
$Select->execute();

$sth3 = $dbh->prepare("ALTER TABLE `foreclosure_columbus` ORDER BY `id` DESC");
$sth3->execute;

open(SORT_FILE, "$database");
flock(SORT_FILE, LOCK_EX);
$count=0;
@row1 =<SORT_FILE>;
close (SORT_FILE);

while (@row1[$count] ne "") {
        $row = @row1[$count];
        @row = split (/\|/, $row);
        $sortable_field = $row[$index_of_field_to_be_sorted_by];
        unshift (@row, $sortable_field);
        $new_row = join ("\|", @row);
        push (@new_rows, $new_row);
        $count++
        }

        @sorted_rows = reverse sort (@new_rows);

@database_rows = ();
 foreach $sorted_row (@sorted_rows) {
    @row = split (/\|/, $sorted_row);
    $sorted_field = shift (@row);
    $old_but_sorted_row = join ("\|", @row);
    push (@database_rows, $old_but_sorted_row);
    }

        open(PRINT_FILE, ">$database");
        flock(PRINT_FILE, LOCK_EX);
        print PRINT_FILE (@database_rows);
        close(PRINT_FILE);

}
elsif ($form{'email'} eq "") {
print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;
<link rel="shortcut icon" type="image/ico" href="images/favicon.ico" />
  <title>Columbus Ohio Foreclosure</title>

</head>
<body bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>

<center>
<table width="800" bgcolor="#ffffff" border="0"><tr><td>

<img src="http://www.columbusohioforeclosure.com/Foreclousre_banner_102708.jpg" width="800" height="143" alt="Columbus Ohio Foreclosure" border="0" align=""><br>

<font size="3" face="Tahoma, Verdana, Arial">

<P><center>
<font color=red size=5><b>Blank Email</font></b><P></center>
<font color=blue size=4>The email address appears to be Blank.  Please click the back button and supply a valid email address so we can send you a FREE list of Foreclosures.
<P>
</font></b>
<img src="/images/space.jpg" width="1" height="600" alt="" border="0" align="">
<center>
ColumbusOhioForeclosure.com is brought to you by<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" /><br>
iHome, REALTORS&reg;<br>
1565 Bethel Rd<br>
Columbus, Ohio 43220<br>
Office: 614-451-6616<br>
Fax: 614-451-9168
<p>
All offices independently owned and operated<br>
<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></p>
</center></td></tr></table></td></tr></tbody></table></center>
ENDHTML

print "</body>";
print "</html>";
 }

 else {
print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>$page_title</title>\n";

print <<ENDHTML;
<link rel="shortcut icon" type="image/ico" href="images/favicon.ico" />
  <title>Columbus Ohio Foreclosure</title>

</head>
<body bgcolor="#2762B0" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>

<center>
<table width="800" bgcolor="#ffffff" border="0"><tr><td>

<img src="http://www.columbusohioforeclosure.com/Foreclousre_banner_102708.jpg" width="800" height="143" alt="Columbus Ohio Foreclosure" border="0" align=""><br>

<font size="3" face="Tahoma, Verdana, Arial">

<P><center>
<font color=red size=5><b>Invalid Email</font></b><P></center>
<font color=blue size=4>The email address of <u>$form{'email'}</u> appears to be invalid.  Please click the back button and supply a valid email address so we can send you a FREE list of Foreclosures.
<P>
</font></b>
<img src="/images/space.jpg" width="1" height="600" alt="" border="0" align="">
<center>
ColumbusOhioForeclosure.com is brought to you by<br>
<img src="http://www.columbusohioforeclosure.com/images/iHome_logo_200.jpg" width="200" height="77" alt="" title="" border="0" /><br>
iHome, REALTORS&reg;<br>
1565 Bethel Rd<br>
Columbus, Ohio 43220<br>
Office: 614-451-6616<br>
Fax: 614-451-9168
<p>
All offices independently owned and operated<br>
<img src="/images/EqualHousing.jpg" width="64" height="58" alt="" border="0" align="">
</font></p>
</center></td></tr></table></td></tr></tbody></table></center>
ENDHTML

print "</body>";
print "</html>";
 }

}



sub signmeup {

      &send_mail_signmeup;
      &send_mail_signmeup2;

      print header;
      print start_html(-title=>'$page_title');

      print <<EOF;
      <script type='text/javascript'>
function closeWindow()
{
	window.focus();
	window.close();
}
</script>
EOF

      print "</head><body>\n";
      print "<p>&nbsp<P><center><P><font size=5 color=blue><b>Thank You</b></font>\n";
      print "<P><font size=4 color=blue>Your Request Has Been Recieved</font>\n";
      print "<P><font size=3 color=blue>You should begin to receive automatic updates shortly</font>\n";
      print "<p>&nbsp<P><input type='button' class='formButton' name='closeWindowButton' value='Close Window' onClick=\"closeWindow();\"><P></center>\n";
      print "</body></html>\n";

      open (FILE, ">>$database");
      flock(FILE, LOCK_EX);
      print FILE "Sign Me Up|$date|$form{'First_Name'}|$form{'Last_Name'}|$form{'phone'}|$form{'email'}|$form{'property_type'}|$form{'property_id'}|$form{'address'}|$form{'zip_code'}|$form{'city'}|$form{'county'}|$form{'min_price'}|$form{'max_price'}|$form{'min_bedrooms'}|$form{'min_bathrooms'}|$ENV{'REMOTE_ADDR'}\n";
      close (FILE);


}


sub free_report {

      &send_mail_free_report;
      &send_mail_free_report2;

      print header;
      print start_html(-title=>'$page_title');

      print <<EOF;
      <script type='text/javascript'>
function closeWindow()
{
	window.focus();
	window.close();
}
</script>
EOF

      print "</head><body>\n";
      print "<p>&nbsp<P><center><P><font size=5 color=blue><b>Thank You</b></font>\n";
      print "<P><font size=4 color=blue>Your Request Has Been Recieved</font>\n";
      print "<P><font size=3 color=blue>A link for your free report has been sent to your email</font>\n";
      print "<p>&nbsp<P><input type='button' class='formButton' name='closeWindowButton' value='Close Window' onClick=\"closeWindow();\"><P></center>\n";
      print "</body></html>\n";

      open (FILE, ">>$database");
      flock(FILE, LOCK_EX);
      print FILE "$form{'free_report'} FREE REPORT|$date|$form{'First_Name'}|$form{'Last_Name'}|$form{'phone'}|$form{'email'}\n";
      close (FILE);


}


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

sub send_mail_savesearch  {

      open(MAIL,"|$mailprog -t");
      print MAIL "To: dbarlow39\@att.blackberry.net\n";
      print MAIL "From: dbarlow39\@att.blackberry.net\n";
      print MAIL "Subject: Foreclosure Mail from $form{'city'}\n\n";
      print MAIL "http://www.columbusohioforeclosure.com/cgi-bin/admin.pl?row_to_view=$time_stamp&user=dbarlow&password=wu1274\n\n";
      print MAIL "Name: $fname_cap $lname_cap\n";
      print MAIL "Email: $form{'email'}\n";
      print MAIL "Best Phone No.: $form{'dayphone'}\n";
      print MAIL "Own or Rent: $form{'own_or_rent'}\n";
      print MAIL "Pre-Approved: $form{'pre_qualified'}\n";
      print MAIL "Plan to Buy: $form{'plan_to_buy'}\n";
      print MAIL "City: $form{'city'}\n";
      print MAIL "Style: $form{'style'}\n";
      print MAIL "Min Price: $form{'min_price'}\n";
      print MAIL "Max Price: $form{'max_price'}\n";
      print MAIL "Min Beds: $form{'min_bedrooms'}\n";
      print MAIL "Min Baths: $form{'min_bathrooms'}\n";
      print MAIL "Garage: $form{'garage'}\n";
      print MAIL "Age of Home: $form{'age_of_home'}\n";
      print MAIL "Other Details: $form{'other_details'}\n";
      close (MAIL);


      open(MAILB,"|$mailprog -t");
      print MAILB "To: $agent_email,dbarlow\@barlow.com\n";
      print MAILB "From: NewClient\@ColumbusOhioForeclosure.com\n";
      print MAILB "Subject: New Foreclosure Client\n\n";
      print MAILB "http://www.columbusohioforeclosure.com/cgi-bin/admin.pl?row_to_view=$time_stamp&user=$agent_user&password=$agent_password\n\n";
      print MAILB "Name: $fname_cap $lname_cap\n";
      print MAILB "Email: $form{'email'}\n";
      print MAILB "Best Phone No.: $form{'dayphone'}\n";
      print MAILB "Own or Rent: $form{'own_or_rent'}\n";
      print MAILB "Pre-Approved: $form{'pre_qualified'}\n";
      print MAILB "Plan to Buy: $form{'plan_to_buy'}\n";
      print MAILB "City: $form{'city'}\n";
      print MAILB "Style: $form{'style'}\n";
      print MAILB "Min Price: $form{'min_price'}\n";
      print MAILB "Max Price: $form{'max_price'}\n";
      print MAILB "Min Beds: $form{'min_bedrooms'}\n";
      print MAILB "Min Baths: $form{'min_bathrooms'}\n";
      print MAILB "Garage: $form{'garage'}\n";
      print MAILB "Age of Home: $form{'age_of_home'}\n";
      print MAILB "Other Details: $form{'other_details'}\n";
      close (MAILB);


      open(MAILC,"|$mailprog -t");
      print MAILC "To: $agent_text\n";
      print MAILC "From: $newclient_email\n";
      print MAILC "Subject: $data Foreclosure\n\n";
      print MAILC "http://www.columbusohioforeclosure.com/cgi-bin/admin.pl?row_to_view=$time_stamp&user=$agent_user&password=$agent_password\n\n";
      print MAILC "Name: $fname_cap $lname_cap\n";
      print MAILC "Phone: $form{'dayphone'}\n";
      print MAILC "Email: $form{'email'}\n";
      close (MAILC);

   }

#88888888888888888888888888888888888888888888888888888888888888888888888888888
#88888888888888888888888888888888888888888888888888888888888888888888888888888
sub send_mail_savesearch2 {

open(MAIL,"|$mailprog -t");
print MAIL "To: $form{'email'}\n";
print MAIL "From: $agent_email\n";
print MAIL "Bcc: $agent_email,dbarlow\@barlow.com\n";
print MAIL "Subject: Here is Your Free List of Foreclosures\n";
print MAIL "Content-Type: text/html; charset=\"us-ascii\"\n\n";
print MAIL "<HTML><HEAD><TITLE>Mail From $agent_username</TITLE>\n";
print MAIL "<BODY bgcolor=\"#2762B0\">\n";
print MAIL "<TABLE bgcolor=\"#ffffff\" style=\"FONT-FAMILY: Arial, Helvetica, sans-serif\" cellSpacing=\"0\" cellPadding=\"3\" width=\"800\" border=1>\n";
print MAIL "<TBODY><TR><TD>\n";
if ($form{'field7'} eq "HOME-SEARCH") {
print MAIL "<img src=\"$url/$homesearch_banner\" width=\"798\" height=\"203\" alt =\"$sitename\" border=\"0\" align=\"\"><br>\n";  }
elsif ($form{'field7'} eq "Hot-New-Listing") {
print MAIL "<img src=\"$url/$hotnewlisting_banner\" width=\"798\" height=\"203\" alt =\"$sitename\" border=\"0\" align=\"\"><br>\n";
} else {
print MAIL "<img src=\"$url/$banner\" width=\"800\" height=\"143\" alt =\"$sitename\" border=\"0\" align=\"\"><br>\n";  }
      print MAIL "Hi $fname_cap,<P>\n";
      print MAIL "My name is $agent_username and here is the FREE list of Foreclosures you asked for in the $form{'city'} area.<P>Based on the search criteria you submitted on our web site please click on the link below to be see your FREE list of foreclosures;<br>
<a href=\"http://$agent_agent_website/cgi-bin/public_search.cgi?action=resume_search&search_id=$search_id\">Click Here For Your Personal Foreclosure List</a><P>If for some reason you would like to change your search criteria please let me know and I will be happy to take care of that for you.<P>If you have any questions or would like to take a look at any of these properties please email me or give me a call on my cell phone at $agent_cell and we'll set an appointment to go take a look. \n";
      print MAIL "Thanks and take care,<br>\n";
      print MAIL "<img src=\"$url/$agent_agent_photo\" border=\"0\" align=\"\"><br>\n";
      print MAIL "$agent_username<br>\n";
      print MAIL "Foreclosure Specialist<br>\n";
      print MAIL "cell phone: $agent_cell<br>\n";
      print MAIL "<a href=\"http://$agent_agent_website\">$agent_agent_website</a> <P><br><P><br><P><br><P><br><P><br><P><br><P><br><P><br><P><br><P><br><P><br><P>\n";
      print MAIL "in association with<br>\n";
      print MAIL "$company<br>\n";
      print MAIL "$street<br>\n";
      print MAIL "$city<br>\n";
      print MAIL "$phone<br>\n";

      print MAIL "HOW DID YOU GET ON OUR MAILING LIST? You or someone you know subscribed your name and email through our web site at http://$web_address to receieve foreclosure listings.<P>\n\n";
      print MAIL "To unsubscribe from receiving any future emails from us please click the link below and you will be automatically unsubscribed. If the link below does not work or is broken please copy and paste the link into your web browser.<br>\n";
      print MAIL "$url/cgi-bin/unsubscribe.pl?email=$field[8]&fname=$field[2]&lname=$field[3]&webpage=Here-is-Your-FREE-List-of-Homes<P>";

if ($form{'field7'} eq "HOME-SEARCH") {
      print MAIL "<img src=\"$url/cgi-bin/emailtracker.pl?ID=$time_stamp&email=$form{'email'}&campaign=Here-is-Your-FREE-List-of-Homes&email_subject=Here-is-Your-FREE-List-of-Homes\" width=1 height=1 border=0><br>\n";
      } elsif ($form{'field7'} eq "Hot-New-Listing") {
      print MAIL "<img src=\"$url/cgi-bin/emailtracker.pl?ID=$time_stamp&email=$form{'email'}&campaign=Here-is-your-Hot-New-List&email_subject=Here-is-your-Hot-New-List\" width=1 height=1 border=0><br>\n";
      }else {
      print MAIL "<img src=\"$url/cgi-bin/emailtracker.pl?ID=$time_stamp&email=$form{'email'}&campaign=Here-is-Your-FREE-List-of-Foreclosures&email_subject=Here-is-Your-FREE-List-of-Foreclosures\" width=1 height=1 border=0><br>\n";
      }


print MAIL "</TD></TR></TBODY></TABLE><br>\n";
print MAIL "</BODY></HTML>\n";

   close (MAIL);
}


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

sub send_mail_signmeup {

      open(MAIL,"|$mailprog -t");
      print MAIL "To: $admin_email\n";
      print MAIL "From: $form{'email'}\n";
      print MAIL "Subject: $page_title Lead\n\n";
      print MAIL "This is a new mail from $page_title\n ";
      print MAIL "'SIGN ME UP'\n";
      print MAIL "$date\n\n";
      print MAIL "Name: $form{'fname'} $form{'lname'}\n";
      print MAIL "Phone: $form{'phone'}\n";
      print MAIL "Email: $form{'email'}\n\n\n";
      print MAIL "Here are the property details\n";
      print MAIL "Own or Rent: $form{'own_or_rent'}\n";
      print MAIL "Min Price: $form{'minimumprice'}\n";
      print MAIL "Max Price: $form{'maximumprice'}\n";
      print MAIL "Location: $form{'location'}\n";
      print MAIL "Style: $form{'style'}\n";
      print MAIL "Bedrooms: $form{'BedRooms'}\n";
      print MAIL "Bathrooms: $form{'BathRooms'}\n";
      print MAIL "Garage: $form{'Garage'}\n";
      print MAIL "Message: $form{'message'}\n";
      close (MAIL);

   }

#88888888888888888888888888888888888888888888888888888888888888888888888888888
#88888888888888888888888888888888888888888888888888888888888888888888888888888

sub send_mail_signmeup2 {

      open(MAIL2,"|$mailprog -t");
      print MAIL2 "To: $form{'email'}\n";
      print MAIL2 "From: $admin_email\n";
      print MAIL2 "Subject: $page_title Lead\n\n";

      print MAIL2 "Hi $form{'fname'},\n\n";
      print MAIL2 "Did you know that by using one of our professional Real Estate Agents to help you buy your next home that we will pay you up to \$1000.00 at closing.  One of our professional real estate agents will be making contact with you very shortly to confirm the information you have submitted for your home search.  And be sure to ask them how you can recieve up to \$1000 at closing with no strings attached.\n\n";
      print MAIL2 "You may already know the best homes may not be on the Web yet or worst yet they may already be sold by the time you see them.  Many search engines are not updated for a day or two or sometimes even weeks and many of the best home are already sold.  By working with an experienced REALTORS� from $company you receive the very latest listings automatically as they are put in to the Cincinnati Board of REALTORS� MLS.\n\n";
      print MAIL2 "If you should have any questions please feel free to email me or call me at my office at (513) 367-2171.\n\n";
      print MAIL2 "Thanks and have a great day\n\n";
      print MAIL2 "$admin_name\n";
      print MAIL2 "$company\n";
      print MAIL2 "$admin_email\n";

}


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

sub send_mail_free_report {

      open(MAIL,"|$mailprog -t");
      print MAIL "To: dbarlow\@iHomeREALTORS.com\n";
      print MAIL "From: $form{'email'}\n";
      print MAIL "Subject: Request for FREE Report\n\n";

      print MAIL "This is a request for a FREE Report\n ";
      print MAIL "$date\n\n";
      print MAIL "Name: $form{'First_Name'} $form{'Last_Name'}\n";
      print MAIL "Phone: $form{'phone'}\n";
      print MAIL "Email: $form{'email'}\n\n";
      print MAIL "This client requested the $form{'free_report'} FREE Report\n\n";

      close (MAIL);

   }

#88888888888888888888888888888888888888888888888888888888888888888888888888888
#88888888888888888888888888888888888888888888888888888888888888888888888888888

sub send_mail_free_report2 {

      open(MAIL2,"|$mailprog -t");
      print MAIL2 "To: $form{'email'}\n";
      print MAIL2 "From: dbarlow\@iHomeREALTORS.com\n";
      print MAIL2 "Subject: Your requested Free Report\n\n";

      print MAIL2 "Hi $form{'First_Name'},\n\n";
      print MAIL2 "Thanks for requesting my free report.  As you already know 'Knowledge is Power' and by requesting this report you have taken a great step towards educating yourself about the process of buying and selling real estate\n\n";
      print MAIL2 "Over the last 11 years in the real estate business I have helped over 1000 people just like you buy and sell real estate in The Cincinnati MLS.  I have developed a tremendous amount of knowledge through every one of those transactions.  I have written this free report with future home buyers like you in mind, to help navigate you through the complex home buying process\n\n";
      print MAIL2 "Please enjoy the report and if you should have any questions or would like to further discuss the home buying process please do not hesitate to give me a call at (513) 367-2171.\n\n";
      print MAIL2 "Here is the link to your free report\n";
      print MAIL2 "$url/reports/$form{'free_report'}.pdf\n\n";
      print MAIL2 "Thanks and have a great day\n\n";
      print MAIL2 "Dave Barlow\n";
      print MAIL2 "$company\n";
      print MAIL2 "$phone\n";

}



#88888888888888888888888888888888888888888888888888888888888888888888888888888
#88888888888888888888888888888888888888888888888888888888888888888888888888888

sub error {

   ($error,@error_fields) = @_;

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

   if ($error eq 'bad_referer') {
      print "<html>\n <head>\n  <title>Bad Referrer - Access Denied</title>\n </head>\n";
      print " <body>\n  <center>\n   <h1>Bad Referrer - Access Denied</h1>\n  </center>\n";
      print "The form that is trying to use this <a href=\"http://www.worldwidemart.com/scripts/\">FormMail Program</a>\n";
      print "resides at: $ENV{'HTTP_REFERER'}, which is not allowed to access this cgi script.<p>\n";
      print "Sorry!\n";
      print "</body></html>\n";
   }

   elsif ($error eq 'request_method') {
      print "<html>\n <head>\n  <title>Error: Request Method</title>\n </head>\n";
      print "</head>\n <body";

      # Get Body Tag Attributes
      &body_attributes;

      # Close Body Tag
      print ">\n <center>\n\n";

      print "   <h1>Error: Request Method</h1>\n  </center>\n\n";
      print "The Request Method of the Form you submitted did not match\n";
      print "either GET or POST.  Please check the form, and make sure the\n";
      print "method= statement is in upper case and matches GET or POST.\n";
      print "<p><hr size=7 width=75%><p>\n";
      print "<ul>\n";
      print "<li><a href=\"$ENV{'HTTP_REFERER'}\">Back to the Submission Form</a>\n";
      print "</ul>\n";
      print "</body></html>\n";
   }

   elsif ($error eq 'missing_fields') {

      print "<html>\n <head>\n  <title>Error: Blank Fields</title>\n </head>\n";
      print " </head>\n <body";

      # Get Body Tag Attributes
      &body_attributes;

      # Close Body Tag
      print ">\n  <center>\n";

      print "   <h1>Error: Blank Fields</h1>\n\n";
      print "The following fields were left blank in your submission form:<p>\n";

      # Print Out Missing Fields in a List.
      print "<ul>\n";
      foreach $missing_field (@error_fields) {
         print "<li>$missing_field\n";
      }
      print "</ul>\n";

      # Provide Explanation for Error and Offer Link Back to Form.
      print "<p><hr size=7 width=75\%><p>\n";
      print "These fields must be filled out before you can successfully submit\n";
      print "the form.  Please return to the <a href=\"$ENV{'HTTP_REFERER'}\">Fill Out Form</a> and try again.\n";
      print "</body></html>\n";
   }
   exit;
}

sub navigation {

$navigation ="<ul id=\"MenuBar1\" class=\"MenuBarVertical\">
       <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&home=hme&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">Home Page</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&search=srch\">Search Homes</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&8000credit=8000cred&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">\$8000 First Time Home Buyer Credit</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&basics=bascs&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">Foreclosure Basics</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&how=hw&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">How To Buy</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&finance=fince&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">Financing 101</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&downpayment=dwn&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">Downpayment Help</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&glossary=glss&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">Glossary</a></li>
	   <li><a href=\"$url/cgi-bin/foreclosure.pl?session=rur7t75h4rkcpou0ycmvm9586jrkdfhgf89rju509ieumt&return=Y&contact=cont&banner=$header&referrer=$form{'referrer'}&website=$form{'website'}\">Contact</a></li>
   </ul>";

   }

sub reverse_id {

my $res = Net::DNS::Resolver->new;# create the reverse lookup DNS name (note that the octets in the IP address need to be reversed).
my $IP = "$ENV{'REMOTE_ADDR'}";
my $target_IP = join('.', reverse split(/\./, $IP)).".in-addr.arpa";
my $query = $res->query("$target_IP", "PTR");
if ($query) {  foreach my $rr ($query->answer) {    next unless $rr->type eq "PTR";

$reverseIP = $rr->rdatastr;

#print $rr->rdatastr, "\n";  }} else {  warn "query failed: ", $res->errorstring, "\n";}
}}

}


sub insert_coh_saved_search {
$troubleshooting = "off";

	if ($troubleshooting eq "on"){

	print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>Trouble Shoot</title>\n";
    print "</head>\n";
	print "<body>\n<p align=center><font size=5><b>CONNECT_TO_DB</b></font></p><br>\n";
	}

        $dbh = DBI->connect("DBI:mysql:database=$serverDb;host=$serverName;port=$serverPort;mysql_socket=$mysqlsocket",$serverUser,$serverPass);
	if ($troubleshooting eq "on"){print "$dbh = DBI->connect(\"DBI:mysql:database=$serverDb;host=$serverName;port=$serverPort\",$serverUser,$serverPass);<br>"
	}
	# MS/2010-01-15 <-  we need to match against the agent_username text value stored in coh_agents to find the correct agent_mls
	$sth_team = $dbh->prepare("SELECT la.agent_mls FROM coh_listing_agents la LEFT JOIN coh_agents a On la.agent_mls = a.agent_mls WHERE a.agent_name = '$agent_username' AND (la.agent_mls = a.agent_mls)");

	if ($troubleshooting eq "on"){
	print "$sth_team = $dbh->prepare(\"SELECT la.agent_mls FROM coh_listing_agents la LEFT JOIN coh_agents a On la.agent_mls = a.agent_mls WHERE a.agent_name = '$agent_username' AND (la.agent_mls = a.agent_mls)\");<p>"
	}
    $sth_team->execute;

   @u_profile = $sth_team->fetchrow_array;
   	$agent_mls = $u_profile[0];

   	unless ($agent_mls) {
   	$agent_mls = "2005001037";
   	}


$update_stamp = "$year-$mon-$mday $hour:$min:$sec";
      	$success = $dbh->do("INSERT INTO coh_leads(lead_id, password, first_name, last_name, lead_phone, lead_email, lead_address, lead_city, lead_state, lead_zip, mail_option, report_option, lead_type, lead_services, agent_mls, update_stamp, creation_stamp, admin_stamp)
       	VALUES('$time_stamp', 'password', '$fname_cap', '$lname_cap', '$form{'dayphone'}', '$form{'email'}', '', '$form{'city'}', '', '', 'yes', 'yes', 'PROSPECT', '', '$agent_mls', '$update_stamp', '$update_stamp', '25')");
 	$print_sql = "<font color=red><b>INSERT</b></font> INTO coh_leads(lead_id, password, first_name, last_name, lead_phone, lead_email, lead_address, lead_city, lead_state, lead_zip, mail_option, report_option, lead_type, lead_services, agent_mls, update_stamp, creation_stamp, admin_stamp)
       	VALUES('$time_stamp', 'password', '$fname_cap', '$lname_cap', '$form{'dayphone'}', '$form{'email'}', '', '$form{'city'}', '', '', 'yes', 'yes', 'PROSPECT', '', '$agent_mls', '$update_stamp', '$update_stamp', '25')<br>";

$zip_codes = $form{zips};
$zip_codes =~ s/\ /\|/g;
$zip_codes =~ s/\,//g;

$cityB = $form{zips};
foreach $find (@cgiPairs) {
	if ($find =~ "city") {
	$find =~ s/city=//g;
	$find =~ s/\+/\ /g;
#	$find =~ tr/\ //;
#	$find =~ s/\ //g;
	if ($troubleshooting eq "on") {
	print "SEARCH SAVER city $find<p>";
	}

if ($find eq 'Northeast') {
$zip_codes .= "|43230|43229|43231|43224|43211|43219"; # MS/2009-12-18 <- changed $zip_code variable from equals to append, so it will grow if any there match is found
$find = ""; # MS/2009-12-18 <- changed $cities to $find so multiple city-areas can be used with cities in any combination
}
if ($find eq "Northwest") {
$zip_codes .= "|43085|43214|43235|43202|43221|43220|43026|43016|43017";
$find = "";
}
if ($find eq "Southeast") {
$zip_codes .= "|43232|43227|43209|43205|43203|43207";
$find = "";
}
if ($find eq "Southwest") {
$zip_codes .= "|43204|43228|43223|43123|43119";
$find = "";
}
if ($find eq "NorthColumbus") {
$zip_codes .= "|43225|43214|43229|43231|43085";
$find = "";
}
if ($find eq "SouthColumbus") {
$zip_codes .= "|43206|43207|43223";
$find = "";
}
if ($find eq "EastColumbus") {
$zip_codes .= "|43205|43209|43227|43213|43203";
$find = "";
}
if ($find eq "WestColumbus") {
$zip_codes .= "|43204|43228|43291|43119|43026";
$find = "";
}
if ($find eq "Clintonville") {
$zip_codes .= "|43214";
$find = "";
}
if ($find eq "German Village") {
$zip_codes .= "|43203|43205";
$find = "";
}
if ($find eq "New Rome") {
$zip_codes .= "|43228";
$find = "";
}
	if ($find) { # MS/2009-12-18 <- we only want to add to real cities to $cities, not city-areas. our code above blanks out $find if it matches city-areas we have defined and converts them to zip codes.
	$cities .= "|$find";
	}

	}
	if ($find =~ "field30") {
	$find =~ s/field30=//g;
	$find =~ s/\+/\ /g;
# 	$find =~ tr/\ //;
# 	$find =~ s/\ //g;
	if ($troubleshooting eq "on") {
	print "SEARCH SAVER field30 $find<p>";
	}
	$school_districts .= "|$find";
	}
}

$bedrooms = $form{'min_bedrooms'};
$bedrooms =~ s/\D+//g;
$bedrooms = ""; # MS/2009-12-18 <- we don't want to pass bedrooms through anymore, but we might change our minds in the future, so leave the number stripping
$bathrooms = $form{'min_bathrooms'};
$bathrooms =~ s/\D+//g;
$bathrooms = ""; # MS/2009-12-18 <- we don't want to pass bathrooms through anymore, but we might change our minds in the future, so leave the number stripping
# $form{field10}', '$form{field11}
$min_price = $form{'min_price'};
$min_price =~ s/\D+//g;
if ($min_price eq "") {
$min_price = 0;
}
$max_price = $form{'max_price'};
$max_price =~ s/\D+//g;
if ($max_price eq "") {
$max_price = 1000000;
}

$mls_write_up = "as-is short approval hud foreclosure foreclose bank addendum tlc fixer approved rehab investment corporate reo handyman auction homepath";

$URL = "http://www.columbusohioforeclosure.com/cgi-bin/public_search.cgi?action=search_results&search_or-city=$form{'city'}&min_price=$min_price&max_price=$max_price&search_or-zip_code=$zip_codes&search_and-mls_write_up='as-is short approval hud foreclosure foreclose bank addendum tlc fixer approved rehab investment corporate reo handyman auction homepath'";

$contents = get($URL);


	$success = $dbh->do("INSERT INTO coh_lead_search_stats(search_id, lead_id, visitor_ip, session_num, cities, zip_code, subdivision, school_districts, bedrooms, bathrooms, general_type, specific_type, mls_write_up, coded_values, min_price, max_price, sort_by, order_by, update_stamp)
	VALUES('', '$time_stamp', 'agent_saved', 'agent_saved', '$cities ', '$zip_codes', '', '$school_districts', '$bedrooms', '$bathrooms', 'res', '', '$mls_write_up', '', '$min_price', '$max_price', 'list_price', 'ASC', '$update_stamp')");
        if ($troubleshooting eq "on"){
     		print "INSERT INTO coh_lead_search_stats(search_id, lead_id, visitor_ip, session_num, cities, zip_code, subdivision, school_districts, bedrooms, bathrooms, general_type, specific_type, mls_write_up, coded_values, min_price, max_price, sort_by, order_by, update_stamp)
	VALUES('', '$time_stamp', 'agent_saved', 'agent_saved', '$cities ', '$zip_codes', '', '$school_districts', '$bedrooms', '$bathrooms', 'res', '', '$mls_write_up', '', '$min_price', '$max_price', 'list_price', 'ASC', '$update_stamp')<p>";
			}
			my $sth_last = $dbh->prepare("SELECT LAST_INSERT_ID()");
			$sth_last->execute;
			$search_id = $sth_last->fetchrow_array;
			$search_name = "Search $input{search_id} $update_stamp";
	$success = $dbh->do("INSERT INTO coh_saved_search(saved_search_id, search_id, lead_id, session_id, search_name, mail_option, update_stamp)
	VALUES('', '$search_id', '$time_stamp', 'agent_saved', '$search_name', 'yes', '$update_stamp')");
        if ($troubleshooting eq "on"){
     		print "INSERT INTO coh_saved_search(saved_search_id, search_id, lead_id, session_id, search_name, mail_option, update_stamp)
	VALUES('', '$search_id', '$time_stamp', 'agent_saved', '$search_name', 'yes', '$update_stamp')<p>";
			}
}



################################################################################
#  Parse from the web form

sub parse_form {

# This line sets the method that this script was accessed (GET or POST)
my $method = $ENV{'REQUEST_METHOD'};

# The following is a basic if else structure to use the appropriate
# processing for grabbing the form data
if ($method eq "GET") {
    $rawdata = $ENV{'QUERY_STRING'};
} else {
   # if not "GET" then it will default "POST"
   read(STDIN, $rawdata, $ENV{'CONTENT_LENGTH'});
}

# Splits the data pairs into sections
my @value_pairs = split (/&/,$rawdata);
my %formdata = ();
@cgiPairs = @value_pairs;  # MS/2010-03-12 -> We still call on the cgiPairs variable for processing incoming data

# Cycles through each pair to grab the values of the fields
foreach $pair (@value_pairs) {
    ($field, $value) = split (/=/,$pair);
    $value =~ tr/+/ /;
    $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
    $form{$field} = $value;
    # store the field data in the results hash
}
}


################################################################################
sub assign_which_agent {

#$form{'city'} = "Westerville";
$counter=1;
$countup = 0;
$count_agent = 0;
$n=1;

open (DATABASEZ, "$database");
while (<DATABASEZ>)
        {
        $rowZ = $_;
        chop $row;
        @fieldsZ = split (/\|/, $rowZ);
        if ($fieldsZ[8] =~ m/$form{'email'}/i) {
#        if ($fieldsZ[8] eq "$form{'email'}") {
        $assigned_agent = $fieldsZ[4];
if ($assigned_agent eq "Melony Scheiner") {$assigned_agent = "David Scheiner"}

        &add_agents_info;
#        print "Form Email: $form{'email'}<br>\n";
#        print "Assigned Agent: $assigned_agent<br>\n";
        $counter++;
        }
        }
close (DATABASEZ);

if ($assigned_agent eq "") {
&city_assignment;
&add_percentage;
&search_database2;
&sort_temp_database;
&assign_the_agent;
&add_agents_info;
}


}


###############################################################################
sub city_assignment {
#print "CITY ASSIGNED<br>\n";
open (CITYASSIGNED, "$city_assignments");
#print "$city_assignments<P>\n";
while (<CITYASSIGNED>)
                {
                $cityrow=$_;
                @city = split(/\|/,$cityrow);
      			if ($form{'city'} eq $city[0])
                {

while ($city[$n]) {
#print "$count_agent: $city[$n]<P>\n";
{push (@agents, $city[$n]);}
	$n++;
	$count_agent++;
}
}
}

chomp(@agents);
}


###############################################################################
sub add_percentage {
#print "<P>***********************************************************************<P>\n";
#print "ADD PERCENTAGE<P>\n";

foreach $agentsX (@agents) {
#print "$agents<br>\n";
          open (ADDPERCENTAGE, "$users");
                while (<ADDPERCENTAGE>)
                {
                $rowX=$_;
                @userX = split(/\|/,$rowX);
                if ($userX[0] eq "$agentsX" and $userX[24] ne "vacation") {
                $agentsZ[$countup] = $userX[0];
                $agentsA[$countup] = $userX[23];

#          if ($agents[$countup] eq "Rhonda Duke") {$agentsA[$countup] = 30  }
#          if ($agents[$countup] eq "Bob Hewitt") {$agentsA[$countup] = 30  }

#print "$countup: Agent: $agents[$countup] - PercentageA: $agentsA[$countup]<P>\n";
}
}
                $countup++;
                }
          close (ADDPERCENTAGE);
}



################################################################################
sub search_database2 {
#print "<P>***********************************************************************<P>\n";
#print "SEARCH DATABASE<P>\n";
$count_agent--;
        open (DATABASEP, "$database");
        while (<DATABASEP>)
        {
        $rowQ = $_;
        chop $rowQ;
        @search_database = split (/\|/, $rowQ);
        if ($search_database[0] > $time_stamp-259200) {
        for ($countmeA = $count_agent; $countmeA >= 0; $countmeA--) {
        if ($search_database[4] eq "$agentsZ[$countmeA]") {
        $agent_found[$countmeA]++;
        }
}
        }
        }

      @filelist = ("$temp_database");
unlink @filelist;

        for ($countmeA = $count_agent; $countmeA >= 0; $countmeA--) {
        $agent_found[$countmeA] = $agent_found[$countmeA]*$agentsA[$countmeA];

      if ($agentsZ[$countmeA] ne "") {
      open(TEMPDATABASE, ">>$temp_database") || die('Cannot open output file');
      print TEMPDATABASE "$agentsZ[$countmeA]|$agent_found[$countmeA]\n";
      close(TEMPDATABASE);
      }
#print "$agents[$countmeA]: $agent_found[$countmeA] <br>\n";
#$temp_database
        }
}


################################################################################
sub sort_temp_database {
#print "<P>***********************************************************************<P>\n";
#print "SORT DATABASE<P>\n";
        open(SORT_FILE, "$temp_database");
$count=0;
@row1 =<SORT_FILE>;
close (SORT_FILE);

while (@row1[$count] ne "") {
        $rowW = @row1[$count];
#print "$rowW<br>\n";
        @rowW = split (/\|/, $rowW);
        $sortable_fieldW = $rowW[1];
        unshift (@rowW, $sortable_fieldW);
        $new_rowW = join ("\|", @rowW);
        push (@new_rowsW, $new_rowW);
        $count++
        }

        @sorted_rowsW = sort { $a <=> $b } @new_rowsW;

@database_rowsW = ();
 foreach $sorted_rowW (@sorted_rowsW) {
    @rowW = split (/\|/, $sorted_rowW);
    $sorted_fieldW = shift (@rowW);
    $old_but_sorted_rowW = join ("\|", @rowW);
    push (@database_rowsW, $old_but_sorted_rowW);
    }
        open(PRINT_FILE, ">$temp_database");
        print PRINT_FILE (@database_rowsW);
        close(PRINT_FILE);
}


################################################################################
sub assign_the_agent {
#print "<P>***********************************************************************<P>\n";
#print "ASSIGN THE AGENT<P>\n";
#print "City: $form{'city'}<P>\n";
        $agent_counter = 1;

    open(MAILC,"|$mailprog -t");
    print MAILC "To: dbarlow\@barlow.com\n";
    print MAILC "From: newclient\@columbusohioforeclosure.com\n";
    print MAILC "Subject: Agent Assignment\n\n";
    print MAILC "          City: $form{'city'}\n";
    print MAILC "Prospect Email: $form{'email'}\n\n";
        open (DATABASE, "$temp_database");
        while (<DATABASE>)
        {
        $rowP = $_;
        chop $rowP;
        @fieldsP = split (/\|/, $rowP);
        print MAILC "$fieldsP[0]: $fieldsP[1]\n";
#print "$fieldsP[0]: $fieldsP[1]<br>\n";
        if ($agent_counter == "1") {$assigned_agent = $fieldsP[0];
        }
        $agent_counter++;
        }
        print MAILC "Agent Assigned: $assigned_agent\n\n";
        close (MAILC);
        close(DATABASE);
#print "<P>\n";
}


################################################################################
sub add_agents_info {
#print "<P>***********************************************************************<P>\n";
#print "ADD AGENTS INFO<P>\n";

open (AGENTINFO, "$users");
                while (<AGENTINFO>)
                {
                $row=$_;
                @user = split(/\|/,$row);

                if ($assigned_agent eq $user[0])
                {
                $agent_username = "$user[0]";
                $agent_email = "$user[1]";
                $agent_text = "$user[9]";
                $agent_cell = "$user[11]";
                $agent_mls = "$user[6]";
                $agent_agent_photo = "$user[13]";
                $agent_agent_website = "$user[15]";
                $agent_user = "$user[2]";
                $agent_password = "$user[20]";

                }
        }
close (AGENTINFO);

#print "<B>ASSIGNED AGENT:</B> $assigned_agent<br>\n";
#print "<B>Agent web site:</B> $agent_agent_website<br>\n";

}



################################################################################
sub extra_crap {

while (<DATABASE>)
        {
        $row = $_;
        chop $row;
        @agent_count = split (/\|/, $row);

@timeData = localtime(time);
@agent_time = localtime($agent_count[0]);

        if ($agent_time[3] == $timeData[3] and $agent_time[4] == $timeData[4] and $agent_time[5] == $timeData[5]) {

        for ($countme = $count; $countme >= 1; $countme--) {

        if ($agent_count[4] eq "$agent$countme") {
        $agent_counter[$countme]++;
        }
}
        }
        }
        close (DATABASE);

}


sub follow_up_dates {

   @months = ('January','February','March','April','May','June','July',
	      'August','September','October','November','December');

        if ($form{'script'} eq "day2") {$addon = 86400;}
        if ($form{'script'} eq "day4") {$addon = 172800;}
        if ($form{'script'} eq "day7") {$addon = 356600;}
        if ($form{'script'} eq "day12") {$addon = 518400;}
        if ($form{'script'} eq "day19") {$addon = 604800;}
        if ($form{'script'} eq "") {$addon = 86400;}

        ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time+$addon);
   $year += "1900";


print "<table><tr><td>\n";

        print "<SELECT NAME = \"field26\">\n";
        $nextmonth=$mon;
        for($counter = "1"; $counter <= 12; $counter++){
        if ($nextmonth eq "12") {$nextmonth=0}
        print "<OPTION value =\"$months[$nextmonth]\">$months[$nextmonth]\n";
        $nextmonth++ ;
                }
        print "<\select></td><td>\n";

        $fields27 = $fields[27];

#############
        if ($fields27 eq "") {$fields27 = "$mday";
        print "<SELECT NAME = \"field27\">\n";
        print "<OPTION value =\"$fields27\">$fields27\n";
        for($countdays = "1"; $countdays <= 31; $countdays++){
        $multi=$countdays * 86400;
        ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time+$addon+$multi);
        print "<OPTION value =\"$mday\">$mday\n";
        }

        } else {
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time+$addon);

#$fields27 = "$mday";
        print "<SELECT NAME = \"field27\">\n";
#        print "<OPTION value =\"$fields27\">$fields27\n";
        for($countdays = 1; $countdays <= 31; $countdays++){
        $multi=$countdays * 86400;
        $original_days=$fields27 * 86400;
        ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time+$addon+$multi);
        print "<OPTION value =\"$mday\">$mday\n";
        }
        }
       print "<\select></td><td>\n";

   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += "1900";

        if ($fields[25] eq "") {$fields[25] = "$year";
        print "<SELECT NAME = \"field25\">\n";
        print "<OPTION value =\"$fields[25]\">$fields[25]\n";
        $year++;
        for($counter = "1"; $counter <= 5; $counter++){
        print "<OPTION value =\"$year\">$year\n";
        $year++  ;
        }
        } else {
        print "<SELECT NAME = \"field25\">\n";
        print "<OPTION value =\"$fields[25]\">$fields[25]\n";
        $year_plus_one = $fields[25];
        $year_plus_one++;
        for($counter = "1"; $counter <= 5; $counter++){
        print "<OPTION value =\"$year_plus_one\">$year_plus_one\n";
        $year_plus_one++  ;
        }
        }
        print "<\select></td><td>\n";

        print "</tr></table>\n"

        }


################################################################################
sub search_database
{

        open (DATABASEP, "$database");

        while (<DATABASEP>)
        {
        $row = $_;
        chop $row;
        @agent_count = split (/\|/, $row);
        if ($agent_count[0] > $time_stamp-259200) {
        for ($countme = 6; $countme >= 0; $countme--) {
        if ($agent_count[4] eq "$agents[$countme]") {
        $agent_counter[$countme]++;
        }
}
        }
        }
        close (DATABASEP);


$Total_column1 = $agent_counter[0]+$agent_counter[1]+$agent_counter[2]+$agent_counter[3]+$agent_counter[4]+$agent_counter[5]+$agent_counter[6]+$agent_counter[7]+$agent_counter[8]+$agent_counter[9]+$agent_counter[10]+$agent_counter[11]+$agent_counter[12]+$agent_counter[13]+$agent_counter[14]+$agent_counter[15]+$agent_counter[16];
}
