#!/usr/bin/perl

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

require "config.idx";

$long = $ENV{'QUERY_STRING'};

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





use DBI;
my $dsn = "DBI:mysql:database=$d_name;host=localhost";
my $dbh = DBI->connect($dsn, $d_username, $d_pass, {RaiseError => 1}) || die $DBI::errstr;
my $pasth = $dbh->prepare("select * from listings_com where mlsnum = '$INPUT{mlsnumber}'");
$pasth->execute;

while (($MLSNUM, $Class, $Type, $Area, $Price, $AddressNumber, $AddressDirection, $AddressStreet, $Address2, $City, $State, $Zip, $Status, $SaleRent, $RailroadSpur, $NearAirport, $Signage, $FloodPlain, $SecurityGate, $Stories, $NUMOfElevators, $OldMLSNUM, $AgentID, $AgentName, $AgentPhone, $ListingOffice1ID, $ListingOffice1Name, $ListingOffice1Phone, $CoAgentID, $CoAgentName, $CoAgentPhone, $ListingOffice2ID, $ListingOffice2Name, $ListingOffice2Phone, $Blank35, $Blank36, $PhotoVideo, $Blank38, $Blank39, $LinkedMLSNUM, $Blank41, $Blank42, $Blank43, $County, $Township, $Subdivision, $Zoning, $Legal, $ApproxLotSize, $Irregular, $Acres, $PricePerAcre, $InterstateHwy, $RoadFrontage, $DistanceToAirport, $TrafficCount, $PresentUse, $YRBuilt, $NUMBuildings, $NUMExitDoors, $OverheadDoorsQTY, $Height, $Columns, $LoadingDock, $CeilingHeight, $NUMEmpParking, $NUMCustomerParking, $NUMHandicapParking, $LightedParking, $OfficeSqFt, $WarehouseSqFt, $RetailSqFt, $ManufacturingSqFt, $TotalSqFt, $Office, $Warehouse, $Retail, $Manufacturing, $Total, $Office2, $Warehouse2, $Retail2, $Manufacturing2, $Office3, $Warehouse3, $Retail3, $Manufacturing3, $Female, $Male, $HandicapAccess, $PhoneSystem, $SecuritySystem, $ElectricCo, $GasCo, $WaterCo, $SewerCo, $CableCo, $PhoneCo, $Defects, $Reserved, $Blank101, $Directions, $DirectionsContinued, $Blank104, $TaxIDNUM, $LandValue, $ImproveValue, $EstimatedAnnualTax, $Exempt, $DitchFee, $OtherExp, $OtherExpPerQMY, $BlueRiverConsFee, $Gas, $Electric, $Water, $Sewer, $AssocDues, $AssocDuesPerQMY, $Auction, $AuctionDate, $Assumption, $Remarks, $Blank124, $Contract, $Blank126, $Blank127, $Blank128, $Blank129, $Blank130, $Blank131, $Blank132, $Blank133, $Blank134, $Blank135, $Blank136, $Blank137, $Blank138, $Blank139, $Blank140, $Blank141, $Blank142, $Blank143, $Blank144, $Blank145, $Blank146, $Blank147, $Blank148, $FeaturesDB) = $pasth->fetchrow_array()) {


$TotalSqFt = &commas($TotalSqFt);

open(DBFILE,"remarksdb.txt");
@dbfile = <DBFILE>;
close(DBFILE);

foreach $dbline (@dbfile) {
$dbline =~ s/\n//gi;
if ($dbline) {
$Remarks =~ s/(.*?)$dbline//gi;
}
#$makestuff .= "$dbline\n";
}


$preprice = $Price;

	$principal = "$Price";
	$interest = 6.5;
	$monthlyinterest = ($interest)/1200;
	$termyear = 30;
	$numberofmonths = $termyear*12;
	
	$temp = 1 + $monthlyinterest;
	
	$expon = 1;
	for ($p = 0; $p < $numberofmonths; $p++)
	{
		$expon = $temp * $expon;
	}
	
	$expon = 1 / $expon;
	$expon = 1 - $expon;
	$expon = $monthlyinterest / $expon;
	
	$monthlypayment = $principal * $expon;

	$monthlypayment=sprintf("%.2f",$monthlypayment);
	$monthlypayment = &commas($monthlypayment);

	$Price = &commas($Price);

	$monthlypayment = &commas($monthlypayment);
	$mortgagetax = $EstimatedAnnualTax;
	$EstimatedAnnualTax = &commas($EstimatedAnnualTax);


if ($SaleRent eq "S") {
$SaleRent = "For Sale";
}
else {
$SaleRent = "For Rent";
}

if ($Address2) {
$Address2 = "$Address2<br>";
}
else {
}

if ($ListingOffice1ID eq "130") {
$printoffice = "<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=images/era_showlogo.gif></td><td><b>Offered By:</b><br>$AgentName<br>$ListingOffice1Name<br>765-741-9111</td></tr></table>"
}
else {
$printoffice = "<b>Offered By</b><br>$AgentName<br>$ListingOffice1Name<br>"
}


@thefeatures = split(/\|/,$FeaturesDB);


$startcount = "0";
foreach $one (@thefeatures) {

$yasth = $dbh->prepare("select featurename,categoryname from codes where codenum = '$one'");
$yasth->execute;

while (($realname,$categoryname) = $yasth->fetchrow_array()) {

$categoryname = lc($categoryname);
$realname = lc($realname);

$realname =~ s/CHR1/\'/gi;
$realname =~ s/CHR2/\"/gi;
$categoryname =~ s/CHR1/\'/gi;
$categoryname =~ s/CHR2/\"/gi;


$showfeaturestable .= "<td><img src=images/dot.gif>$categoryname<b>$realname</b></td>";

if ($startcount eq "1") {
$showfeaturestable .= "</tr><tr>";
$startcount = "0";
}
else {
$startcount++;
}

}
}
if ($OfficeSqFt eq "" || $OfficeSqFt eq "0") {
}
else {
$cOfficeSqFt = "SqFt. <b>$OfficeSqFt</b><br>Source <b>$Office</b><br>";
}

if ($Office2 eq "" || $Office2 eq "0") {
}
else {
$cOffice2 = "Sprinklers <b>$Office2</b><br>";
}
if ($Office3 eq "" || $Office3 eq "0") {
}
else {
$cOffice3 = "Detectors <b>$Office3</b><br>";
}


if ($WarehouseSqFt eq "" || $WarehouseSqFt eq "0") {
}
else {
$cWarehouseSqFt = "SqFt. <b>$WarehouseSqFt</b><br>Source <b>$Warehouse</b><br>";
}

if ($Warehouse2 eq "" || $Warehouse2 eq "0") {
}
else {
$cWarehouse2 = "Sprinklers <b>$Warehouse2</b><br>";
}
if ($Warehouse3 eq "" || $Warehouse3 eq "0") {
}
else {
$cWarehouse3 = "Detectors <b>$Warehouse3</b><br>";
}


if ($RetailSqFt eq "" || $RetailSqFt eq "0") {
}
else {
$cRetailSqFt = "SqFt. <b>$RetailSqFt</b><br>Source <b>$Retail</b><br>";
}

if ($Retail2 eq "" || $Retail2 eq "0") {
}
else {
$cRetail2 = "Sprinklers <b>$Retail2</b><br>";
}
if ($Retail3 eq "" || $Retail3 eq "0") {
}
else {
$cRetail3 = "Detectors <b>$Retail3</b><br>";
}

if ($ManufacturingSqFt eq "" || $ManufacturingSqFt eq "0") {
}
else {
$cManufacturingSqFt = "SqFt. <b>$ManufacturingSqFt</b><br>Source <b>$Manufacturing</b><br>";
}

if ($Manufacturing2 eq "" || $Manufacturing2 eq "0") {
}
else {
$cManufacturing2 = "Sprinklers <b>$Manufacturing2</b><br>";
}
if ($Manufacturing3 eq "" || $Manufacturing3 eq "0") {
}
else {
$cManufacturing3 = "Detectors <b>$Manufacturing3</b><br>";
}


if (($OfficeSqFt eq "0" || $OfficeSqFt eq "") && ($Office2 eq "0" || $Office2 eq "") && ($Office3 eq "0" || $Office3 eq "")) {
}
else {
$ShowOffice = "<b>Office</b>";
}

if (($WarehouseSqFt eq "0" || $WarehouseSqFt eq "") && ($Warehouse2 eq "0" || $Warehouse2 eq "") && ($Warehouse3 eq "0" || $Warehouse3 eq "")) {
}
else {
$ShowWarehouse = "<b>Warehouse</b>";
}

if (($RetailSqFt eq "0" || $RetailSqFt eq "") && ($Retail2 eq "0" || $Retail2 eq "") && ($Retail3 eq "0" || $Retail3 eq "")) {
}
else {
$ShowRetail = "<b>Retail</b>";
}

if (($ManufacturingSqFt eq "0" || $ManufacturingSqFt eq "") && ($Manufacturing2 eq "0" || $Manufacturing2 eq "") && ($Manufacturing3 eq "0" || $Manufacturing3 eq "")) {
}
else {
$ShowManufacturing = "<b>Manufacturing</b>";
}



if (($OfficeSqFt eq "0" || $OfficeSqFt eq "") && ($Office2 eq "0" || $Office2 eq "") && ($Office3 eq "0" || $Office3 eq "")&& ($WarehouseSqFt eq "0" || $WarehouseSqFt eq "") && ($Warehouse2 eq "0" || $Warehouse2 eq "") && ($Warehouse3 eq "0" || $Warehouse3 eq "") && ($RetailSqFt eq "0" || $RetailSqFt eq "") && ($Retail2 eq "0" || $Retail2 eq "") && ($Retail3 eq "0" || $Retail3 eq "") && ($ManufacturingSqFt eq "0" || $ManufacturingSqFt eq "") && ($Manufacturing2 eq "0" || $Manufacturing2 eq "") && ($Manufacturing3 eq "0" || $Manufacturing3 eq "")) {
$ShowLine = "";
$ShowBgcolor = "white";
}
else {
$ShowLine = "<img src=images/line_spacer.gif height=3 width=1><br><img src=images/black_fill.gif height=1 width=335><br>";
$ShowBgcolor = "silver";
}

if (($NUMEmpParking eq "" || $NUMEmpParking eq "0") && ($NUMCustomerParking eq "" || $NUMCustomerParking eq "0") && ($NUMHandicapParking eq "N/A" || $NUMHandicapParking eq "") && ($LightedParking eq "" || $LightedParking eq "x")) {
$ShowBadParking = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadParking = "";
}


if ($NUMEmpParking eq "") {
$cNUMEmpParking = "";
}
else {
$cNUMEmpParking = "<tr bgcolor=white><td valign=top>\# Employee</td><td valign=top><b>$NUMEmpParking</b><br></td></tr>";
}

if ($NUMCustomerParking eq "") {
$cNUMEmpParking = "";
}
else {
$cNUMEmpParking = "<tr bgcolor=white><td valign=top>\# Customer</td><td valign=top><b>$NUMCustomerParking</b><br></td></tr>";
}

if ($NUMHandicapParking eq "") {
$cNUMHandicapParking = "";
}
else {
$cNUMHandicapParking = "<tr bgcolor=white><td valign=top>\# Handicap</td><td valign=top><b>$NUMHandicapParking</b><br></td></tr>";
}

if ($LightedParking eq "") {
$cLightedParking = "";
}
else {
$cLightedParking = "<tr bgcolor=white><td valign=top>Lighted</td><td valign=top><b>$LightedParking</b><br></td></tr>";
}

if ($RailroadSpur eq "") {
$cRailroadSpur = "";
}
else {
$cRailroadSpur = "Railroad Spur <b>$RailroadSpur</b><br>";
}

if ($FloodPlain eq "") {
$cFloodPlain = "";
}
else {
$cFloodPlain = "FloodPlain <b>$FloodPlain</b><br>";
}

if ($SecurityGate eq "") {
$cSecurityGate = "";
}
else {
$cSecurityGate = "Security Gate <b>$SecurityGate</b><br>";
}

if ($NUMOfElevators eq "") {
$cNUMOfElevators = "";
}
else {
$cNUMOfElevators = "Number of Elevators <b>$NUMOfElevators</b><br>";
}

if ($ApproxLotSize eq "" || $ApproxLotSize eq "X" || $ApproxLotSize eq "x") {
$cApproxLotSize = "";
}
else {
$cApproxLotSize = "Lot Size <b>$ApproxLotSize</b><br>";
}

if ($NUMExitDoors eq "") {
$cNUMExitDoors = "";
}
else {
$cNUMExitDoors = "Number of Exit Doors <b>$NUMExitDoors</b><br>";
}

if ($OverheadDoorsQTY eq "") {
$cOverheadDoorsQTY = "";
}
else {
$cOverheadDdoorsQTY = "<tr bgcolor=white><td>Quantity</td><td>$OverheadDoorsQTY</td></tr>";
}

if ($Height eq "") {
$cHeight = "";
}
else {
$cHeight = "<tr bgcolor=white><td>Height</td><td>$Height</td></tr>";
}

if ($Columns eq "" || $Columns eq "N/A") {
$cColumns = "";
}
else {
$cColumns = "<tr bgcolor=white><td>Columns</td><td>$Columns</td></tr>";
}

if (($OverheadDoorsQTY eq "" || $OverheadDoorsQTY eq "0") && ($Height eq "" || $Height eq "0") && ($Columns eq "N/A" || $Columns eq "")) {
$ShowBadDoor = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadDoor = "";
}

if ($LoadingDock eq "") {
$cLoadingDock = "";
}
else {
$cLoadingDock = "Loading Dock<b>$LoadingDock</b><br>"
}

if ($Male eq "") {
$cMale = "";
}
else {
$cMale = "<tr bgcolor=white><td>Male</td><td>$Male</td></tr>";
}
if ($Female eq "") {
$cFemale = "";
}
else {
$cFemale = "<tr bgcolor=white><td>Female</td><td>$Female</td></tr>";
}

if (($Male eq "" || $Male eq "0") && ($Female eq "" || $Female eq "0")) {
$ShowBadRestrooms = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadRestrooms = "";
}



if ($ElectricCo eq "") {
$cElectricCo = "";
}
else {
$cElectricCo = "<tr bgcolor=white><td>Electric Co.</td><td>$ElectricCo</td></tr>";
}

if ($GasCo eq "") {
$cGasCo = "";
}
else {
$cGasCo = "<tr bgcolor=white><td>Gas Co.</td><td>$GasCo</td></tr>";
}

if ($WaterCo eq "") {
$cWaterCo = "";
}
else {
$cWaterCo = "<tr bgcolor=white><td>Water Co.</td><td>$WaterCo</td></tr>";
}

if ($SewerCo eq "") {
$cSewerCo = "";
}
else {
$cSewerCo = "<tr bgcolor=white><td>Sewer Co.</td><td>$SewerCo</td></tr>";
}

if ($CableCo eq "") {
$cCableCo = "";
}
else {
$cCableCo = "<tr bgcolor=white><td>Cable Co.</td><td>$CableCo</td></tr>";
}

if ($PhoneCo eq "") {
$cPhoneCo = "";
}
else {
$cPhoneCo = "<tr bgcolor=white><td>Phone Co.</td><td>$PhoneCo</td></tr>";
}

if ($HandicapAccess eq "" || $HandicapAccess eq "0") {
$cHandicapAccess = "";
}
else {
$cHandicapAccess = "<img src=images/dot.gif>Handicap Access <b>$HandicapAccess</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($PhoneSystem eq "" || $PhoneSystem eq "0") {
$cPhoneSystem = "";
}
else {
$cPhoneSystem = "<img src=images/dot.gif>Phone System <b>$PhoneSystem</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($SecuritySystem eq "" || $SecuritySystem eq "0") {
$cSecuritySystem = "";
}
else {
$cSecuritySystem = "<img src=images/dot.gif>Security System <B>$SecuritySystem</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($LandValue eq "" || $LandValue eq "0") {
$cLandValue = "";
}
else {
$cLandValue = "<img src=images/dot.gif>Land Value <b>$LandValue</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

if ($ImproveValue eq "" || $ImproveValue eq "0") {
$cImproveValue = "";
}
else {
$cImproveValue = "<img src=images/dot.gif>Improv. Value <b>$ImproveValue</b><img src=images/line_spacer.gif height=1 width=1><br>";
}

$LandValue = &commas($LandValue);
$ImproveValue = &commas($ImproveValue);

if (($cElectricCo eq "") && ($cGasCo eq "") && ($cWaterCo eq "") && ($cSewerCo eq "") && ($cCableCo eq "") && ($cPhoneCo eq "")) {
$ShowBadUtilities = "<tr bgcolor=white><td colspan=2><font color=maroon><b>No Information</b></font></td></tr>";
}
else {
$ShowBadUtilities = "";
}








$starting = "";
$bigcount = "1";
$stop = "no";
$showthumbs = "";
$anypictures = "no";
$totalnumber = "0";

while ($stop ne "yes") {
#$showthumbs .= "<tr><td>tiny/meiar$MLSNUM$starting\.jpg</td></tr>";
if (-e "/home/muncieml/public_html/images/photos/tiny/meiar$MLSNUM$starting\.jpg") {
$anypictures = "yes";
#$buildscript .= "images\[$bigcount\] \= new Image\(\)\nimages\[$bigcount\]\.src \= \'images\/photos\/full\/meiar$MLSNUM$starting\.jpg\'\;\n\n";
$buildscript .= "	testurl[$bigcount]=\"http://www.munciemls.com/images/photos/full\/meiar$MLSNUM$starting\.jpg\"\n";

 $showthumbs .= "<td width=\"44\" valign=\"top\"><a href=\"javascript: showupdate($bigcount)\"><img src=\"images/photos/tiny/meiar$MLSNUM$starting\.jpg\" border=0></a><br></td>";
$totalnumber++;
#$showthumbs .= "<td width=\"62\"><a href=\"javascript: showupdate($bigcount)\"><img src=\"images/photos/tiny/meiar$MLSNUM$starting\.jpg\" border=0></a></td><td width=\"2\"><img src=\"images/white_bar.gif\" height=\"45\" width=\"1\"></td>";
$rowcount++;
if ($rowcount eq "5") {
$rowcount = "0";
$showthumbs .= "</tr><tr>";

}
$bigcount++;
}


if ($starting eq "") {
$starting = "a";
}
elsif ($starting eq "a") {
$starting = "b";
}
elsif ($starting eq "b") {
$starting = "c";
}
elsif ($starting eq "c") {
$starting = "d";
}
elsif ($starting eq "d") {
$starting = "e";
}
elsif ($starting eq "e") {
$starting = "f";
}
elsif ($starting eq "f") {
$starting = "g";
}
elsif ($starting eq "g") {
$starting = "h";
}
elsif ($starting eq "h") {
$stop = "yes";
$starting = "";
}
else {
$stop = "yes";
#print "Starting unknown for meiar$MLSNUMber$starting\.jpg...\n";
}

}



if (-e "/home/muncieml/public_html/images/photos/full/meiar$MLSNUM\.jpg") {
$showpicture = "http://www.munciemls.com/images/photos/full/meiar$MLSNUM\.jpg";
}
else {
$showpicture = "http://www.munciemls.com/images/nophoto.gif";
}



if ($totalnumber > "1") {
$showgallery = "<font face=\"Arial, Helvetica, sans-serif\"><font size=\"3\">photo<b>gallery</b></font></font><br><img src=\"images/line_spacer.gif\" height=\"3\" width=\"1\"><br><table border=\"0\" cellpadding=\"0\" cellspacing=\"1\"><tr>$showthumbs</tr></table><br>";
}
else {
$showgallery = "";
}


$searchstrings = "City=$INPUT{City}&County=$INPUT{County}&MinPrice=$INPUT{MinPrice}&MaxPrice=$INPUT{MaxPrice}&MinBed=$INPUT{MinBed}&MinBath=$INPUT{MinBath}&Acreage=$INPUT{Acreage}&YBuilt=$INPUT{YBuilt}&MinSF=$INPUT{MinSF}&MaxSF=$INPUT{MaxSF}&Address=$INPUT{Address}&Remarks=$INPUT{Remarks}&Show=$INPUT{Show}&sortby=$INPUT{sortby}&orderby=$INPUT{orderby}&Page=$INPUT{Page}";


if ($ENV{QUERY_STRING} =~ /City/) {
$showresultsback = "<a href=\"search_com.idx?$searchstrings\">Return To Search Results</a>";
}
else {
$showresultsback = "";
}






print <<"STARTPAGECONTENT";
<html>
<head>
<title>MuncieMLS.com MLS #$MLSNUM Listing Printout</title>
<link rel="stylesheet" TYPE="text/css" href="includes/style.css">
<script language=javascript>
function printversion(desktopURL){
		        window.print("showdetails__investment_print.idx?mlsnumber=$MLSNUM","displayWindow","toolbar=no,width=635,height=540,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
        }
</script>
<script Language="JavaScript">
testurl = new Array($bigcount);

$buildscript



			function showupdate(photoIndex, photoDisplayType)
			{
			document['picture'].src = testurl[photoIndex];
			
			return;
			}
			
</script>
</head>
<body bgcolor="white">
<center>
<table border="0" cellpadding="0" cellspacing="0" widht="581">
<tr>
<td valign=top width=581>

<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td colspan="2" width="581">
<table border="0" cellpadding="3" cellspacing="2" width="100%" bgcolor="#666666">
<tr>
<td valign="Top" width="100%" bgcolor="#E2E2E2" align="center">
<a href="javascript:printversion();">CLICK HERE TO PRINT THIS LISTING SHEET</a>     |     <a href="javascript:window.close()">CLOSE WINDOW</a><br>
</td>
</tr>
</table>
<hr color="#666666" width="581">
<font size="6" face="Arial Black">MuncieMLS.com</font>&nbsp;&nbsp;<font size="3" face="Arial"><b>Listing Sheet</b></font><br>
</td>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td colspan="2">
<img src="images/headers/commercial_propertydetails.gif" height="33" width="581" alt="Commercial Property Details">
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td width="341" valign="top">
<table border="0" cellpadding="6" cellspacing="0" width="341">
<tr>
<td width="335" valign="top">

<script language=javascript>
function sqftdetails(desktopURL)
	{
        desktop =window.open(desktopURL,"name","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,width=384,height=325,resizable=no");
        }
function mortgagechange(desktopURL)
	{
        desktop =window.open(desktopURL,"name","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,width=384,height=325,resizable=no");
        }
function RequestShowing()
        {
        msgWindow=window.open("showing.idx?mls=$MLSNUM&address=$AddressNumber $AddressDirection $AddressStreet&city=$ShowCity{$City}&state=Indiana&zip=$Zip","displayWindow","toolbar=no,width=465,height=540,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
        }
function printversion(desktopURL)
	{
        window.print("showdetails_commercial_print.idx?mlsnumber=$MLSNUM","displayWindow","toolbar=no,width=635,height=540,directories=no,status=no,scrollbars=yes,resize=no,menubar=no")
        }
// -->
</script>

	<img src="$showpicture" name=picture><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
$showgallery
<img src="images/line_spacer.gif" height="5" width="1"><br>
<font face="Arial, Helvetica, sans-serif"><font size="3">property<b>remarks</b></font></font><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/black_fill.gif" height="1" width="335"><br>
<img src="images/line_spacer.gif" height="1" width="11">$Remarks<br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>

$ShowLine
<center>
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr bgcolor="$ShowBgcolor">
<td valign="top">$ShowOffice</td>
<td valign="top">$ShowWarehouse</td>
<td valign="top">$ShowRetail</td>
<td valign="top">$ShowManufacturing</td>
</tr>

<tr>
<td valign="top">
	$cOfficeSqFt
	$cOffice2
	$cOffice3
</td>
<td valign="top">
	$cWarehouseSqFt
	$cWarehouse2
	$cWarehouse3
</td>
<td valign="top">
	$cRetailSqFt
	$cRetail2
	$cRetail3
</td>
<td valign="top">
	$cManufacturingSqFt
	$cManufacturing2
	$cManufacturing3
</td>
</tr>
<tr>
<td valign="top" colspan="4">
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/black_fill.gif" height="1" width="335"><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
</td>
</tr>
<tr>
<td colspan="4" valign="top">
	<table border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr>
	<td valign="top" width="50%">

		<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="silver">
		<tr>
		<td valign="top" colspan="2"><b>Parking</b></td>
		</tr>
		$cNUMCustomerParking
		$cNUMHandicapParking
		$cLightedParking
		$ShowBadParking
		$cNUMEmpParking
		$cNUMCustomerParking
		$cNUMHandicapParking
		$ShowBadParking
		</table>
		<br>
		<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="silver">
		<tr>
		<td valign="top" colspan="2"><b>Overhead Doors</b></td>
		</tr>
		$cOverheadDoorsQTY
		$cHeight
		$cColumns
		$ShowBadDoor
		</table>
		<br>
		<table border=0 cellpadding=1 cellspacing=1 width=100% bgcolor=silver>
		<tr>
		<td valign=top colspan=2><b>Restrooms</b></td></tr>
		$cMale
		$cFemale
		$ShowBadRestrooms
		</table>		
		<br>
	</td>
	<td valign="top" width="50%">

		<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="silver">
		<tr>
		<td valign="top" colspan="2"><b>Utilities</b></td>
		</tr>
		$cElectricCo
		$cGasCo
		$cWaterCo
		$cSewerCo
		$cCableCo
		$cPhoneCo
		$ShowBadUtilities
		</table>
		<img src="images/line_spacer.gif" height="3" width="1"><br>
		$cRailroadSpur
		$cFloodPlain
		$cSecurityGate
		$cNUMOfElevators		
		$cApproxLotSize
		$cNUMExitDoors
		$cLoadingDock
	</td>
	</tr>
	</table>
</td>
</tr>
</table>
</center>

</td>
</tr>
</table>
</td>
<td width="240" valign="top" bgcolor="#E2E2E2">
<table border="0" cellpadding="6" cellspacing="0" width="100%">
<tr>
<td valign="top">
<font face="Arial, Helvetica, sans-serif"><font size="4">property<b>overview</b></font></font><br>
$Type $Status $SaleRent<br>
$AddressNumber $AddressDirection $AddressStreet<br>
$Address2
$ShowCity{$City}, IN $Zip<br>
MLS <b>#$MLSNUM</b><br>
<font color="#990000"><b>\$$Price</b> / <b>\$$monthlypayment*</b> Monthly</font><br><br>
<br>
$printoffice
<br>
<table border="0" cellpadding="3" cellspacing="1" border="1" bgcolor="navy">
<tr>
<td valign="top" bgcolor="navy"><font color="white"><b>Unique Listing Address</b></font></td>
</tr>
<td valign="top" bgcolor="#E2E2E2">
 <a href="http://$MLSNUM.MuncieMLS.com">http://$MLSNUM.MuncieMLS.com</a>
</td>
</tr>
</table>
<br>
<font face="Arial, Helvetica, sans-serif"><font size="3">property<b>details</b></font></font><br>
<img src="images/line_spacer.gif" height="3" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Number Of Buildings <b>$NUMBuildings</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">County <b>$County</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Township <b>$Township</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Area <b>$Area</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Subdivision <b>$Subdivision</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Acres <b>$Acres</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Year Built <b>$YRBuilt</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Square Feet <b>$TotalSqFt</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Stories <b>$Stories</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Interstate/Highway <b>$InterstateHwy</b><br><img src="images/line_spacer.gif" height="1" width="1"><br>
<img src="images/dot.gif" width="15" height="7">Road Frontage <b>$RoadFrontage</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Near Airport <b>$NearAirport</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Signage <b>$Signage</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Distance To Airport <b>$DistanceToAirport</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Traffic Count <b>$TrafficCount</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Present Use <b>$PresentUse</b><br><img src=images/line_spacer.gif height=1 width=1><br>
<img src="images/dot.gif" width="15" height="7">Est. Annual Taxes <b>\$$EstimatedAnnualTax</b><img src="images/line_spacer.gif" height="1" width="1"><br>
		$cHandicapAccess
		$cPhoneSystem
		$cSecuritySystem
		$cImproveValue
		$cLandValue
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" width="15">
<img src="images/dot.gif">
</td><td valign="top" width="100%">Directions: <b>$Directions $DirectionsContinued</b><br></td></tr></table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
<td valign="top" width="6"><img src="images/line_spacer.gif" height="1" width="6"><br></td>
<td valign="top" width="576">
<font face="Arial, Helvetica, sans-serif"><font size="3">property<b>features</b></font></font><br>
<img src="images/line_spacer.gif" height="2" width="1"><br>
<img src="images/black_fill.gif" height="2" width="576"><br>
<img src="images/line_spacer.gif" height="2" width="1"><br>
<table border=0 cellpadding=0 cellspacing=0 width=100%><tr>
$showfeaturestable</tr>
</table>
</td>
</tr>
</table>



$makestuff


<br><br>
<table border="0" cellpadding="0" cellspacing="0" width="581">
<tr>
	<td width="40" valign="middle"><center><img src="images/eho.gif" alt="Equal Housing Opportunity"><br><img src="images/re.gif" alt="REALTOR"></center></td>
	<td width="541" valign="top"><b><font size="1" face="Arial, Helvetica, sans-serif">The materials contained within this page may not be reproduced without the express written consent of ERA Eagle Real Estate, Inc. or IDXNow IDX Real Estate Solutions.  The information herein is believed to be accurate and timely, but no warranty as such is expressed or implied.</font></b></td>
</tr>
<tr>
	<td width="40" valign="middle">&nbsp;</td>
	<td valign="top" width="541" align="center"><img src="images/idxnow.gif"><br><b>http://www.idxnow.com</b></td>
</tr>
</table>
</center>
</body>
</html>


STARTPAGECONTENT
}



$dbh->disconnect;

sub commas {
	local($_)=@_;
	1 while s/(.*\d)(\d\d\d)/$1,$2/;
	$_;
}


