﻿
// ####################################
// ########## Sold Listing Object ##########
// ####################################

function SoldListing()
{  
    this.VEShapeLayer = _soldLayer; 
    this.VEShape = null;
    this.Address = null;
	this.City = null;
    this.State = null;
    this.PostalCode = null;
    this.CountyFipsCode = null;
    this.ParcelNumber = null;
    this.Latitude = null;
    this.Longitude = null;
    this.MatchCode = null;
    this.Distance = null;
    this.ExactMatch = null;
    this.OnBoardId = null;
    this.ListingType = null;
    this.Bedrooms = null;
    this.Bathrooms = null;
    this.Area = null;
    this.SalePrice = null;
    this.SaleDate = null;
    this.YearBuilt = null;
    this.DocumentNumber = null;
    this.AbsenteeIndicator = null;
    this.RecordingDate = null;
    this.CalendarDate = null;
    this.DisclosureFlag = null;
    this.TransactionType = null;
    this.SalesCode = null;
    this.AddedDate = null;
    this.numberOfDaysSold = null;
    this.numberOfDaysInSystem = null;
}
SoldListing.prototype.Populate = function(soldListingItems)
{
    this.Address = soldListingItems[0]; 
	this.City = soldListingItems[1];
    this.State = soldListingItems[2];
    this.PostalCode = soldListingItems[3];
    this.CountyFipsCode = soldListingItems[4];
    this.ParcelNumber = soldListingItems[5];
    this.Latitude = soldListingItems[6];
    this.Longitude = soldListingItems[7];
    this.MatchCode = soldListingItems[8];
    this.Distance = soldListingItems[9];
    this.ExactMatch = soldListingItems[10];
    this.OnBoardId = soldListingItems[11];
    this.ListingType = soldListingItems[12];
    this.Bedrooms = soldListingItems[13];
    this.Bathrooms = soldListingItems[14];
    this.Area = soldListingItems[15];
    this.SalePrice = soldListingItems[16];
    this.SaleDate = soldListingItems[17];
    this.YearBuilt = soldListingItems[18];
    this.DocumentNumber = soldListingItems[19];
    this.AbsenteeIndicator = soldListingItems[20];
    this.RecordingDate = soldListingItems[21];
    this.CalendarDate = soldListingItems[22];
    this.DisclosureFlag = soldListingItems[23];
    this.TransactionType = soldListingItems[24];
    this.SalesCode = soldListingItems[25];
    this.AddedDate = soldListingItems[26];
    this.numberOfDaysSold = soldListingItems[27];
    this.numberOfDaysInSystem = soldListingItems[28]; 
}
SoldListing.prototype.DisplayShapeArray = function(array) 
{
     this.VEShapeLayer.AddShape(array);
}
SoldListing.prototype.GetShape = function() 
{
    this.VEShape = new VEShape(VEShapeType.Pushpin, new VELatLong(this.Latitude, this.Longitude));
    this.VEShape.SetTitle("--Sold Listing--");

    var descrip = "<div style='margin: 4px;'><b>"+this.ListingType.toUpperCase()+"<br />";
        descrip += "Closing Price: "+this.SalePrice+"<br />";
        descrip += this.Address+"<br />";
        descrip += this.City+", "+this.State+" "+this.PostalCode+"</b><br />";
        descrip += "Closing Date: "+this.SaleDate+"<br />";
        descrip += this.Bedrooms+" Bedrooms, "+this.Bathrooms+" Bathrooms<br />";
        descrip += "Year Built: "+this.YearBuilt+"<br />";
        descrip += "Price Shown: "+getSalesCodeDesc(this.SalesCode);
        descrip += "<br /><br /><img src=\"../App_Themes/Default/Images/Map/onboard.png\"><span style=\"font-size:.7em;\"><br />Information Powered by On Board LLC.<br />";
		descrip += "Copyright &copy; 2007 On Board LLC.</span></div>";
    
    this.VEShape.SetDescription(descrip); 
    this.VEShape.SetCustomIcon("../App_Themes/Default/Images/Map/icon_sold.gif");
    return this.VEShape;
}