Prime Realty Group

MLS# 1943776 - 2490 Buckingham Pl Brookfield, WI 53045

Better then new construction! Remodeled top to bottom! Grand 2 story foyer welcomes you. Stunning kitchen with an open concept floor plan & gorgeous HWFs, quartz counters, custom cabinets& beverage station. Kitchen open to inviting dining rm, perfect for entertaining. Family rm open to your kitchen. Features GFP & custom built ins. Sunrm w/wall to wall windows, french doors and open to back patio. Oversized living rm. Main floor 4th bedrm which is near the main floor full bath. Perfect for guests or in law area. Large laundry/mudrm. Master suite w/WIC and luxury bath. 2 additional upper large bedrms w/vaulted ceilings. Upper loft. Finished basement w/1/2 bath, workout rm, bar space & family rm. Newly renovated inground pool, paitos, hot tub & cold plunge. This home is one not to be missed

RE/MAX Lakeside-West is the brokerage office representing the owner for this listing.
ยฉ Copyright 2025, Multiple Listing Service, Inc. All Rights Reserved. Information is supplied by seller and other third parties and has not been verified.
The data relating to real estate for sale on this site comes in part from the broker reciprocity program of the Multiple Listing Service, Inc. real estate listings held by brokerage firms other than are marked with the Broker Reciprocity logo or the Broker reciprocity house icon and detailed information about them includes the names(s) of the listing brokers.
IDX information is provided exclusively for consumersโ€™ personal, non-commercial use and that it may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing.
Prime Realty Group is not a Multiple Listing Service (MLS), nor does it offer MLS access. This website is a service of Prime Realty Group, a broker participant of the Multiple Listing Service, Inc. Data Source: MetroMLS | Data last updated at 11/23/2025 1:15:00 PM.

Better then new construction! Remodeled top to bottom! Grand 2 story foyer welcomes you. Stunning kitchen with an open concept floor plan & gorgeous HWFs, quartz counters, custom cabinets& beverage station. Kitchen open to inviting dining rm, perfect for entertaining. Family rm open to your kitchen. Features GFP & custom built ins. Sunrm w/wall to wall windows, french doors and open to back patio. Oversized living rm. Main floor 4th bedrm which is near the main floor full bath. Perfect for guests or in law area. Large laundry/mudrm. Master suite w/WIC and luxury bath. 2 additional upper large bedrms w/vaulted ceilings. Upper loft. Finished basement w/1/2 bath, workout rm, bar space & family rm. Newly renovated inground pool, paitos, hot tub & cold plunge. This home is one not to be missed

RE/MAX Lakeside-West is the brokerage office representing the owner for this listing.
ยฉ Copyright 2025, Multiple Listing Service, Inc. All Rights Reserved. Information is supplied by seller and other third parties and has not been verified.
The data relating to real estate for sale on this site comes in part from the broker reciprocity program of the Multiple Listing Service, Inc. real estate listings held by brokerage firms other than are marked with the Broker Reciprocity logo or the Broker reciprocity house icon and detailed information about them includes the names(s) of the listing brokers.
IDX information is provided exclusively for consumersโ€™ personal, non-commercial use and that it may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing.
Prime Realty Group is not a Multiple Listing Service (MLS), nor does it offer MLS access. This website is a service of Prime Realty Group, a broker participant of the Multiple Listing Service, Inc. Data Source: MetroMLS | Data last updated at 11/23/2025 1:15:00 PM.

\",\"OriginatingSystemMediaKey\":\"20251122232259588596000000\",\"MediaKey\":\"20251122232259588596000000\",\"ResourceRecordID\":\"20251122134720671230000000\",\"ResourceRecordKey\":\"20251122134720671230000000\"}]","MiddleOrJuniorSchool":"Wisconsin Hills","MiddleOrJuniorSchoolDistrict":"","MlsStatus":"Active","MobileDimUnits":"","MobileHomeRemainsYN":"","MobileLength":"","MobileWidth":"","Model":"","ModificationTimestamp":"2025-11-23T15:41:49Z","NeighborhoodFeatures":"","NetOperatingIncome":"","NetScheduledIncome":"","NewConstructionBuildersRequiredAddendumsYN":"","NewConstructionBuildersWarrantyYN":"","NewConstructionCCBType":"","NewConstructionCertificateOccupancyObtainedYN":"","NewConstructionEarlyIssueTitleInsurancePaidBy":"","NewConstructionEarlyIssueTitleInsurancePaidByDescription":"","NewConstructionEarlyReleaseEarnestMoneyYN":"","NewConstructionOccupancyCertificationDate":"","NewConstructionOregonCCBNoticesAttachedYN":"","NewConstructionPermitNumber":"","NewConstructionYN":"","NewTaxesExpense":"","NonOwnerOccBuyerAcceptTenantYN":"","NonOwnerOccEntryLevel":"","NonOwnerOccFurnished":"","NonOwnerOccLeaseExpiration":"","NonOwnerOccPetPolicies":"","NonOwnerOccPetsAllowedYN":"","NonOwnerOccRentType":"","NonOwnerOccRentalPermittedYN":"","NonOwnerOccRentalRestrictionDesc":"","NonOwnerOccUtilitiesAccessible":"","NumberOfBuildings":"","NumberOfFullTimeEmployees":"","NumberOfLots":"","NumberOfPads":"","NumberOfPartTimeEmployees":"","NumberOfSeparateElectricMeters":"","NumberOfSeparateGasMeters":"","NumberOfSeparateWaterMeters":"","NumberOfStallsFarm":"","NumberOfUnitsInCommunity":"","NumberOfUnitsLeased":"","NumberOfUnitsMoMo":"","NumberOfUnitsTotal":"","NumberOfUnitsVacant":"","NurseryArea":"","OccupancyTypes":"","OccupantName":"","OccupantPhone":"","OccupantType":"","OffMarketDate":"","OffMarketTimestamp":"","OfferInstructions":"","OfficeSquareFeet":"","OnMarketDate":"2025-11-22T06:00:00Z","OnMarketTimestamp":"","OpenHouseYN":"","OpenParkingSpaces":"","OpenParkingYN":"","OperatingExpense":"","OperatingExpenseIncludes":"","OperatingExpenseScheduled":"","OptionalAreaDescription":"","OptionalLevel":"","OptionalLevelAreaTotal":"","OrchardArea":"","OriginalEntryTimestamp":"2025-11-22T23:03:22Z","OriginalListPrice":"2225000","OriginalListPriceHigh":"","OriginalListPriceLow":"","OriginatingSystemID":"M00000662","OriginatingSystemKey":"20251122134720671230000000","OriginatingSystemName":"Metro MLS","OtherEquipment":"","OtherExpense":"","OtherParking":"","OtherStructures":"Storage Shed","OtherStructuresArea1":"","OtherStructuresArea2":"","OtherStructuresArea3":"","OtherStructuresArea4":"","OtherStructuresArea5":"","OtherStructuresArea6":"","OtherStructuresBaths1":"","OtherStructuresBaths2":"","OtherStructuresBaths3":"","OtherStructuresBaths4":"","OtherStructuresBaths5":"","OtherStructuresBaths6":"","OtherStructuresBathsTotal":"","OtherStructuresBedrooms1":"","OtherStructuresBedrooms2":"","OtherStructuresBedrooms3":"","OtherStructuresBedrooms4":"","OtherStructuresBedrooms5":"","OtherStructuresBedrooms6":"","OtherStructuresBedroomsTotal":"","OtherStructuresConstruction1":"","OtherStructuresConstruction2":"","OtherStructuresConstruction3":"","OtherStructuresConstruction4":"","OtherStructuresConstruction5":"","OtherStructuresConstruction6":"","OtherStructuresDimensions1":"","OtherStructuresDimensions2":"","OtherStructuresDimensions3":"","OtherStructuresDimensions4":"","OtherStructuresDimensions5":"","OtherStructuresDimensions6":"","OtherStructuresFeatures1":"","OtherStructuresFeatures2":"","OtherStructuresFeatures3":"","OtherStructuresFeatures4":"","OtherStructuresFeatures5":"","OtherStructuresFeatures6":"","OtherStructuresGarageDimensions":"","OtherStructuresGarageLevel":"","OtherStructuresGarageNoAttached":"","OtherStructuresGarageNoDetached":"","OtherStructuresGarageSqft":"","OtherStructuresNoStalls":"","OtherStructuresNoStructures":"","OtherStructuresRoof1":"","OtherStructuresRoof2":"","OtherStructuresRoof3":"","OtherStructuresRoof4":"","OtherStructuresRoof5":"","OtherStructuresRoof6":"","OtherStructuresType1":"","OtherStructuresType2":"","OtherStructuresType3":"","OtherStructuresType4":"","OtherStructuresType5":"","OtherStructuresType6":"","OtherStructuresYearBuilt1":"","OtherStructuresYearBuilt2":"","OtherStructuresYearBuilt3":"","OtherStructuresYearBuilt4":"","OtherStructuresYearBuilt5":"","OtherStructuresYearBuilt6":"","OwnerName":"","OwnerPays":"","OwnerPhone":"","Ownership":"","OwnershipType":"","ParcelNumber":"BR C1075011","ParcelNumber2":"","ParcelNumber3":"","ParkManagerName":"","ParkManagerPhone":"","ParkName":"","ParkingFeatures":"Electric Door Opener,Basement","ParkingTotal":"","PastureArea":"","PatioAndPorchFeatures":"Patio","PendingTimestamp":"","PercTestDescription":"","PercTestYN":"","PercentOwnership":"","PestControlExpense":"","PetsAllowed":"","Photo1URL":"","PhotosChangeTimestamp":"2025-11-22T23:03:24Z","PhotosCount":"53","PhotosExistYN":"","PoolExpense":"","PoolFeatures":"Inground Pool","PoolPrivateYN":"","Possession":"","PossibleUse":"","PostalCity":"Brookfield","PostalCode":"53045","PostalCodePlus4":"","PowerProduction":"","PowerProductionType":"","PreviousListPrice":"","PriceChangeTimestamp":"","PriceType":"","PrivateArea":"","PrivateOfficeRemarks":"","PrivateRemarks":"Seller would consider selling home fully furnished. Please use bill of sale if offer is financed, and refer to the items for sale sheet located in the home when showing for pricing reference. So many updates! Update sheet in MLS docs. Pre listing and furnace inspection in addtional docs. Seller can close anytime with occupancy through 1/1, but open to negotiate this.","ProfessionalManagementExpense":"","PropertyAttachedYN":"","PropertyCondition":"","PropertyRecordUpdateTimestamp":"","PropertyRestrictions1":"","PropertyRestrictions2":"","PropertySubType":"","PropertyType":"Single-Family","Property_sp_Information_co_Garage_sp_Type2":"","PublicRemarks":"Better then new construction! Remodeled top to bottom! Grand 2 story foyer welcomes you. Stunning kitchen with an open concept floor plan & gorgeous HWFs, quartz counters, custom cabinets& beverage station. Kitchen open to inviting dining rm, perfect for entertaining. Family rm open to your kitchen. Features GFP & custom built ins. Sunrm w/wall to wall windows, french doors and open to back patio. Oversized living rm. Main floor 4th bedrm which is near the main floor full bath. Perfect for guests or in law area. Large laundry/mudrm. Master suite w/WIC and luxury bath. 2 additional upper large bedrms w/vaulted ceilings. Upper loft. Finished basement w/1/2 bath, workout rm, bar space & family rm. Newly renovated inground pool, paitos, hot tub & cold plunge. This home is one not to be missed","PublicRemarksAmenities":"","PublicRemarksAssociation":"","PublicRemarksFarm":"","PublicRemarksFloatingHome":"","PublicRemarksNewConstruction":"","PublicRemarksNonOwnerOcc":"","PublicRemarksOtherStructures":"","PublicRemarksWaterRights":"","PublicSurveyRange":"","PublicSurveySection":"","PublicSurveyTownship":"","PurchaseContractDate":"","RVDescription":"","RVParkingDimensions":"","RangeArea":"","RentAmount":"","RentControlYN":"","RentIncludes":"","RoadFrontage":"","RoadFrontageType":"","RoadFrontageYN":"","RoadResponsibility":"","RoadSurfaceType":"","Roof":"","Room10Area":"","Room10Description":"","Room10Features":"","Room10FeaturesCont":"","Room10Length":"","Room10Level":"","Room10Width":"","Room11Area":"","Room11Description":"","Room11Features":"","Room11FeaturesCont":"","Room11Length":"","Room11Level":"","Room11Width":"","Room12Area":"","Room12Description":"","Room12Features":"","Room12FeaturesCont":"","Room12Length":"","Room12Level":"","Room12Width":"","Room13Area":"","Room13Description":"","Room13Features":"","Room13FeaturesCont":"","Room13Length":"","Room13Level":"","Room13Width":"","Room1Area":"","Room1Description":"","Room1Features":"","Room1FeaturesCont":"","Room1Length":"","Room1Level":"","Room1Width":"","Room2Area":"","Room2Description":"","Room2Features":"","Room2FeaturesCont":"","Room2Length":"","Room2Level":"","Room2Width":"","Room3Area":"","Room3Description":"","Room3Features":"","Room3FeaturesCont":"","Room3Length":"","Room3Level":"","Room3Width":"","Room4Area":"","Room4Description":"","Room4Features":"","Room4FeaturesCont":"","Room4Length":"","Room4Level":"","Room4Width":"","Room5Area":"","Room5Description":"","Room5Features":"","Room5FeaturesCont":"","Room5Length":"","Room5Level":"","Room5Width":"","Room6Area":"","Room6Description":"","Room6Features":"","Room6FeaturesCont":"","Room6Length":"","Room6Level":"","Room6Width":"","Room7Area":"","Room7Description":"","Room7Features":"","Room7FeaturesCont":"","Room7Length":"","Room7Level":"","Room7Width":"","Room8Area":"","Room8Description":"","Room8Features":"","Room8FeaturesCont":"","Room8Length":"","Room8Level":"","Room8Width":"","Room9Area":"","Room9Description":"","Room9Features":"","Room9FeaturesCont":"","Room9Length":"","Room9Level":"","Room9Width":"","RoomRemarksAmenities":"","RoomType":"","Rooms":"","RoomsTotal":"12","SaleIncludes":"","SeatingCapacity":"","SecurityFeatures":"","SeniorCommunityYN":"","SerialU":"","SerialX":"","SerialXX":"","Sewer":"Municipal Sewer","ShortSalePendingDate":"","ShortSaleYN":"","ShowingAdvanceNotice":"","ShowingAttendedYN":"","ShowingContactName":"","ShowingContactPhone":"","ShowingContactPhoneExt":"","ShowingContactType":"","ShowingDays":"","ShowingEndTime":"","ShowingInstructions":"Through agent 262-227-6462","ShowingRequirements":"","ShowingStartTime":"","Showing_sp_Notification_sp_Methods_co_Showing_sp_Service":"","SignOnPropertyYN":"","Skirt":"","SoilCondition":"","SoilTypeClassification":"","SoldPricePerSquareFeet":"","SourceSystemID":"M00000662","SourceSystemKey":"20251122134720671230000000","SourceSystemName":"Metro MLS","SpaFeatures":"","SpaYN":"","SpecialLicenses":"","SpecialListingConditions":"","StandardStatus":"Active","StateOrProvince":"WI","StateRegion":"","StatusChangeTimestamp":"2025-11-22T23:03:22Z","Storage":"","Stories":"","StoriesTotal":"","StreetAdditionalInfo":"","StreetDirPrefix":"","StreetDirSuffix":"","StreetName":"Buckingham","StreetNumber":"2490","StreetNumberNumeric":"2490","StreetSuffix":"Pl","StreetSuffixModifier":"","StructureType":"","SubdivisionName":"Chateau Royale","SupplementNumber":"","SuppliesExpense":"","SyndicateTo":"","SyndicationRemarks":"","TaxAnnualAmount":"10018","TaxAssessedValue":"","TaxBlock":"","TaxBookNumber":"","TaxLegalDescription":"","TaxLot":"","TaxMapNumber":"","TaxOtherAnnualAssessmentAmount":"","TaxParcelLetter":"","TaxStatusCurrent":"","TaxTract":"","TaxYear":"2024","TenantPays":"","ThirdPartyApprovalYN":"","Topography":"","TotalActualRent":"","Township":"","TrashExpense":"","TruckDoorDescription":"","TruckDoorTotal":"","UnitLocation":"","UnitNumber":"","UnitType10ActualRent":"","UnitType10Area":"","UnitType10BathsTotal":"","UnitType10BedsTotal":"","UnitType10Features":"","UnitType10UnitsTotal":"","UnitType1ActualRent":"","UnitType1Area":"","UnitType1BathsTotal":"","UnitType1BedsTotal":"","UnitType1Features":"","UnitType1UnitsTotal":"","UnitType2ActualRent":"","UnitType2Area":"","UnitType2BathsTotal":"","UnitType2BedsTotal":"","UnitsFurnished":"","PhotoRemarks":"[{\"Order\":1,\"Remarks\":\"Welcome Home\"},{\"Order\":2,\"Remarks\":\"Renovated top to bottom, inside and out\"},{\"Order\":3,\"Remarks\":\"Views from above. New pool and spa renov\"},{\"Order\":4,\"Remarks\":\"Aerial views of this stunning property\"},{\"Order\":5,\"Remarks\":\"Gorgeous front entry\"},{\"Order\":6,\"Remarks\":\"Grand 2 story staircase\"},{\"Order\":7,\"Remarks\":\"Fantastic 2 story foyer\"},{\"Order\":8,\"Remarks\":\"Spectacular new kitchen fully renovated\"},{\"Order\":9,\"Remarks\":\"Kitchen renovation fully opened the floo\"},{\"Order\":10,\"Remarks\":\"Custom lighting and gorgeous hardwoods\"},{\"Order\":11,\"Remarks\":\"Farmhouse sink and lovely views\"},{\"Order\":12,\"Remarks\":\"Custom appliances and charming features\"},{\"Order\":13,\"Remarks\":\"Eat in area open to pool area\"},{\"Order\":14,\"Remarks\":\"Dinette space and beverage center\"},{\"Order\":15,\"Remarks\":\"Spectacular dining room open to kitchen\"},{\"Order\":16,\"Remarks\":\"Crown molding and gleaming hardwoods\"},{\"Order\":17,\"Remarks\":\"Family room open to kitchen\"},{\"Order\":18,\"Remarks\":\"Family room with fireplace and custom bu\"},{\"Order\":19,\"Remarks\":\"Lovely sunnny sunroom open to family and\"},{\"Order\":20,\"Remarks\":\"Living room open to sunroom\"},{\"Order\":21,\"Remarks\":\"Spacious living space\"},{\"Order\":22,\"Remarks\":\"Large living room with loads of light\"},{\"Order\":23,\"Remarks\":\"Main floor bedroom 4\"},{\"Order\":24,\"Remarks\":\"Lovely hardwoods and near first floor fu\"},{\"Order\":25,\"Remarks\":\"Renovated full bath on main floor\"},{\"Order\":26,\"Remarks\":\"First floor full bath with stunning tile\"},{\"Order\":27,\"Remarks\":\"Main floor laundry with pool access\"},{\"Order\":28,\"Remarks\":\"Large master suite with vanity, walk in\"},{\"Order\":29,\"Remarks\":\"Renovated master bath\"},{\"Order\":30,\"Remarks\":\"Luxury fixtures and tile work\"},{\"Order\":31,\"Remarks\":\"Bedroom 2 with built ins and vaulted cei\"},{\"Order\":32,\"Remarks\":\"Another view of bedroom 2\"},{\"Order\":33,\"Remarks\":\"Bedroom 3 with vaulted ceilings and load\"},{\"Order\":34,\"Remarks\":\"Another view of bedroom 3\"},{\"Order\":35,\"Remarks\":\"Upper full renovated bath\"},{\"Order\":36,\"Remarks\":\"Walk in shower and custom tile work\"},{\"Order\":37,\"Remarks\":\"Upper loft\"},{\"Order\":38,\"Remarks\":\"Newly finished basement with beautiful f\"},{\"Order\":39,\"Remarks\":\"Egress window and lovely family room are\"},{\"Order\":40,\"Remarks\":\"Bar and seating area\"},{\"Order\":41,\"Remarks\":\"Space for a game table and entertainment\"},{\"Order\":42,\"Remarks\":\"Newly renovated basement bathroom\"},{\"Order\":43,\"Remarks\":\"Workout Room\"},{\"Order\":44,\"Remarks\":\"Private retreat space\"},{\"Order\":45,\"Remarks\":\"Hot tub and pool area\"},{\"Order\":46,\"Remarks\":\"Lovely pool deck area\"},{\"Order\":47,\"Remarks\":\"Fire pit gathering space\"},{\"Order\":48,\"Remarks\":\"Cold plunge space, new patio and fire pi\"},{\"Order\":49,\"Remarks\":\"Private backyard space\"},{\"Order\":50,\"Remarks\":\"New pool cover ready for the winter seas\"},{\"Order\":51,\"Remarks\":\"Lovely private back area\"},{\"Order\":52,\"Remarks\":\"Expansive yard, cul de sac location\"},{\"Order\":53,\"Remarks\":\"West facing for glorious sunset views\"}]","PhotoOrder":"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53","CustomVTourURL":""}; var mls_open_house = null; var mls_price_history = [{"PRICE":2225000.00,"TIMESTAMP":"2025-11-22T23:23:15"}]; var mls_status_history = [{"STATUS":"Active","TIMESTAMP":"2025-11-22T23:23:15"}]; var agency_offices = ("30801,30801").split(","); var agency_logo_path = "/.a/defaultlogo.webp"; var photo_interval_counter = 0; var sold_limited = false; var detail_template = ""; on_load(function() { parse_detail_data() && mls_property_detail(); if(getQueryString("print") == "yes") setTimeout(print_property, 5000); }); function mls_property_detail(type) { let content = document.getElementById("detail_content"); if(!content) return; type = type || get_global_config("mls_property_detail_type"); let func_name = "mls_property_detail_" + type; let template = document.getElementById(func_name); if(!template) return; content.appendChild(template); for(let i=0; i 1) mls_data.PHOTOCOUNT = 1; if(mls_data.PHOTOREMARKS) { if(mls_data.PHOTOREMARKS[0] == "'") mls_data.PHOTOREMARKS2 = mls_data.PHOTOREMARKS.substring(1, mls_data.PHOTOREMARKS.length-1); mls_data.PHOTOREMARKS2 = JSON.parse(mls_data.PHOTOREMARKS); } else mls_data.PHOTOREMARKS2 = []; if(mls_data.PHOTOORDER) { mls_data.PHOTOORDER2 = mls_data.PHOTOORDER.split(","); } else { mls_data.PHOTOORDER2 = []; for(let i=0; i= 2) show_dialog("", result[1], ["OK"]); else show_dialog("", result[0], ["OK"]); }, function (data) { if (on_error != undefined) on_error("Error in POST."); }, show_message("Sending...", -1)); //, ; } function get_detail_information() { let str = ""; if(sold_limited) { str += get_sold_summary_html(); } else { str += get_contact_form_html(); str += get_open_houses_html(); str += get_vtour_html(); str += get_summary_html(); str += get_room_data_html(); str += get_more_details_html(); str += get_property_waterfront_details_html(); str += get_others_html(); if(mls_data.MLSCLASS == "COM" || mls_data.MLSCLASS == "RNT") { str += get_unit_info_html(); if(get_str(mls_full.PropertyUnitTypes).startsWith("[{")) { mls_full.PropertyUnits = JSON.parse(mls_full.PropertyUnitTypes); for(let i=mls_full.PropertyUnits.length; i<4; i++) mls_full.PropertyUnits.push({}); } else if(get_str(mls_full.UnitTypes).startsWith("[{")) { mls_full.PropertyUnits = JSON.parse(mls_full.UnitTypes); for(let i=mls_full.PropertyUnits.length; i<4; i++) mls_full.PropertyUnits.push({}); } else mls_full.PropertyUnits = [{}, {}, {}, {}]; str += get_unit_html(1); str += get_unit_html(2); str += get_unit_html(3); str += get_unit_html(4); str += get_bmj_unit_html("Unit 1", mls_full.FEAT20110114205341292541000000, mls_full.FEAT20110114205341648345000000, mls_full.FEAT20110114205341031884000000, mls_full.FEAT20110114205341342554000000, mls_full.FEAT2011011420533980143800000, mls_full.FEAT20110114205341527656000000, mls_full.FEAT20110114205340480615000000, mls_full.GF20110114205248798385000000, mls_full.GF20110114205248901224000000, mls_full.GF20110114205248852390000000); str += get_bmj_unit_html("Unit 2", mls_full.FEAT20110114205343671412000000, mls_full.FEAT20110114205344095957000000, mls_full.FEAT20110114205343414619000000, mls_full.FEAT20110114205343723926000000, mls_full.FEAT20110114205342315282000000, mls_full.FEAT20110114205343937502000000, mls_full.FEAT20110114205342843861000000, mls_full.GF20110114205248952471000000, mls_full.GF20110114205249057201000000, mls_full.GF20110114205249005758000000); str += get_bmj_unit_html("Unit 3", mls_full.FEAT20110114205346564000000000, mls_full.FEAT20110114205347124248000000, mls_full.FEAT20110114205346255896000000, mls_full.FEAT20110114205346765720000000, mls_full.FEAT20110114205344908967000000, mls_full.FEAT20110114205346989087000000, mls_full.FEAT20110114205345540378000000, mls_full.GF20110114205249113238000000, mls_full.GF20110114205249209838000000, mls_full.GF20110114205249159858000000); str += get_bmj_unit_html("Unit 4", mls_full.FEAT20110114205349395052000000, mls_full.FEAT20110114205349803075000000, mls_full.FEAT20110114205349190784000000, mls_full.FEAT20110114205349469449000000, mls_full.FEAT20110114205347847597000000, mls_full.FEAT20110114205349652210000000, mls_full.FEAT20110114205348518369000000, mls_full.GF20110114205249251824000000, mls_full.GF20110114205249351978000000, mls_full.GF20110114205249301547000000); str += get_raor_unit_html("Unit 1", mls_full.LM_char5_12, mls_full.LM_char5_13, mls_full.LM_Int1_2, mls_full.LM_char10_42, mls_full.LM_char5_14, mls_full.LM_char5_15); str += get_raor_unit_html("Unit 2", mls_full.LM_char5_16, mls_full.LM_char5_17, mls_full.LM_Int1_3, mls_full.LM_char10_43, mls_full.LM_char5_18, mls_full.LM_char5_19); str += get_raor_unit_html("Unit 3", mls_full.LM_char5_20, mls_full.LM_char5_21, mls_full.LM_Int1_4, mls_full.LM_char10_44, mls_full.LM_char5_22, mls_full.LM_char5_23); str += get_raor_unit_html("Unit 4", mls_full.LM_char5_24, mls_full.LM_char5_25, mls_full.LM_Int1_5, mls_full.LM_char10_45, mls_full.LM_char5_26, mls_full.LM_char5_27); str += get_raor_unit_html("Unit 5", mls_full.LM_char5_28, mls_full.LM_char5_29, mls_full.LM_Int1_6, mls_full.LM_char10_46, mls_full.LM_char5_30, mls_full.LM_char5_31); } } return str; } function get_raor_unit_html(label, rooms, beds, baths, utils, appls, rent) { let t = get_element_html(detail_template + "_section"); let str = ""; if(rooms == 0) return ""; str += get_sub_section_html("Monthly Rent:", price_str(rent)).replaceAll(", ", ","); str += get_sub_section_html("Rooms:", rooms); str += get_sub_section_html("Bedrooms:", beds); str += get_sub_section_html("Bathrooms:", baths); str += get_sub_section_html("Appliances:", appls); str += get_sub_section_html("Utilities:", utils); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", label) .replaceAll("$CONTENT$", str); } function get_bmj_unit_html(label, rent, rooms, roomdesc, size, beds, baths, fires, airs, amms, apps) { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Monthly Rent:", price_str(rent)).replaceAll(", ", ","); str += get_sub_section_html("Rooms:", get_array_joined([rooms, roomdesc], ", ")); str += get_sub_section_html("Size:", get_num1(size), " sq ft"); str += get_sub_section_html("Bedrooms:", beds); str += get_sub_section_html("Bathrooms:", baths); str += get_sub_section_html("Fireplaces:", fires); str += get_sub_section_html("Air Conditiong:", airs); str += get_sub_section_html("Ammenities:", amms); str += get_sub_section_html("Appliances:", apps); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", label) .replaceAll("$CONTENT$", str); } function get_unit_html(i) { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Number of This Unit:", get_array_item([mls_full.PropertyUnits[i-1].UnitTypeUnitsTotal])); str += get_sub_section_html("Monthly Rent:", price_str(get_array_item([mls_full.PropertyUnits[i-1].NST_TotalRent]))).replaceAll(", ", ","); str += get_sub_section_html("Expenses:", price_str(get_array_item([mls_full.PropertyUnits[i-1].NST_UnitExp]))).replaceAll(", ", ","); str += get_sub_section_html("Rooms:", get_array_joined([get_array_item([mls_full.PropertyUnits[i-1].NST_UnitRoomsTotal], " rooms"), mls_full.PropertyUnits[i-1].NST_UnitRoomSpec], ", ")); str += get_sub_section_html("Bedrooms:", get_array_item([mls_full.PropertyUnits[i-1].UnitTypeBedsTotal])); str += get_sub_section_html("Bathrooms:", get_array_item([mls_full.PropertyUnits[i-1].UnitTypeBathsTotal])); str += get_sub_section_html("Size:", get_array_item([mls_full.PropertyUnits[i-1].NST_UnitSqFt]), " sqft"); str += get_sub_section_html("Amenities:", get_array_item([mls_full.PropertyUnits[i-1].NST_UnitAmenities])); str += get_sub_section_html("Annual Rent:", price_str(get_array_item([mls_full.PropertyUnits[i-1].NST_UnitAnnualRent]))).replaceAll(", ", ","); str += get_sub_section_html("Actual Rent:", price_str(get_array_item([mls_full.PropertyUnits[i-1].UnitTypeActualRent]))).replaceAll(", ", ","); str += get_sub_section_html("Appliances:", get_array_item([mls_full.PropertyUnits[i-1].NST_UnitAppl])); for(let j=1; j<=4; j++) { str += get_sub_section_html("Bedroom "+j+":", connect_data(get_array_item([mls_data["UNIT"+i+"_UNITB"+j+"DIM"], mls_full["NST_RoomUnit"+i+"Bedroom"+j+"Dimensions"]]), get_data_str(get_array_item([mls_data["UNIT"+i+"_UNITB"+j+"LEVEL"], mls_full["NST_RoomUnit"+i+"Bedroom"+j+"Level"]]), " Floor"), ", ")); } str += get_sub_section_html("AC/Cooling System:", get_array_item([mls_full.PropertyUnits[i-1].NST_UnitCoolSystem])); str += get_sub_section_html("Dining Room:", get_array_joined([get_array_joined([get_array_item([mls_data["UNIT"+i+"_UNITDRDIM"], mls_full["NST_RoomUnit"+i+"DiningRoomDimensions"]]), get_array_item([mls_data["UNIT"+i+"_UNITDR"], mls_full["NST_RoomUnit"+i+"DiningRoomFeatures"]])], ", "), get_array_item([mls_data["UNIT"+i+"_UNITDRLEVEL"], mls_full["NST_RoomUnit"+i+"DiningRoomLevel"]], " floor")], " on ")); for(let j=1; j<=6; j++) { str += get_sub_section_html(get_array_item([mls_data["UNIT"+i+"_UNITE"+j+"NAME"], mls_full["NST_RoomUnit"+i+"ExtraRoom"+j+"Description"]]) + ":", connect_data(get_array_item([mls_data["UNIT"+i+"_UNITE"+j+"DIM"], mls_full["NST_RoomUnit"+i+"ExtraRoom"+j+"Dimensions"]]), get_data_str(get_array_item([mls_data["UNIT"+i+"_UNITE"+j+"LEVEL"], mls_full["NST_RoomUnit"+i+"ExtraRoom"+j+"Level"]]), " floor"), " on ")); } str += get_sub_section_html("Family Room:", connect_data(connect_data(get_array_item([mls_data["UNIT"+i+"_UNITFRDIM"], mls_full["NST_RoomUnit"+i+"FamilyRoomDimensions"]]), get_array_item([mls_data["UNIT"+i+"_UNITFRCHAR"], mls_full["NST_RoomUnit"+i+"FamilyRoomFeatures"]]), ", "), get_data_str(get_array_item([mls_data["UNIT"+i+"_UNITFRLEVEL"], mls_full["NST_RoomUnit"+i+"FamilyRoomLevel"]]), " Floor"), " on ")); str += get_sub_section_html("Kitchen:", connect_data(get_array_item([mls_data["UNIT"+i+"_UNITKTDIM"], mls_full["NST_RoomUnit"+i+"KitchenDimensions"]]), get_data_str(get_array_item([mls_data["UNIT"+i+"_UNITKTLEVEL"], mls_full["NST_RoomUnit"+i+"KitchenLevel"]]), " Floor"), " on ")); str += get_sub_section_html("Living Room:", connect_data(get_array_item([mls_data["UNIT"+i+"_UNITLRDIM"], mls_full["NST_RoomUnit"+i+"LivingRoomDimensions"]]), get_data_str(get_array_item([mls_data["UNIT"+i+"_UNITLRLEVEL"], mls_full["NST_RoomUnit"+i+"LivingRoomLevel"]]), " floor"), " on ")); str += get_sub_section_html("Parking:", get_array_item([mls_full.PropertyUnits[i-1].NST_UnitParking])); str += get_sub_section_html("Fireplaces:", get_array_joined([get_array_item([mls_data["UNIT"+i+"_UNITFIREPLACENUM"], mls_full["NST_U"+i+"UnitFireplaceNum"]]), get_array_item([mls_full["NST_U"+i+"UnitFireplaceLocation"]])], ", ")); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Unit " + i) .replaceAll("$CONTENT$", str); } function get_unit_info_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_unit_summary_html(); str += get_unit_financials_html(); str += get_unit_expense_html(); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Unit Information") .replaceAll("$CONTENT$", str); } function get_unit_expense_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Land Lease Amount:", price_str(get_array_item([mls_full.LandLeaseAmount]))); str += get_sub_section_html("Electricity:", price_str(get_array_item([mls_data.EXPENSEELECTRIC, mls_full.ElectricExpense]))); str += get_sub_section_html("Gas/Fuel:", price_str(get_array_item([mls_data.EXPENSEFUEL, mls_full.FuelExpense]))); str += get_sub_section_html("Caretaker Cost:", price_str(get_array_item([mls_data.EXPENSECARETAKER]))); str += get_sub_section_html("Maintenance:", price_str(get_array_item([mls_data.EXPENSEMAINTENANCE, mls_full.MaintenanceExpense, mls_full.LM_char10_38]))); str += get_sub_section_html("Operating:", price_str(get_array_item([mls_full.OperatingExpense]))); str += get_sub_section_html("Trash:", price_str(get_array_item([mls_data.EXPENSETRASH, mls_full.TrashExpense]))); str += get_sub_section_html("Sewer:", price_str(get_array_item([mls_data.EXPENSEWATERSEWER, mls_full.WaterSewerExpense]))); str += get_sub_section_html("Insurance:", price_str(get_array_item([mls_full.InsuranceExpense, mls_full.LM_char10_37]))); str += get_sub_section_html("Manager:", price_str(get_array_item([mls_full.ManagerExpense, mls_full.LM_char10_36]))); str += get_sub_section_html("Utilities:", price_str(get_array_item([mls_full.LM_char10_39]))); str += get_sub_section_html("Other:", price_str(get_array_item([mls_full.OtherExpense, mls_full.LM_char10_41]))); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Expenses") .replaceAll("$CONTENT$", str.replaceAll(", ", ",")); } function get_unit_financials_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Total Yearly Income:", price_str(get_array_item([mls_data.GROSSINCOME, mls_full.GrossIncome, mls_full.FEAT20110114205331984825000000, mls_full.LM_char10_33]))).replaceAll(", ", ","); str += get_sub_section_html("Total Yearly Expenses:", price_str(get_array_item([mls_data.EXPENSETOTALANN, mls_full.NST_Expenses, mls_full.FEAT20110114205331883090000000, mls_full.LM_char10_34]))).replaceAll(", ", ","); str += get_sub_section_html("Owner Expenses:", get_array_item([mls_data.OWNERSEXPENSE, mls_full.OwnerPays, mls_full.GF20110204205632639460000000])); str += get_sub_section_html("Tenant Pays:", get_array_item([mls_data.TENANTEXPENSES, mls_full.TenantPays, mls_full.GF20110204205648709013000000])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Financials") .replaceAll("$CONTENT$", str); } function get_unit_summary_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Rental Units:", get_array_item([mls_data.TOTALUNITS, mls_full.NumberOfUnitsTotal, mls_full.LIST_65, mls_full.L_NumUnits])); str += get_sub_section_html("Shared Space:", get_array_item([mls_data.SHAREDROOMS, mls_full.NST_SharedRooms, mls_full.GF20110114205247594353000000])); str += get_sub_section_html("Bathrooms:", mls_data.TOTALBATHROOMS); str += get_sub_section_html("Bedrooms:", mls_data.TOTALBEDROOMS); str += get_sub_section_html("Stoves:", get_array_item([mls_data.RANGENUM, mls_full.NST_RangeNum])); str += get_sub_section_html("Refridgerators:", get_array_item([mls_data.REFRIGERATORNUM, mls_full.NST_RefrigeratorNum])); str += get_sub_section_html("Rental License:", get_array_item([mls_data.RENTALLICENSEYN, mls_full.NST_RentalLicenseYN]) ? get_array_item([mls_data.RENTALLICENSETYPE, mls_full.NST_RentalLicenseType]) : ""); str += get_sub_section_html("Rental License:", get_array_item([mls_full.LIST_97, mls_full.LFD_RENT_42])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Summary") .replaceAll("$CONTENT$", str); } function get_contact_form_html() { let t = get_element_html(detail_template + "_section"); return t .replaceAll("$CUSTOMCLS$", "fixed noprint") .replaceAll("$LABEL$", "Request Additional Details") .replaceAll("$CONTENT$", get_element_html(detail_template + "_request_form")); } function short_time_str(date) { let h = date.getHours(); let m = date.getMinutes(); if (m < 10) m = "0" + m; if (h == 0) return "12:" + m + "AM"; if (h < 12) return h + ":" + m + "AM"; if (h == 12) return "12:" + m + "PM"; return (h - 12) + ":" + m + "PM"; } function get_open_houses_html() { if (mls_data.OPENHOUSE == undefined && mls_open_house == null) return ""; let t = get_element_html(detail_template + "_section"); let str = ""; if(!is_null(mls_data.OPENHOUSE)) { str += get_sub_section_html("", mls_data.OPENHOUSE[0].Description); str += get_sub_section_html("", mls_data.OPENHOUSE[0].PublicRemarks); if (mls_data.OPENHOUSE[0].PublicRemarks != mls_data.OPENHOUSE[0].Remarks) str += get_sub_section_html("", mls_data.OPENHOUSE[0].Remarks); } if(!is_null(mls_open_house)) str += get_sub_section_html("", mls_open_house[0].PublicRemarks); let opens = []; let str2; if(!is_null(mls_data.OPENHOUSE)) mls_data.OPENHOUSE.forEach(function (o) { let start = new Date(o.StartDate + "Z"); let end = new Date(o.EndDate + "Z"); let start_date = start.toLocaleDateString(); let end_date = end.toLocaleDateString(); let start_time = short_time_str(start); let end_time = short_time_str(end); let str3 = start_date + " " + start_time + "-" + (start_date == end_date ? "" : end_date + " ") + end_time; if (str2 == str3) return; str2 = str3; opens.push(str3); }); if(!is_null(mls_open_house)) mls_open_house.forEach(function (o) { let start = new Date(o.StartDate + "Z"); let end = new Date(o.EndDate + "Z"); let start_date = start.toLocaleDateString(); let end_date = end.toLocaleDateString(); let start_time = short_time_str(start); let end_time = short_time_str(end); let str3 = start_date + " " + start_time + "-" + (start_date == end_date ? "" : end_date + " ") + end_time; if (str2 == str3) return; str2 = str3; opens.push(str3); }); str += get_sub_section_html("Open Date & Time:", opens.join(", ")); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Open House") .replaceAll("$CONTENT$", str); } function get_vtour_html() { let t = get_element_html(detail_template + "_section"); let str = ""; let tour1 = get_array_item([mls_full.CustomVTourURL, mls_data.VIRTUALTOUR_URL1]); let tour2 = get_array_item([mls_full.NST_VirtualTourURLUnbranded2, mls_data.VIRTUALTOUR_URL2]); if (tour1 != "") str += ""; if (tour2 != "") str += ""; if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Virtual Tours") .replaceAll("$CONTENT$", str); } function get_others_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_school_html(); str += get_finance_html(); str += get_listing_html(); str += get_special_html(); str += get_survey_html(); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Others") .replaceAll("$CONTENT$", str); } function get_survey_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Range:", get_array_item([mls_full.PublicSurveyRange])); str += get_sub_section_html("Section:", get_array_item([mls_full.PublicSurveySection])); str += get_sub_section_html("Township:", get_array_item([mls_full.PublicSurveyTownship])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Public Survey") .replaceAll("$CONTENT$", str); } function get_special_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Handicap Access:", mls_data.HANDICAPACCESS != "None" ? mls_data.HANDICAPACCESS : null); str += get_sub_section_html("Manufactured Home:", mls_data.IS_MANUFACTUREDHOME == 1 ? "Yes" : null); str += get_sub_section_html("Internet Options:", get_array_item([mls_full.NST_InternetOptions])); str += get_sub_section_html("Present Use:", get_array_item([mls_full.NST_PresentUse])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Special Notes") .replaceAll("$CONTENT$", str); } function get_listing_html() { let t = get_element_html(detail_template + "_section"); let days0 = get_array_item([mls_data.DAYSONMARKET, mls_full.DaysOnMarket, mls_full.LIST_137]); let days1 = get_array_item([mls_data.DAYSONMARKETCUMULATIVE, mls_full.CumulativeDaysOnMarket]); let str = ""; str += get_sub_section_html("Listed Price:", price_str(mls_data.LISTPRICE) + mls_hotdata_html(mls_data)).replaceAll(", ", ","); str += get_sub_section_html("Days on market:", days0, " days"); str += get_sub_section_html("First Listed at:", datetime_string(mls_data.LISTDATE)); str += get_sub_section_html("Last Updated at:", datetime_string(mls_data.MODIFICATIONTIMESTAMP)); str += get_sub_section_html("Total Days on Market:", days0 != days1 ? days1 : null, " days"); str += get_sub_section_html("Contingencies:", get_array_item([mls_data.CONTINGENCY, mls_full.Contingency, mls_full.LIST_19])); str += get_sub_section_html("Assessments:", get_array_item([mls_data.ASSESSMENTPENDING, mls_full.NST_AssessmentPending, mls_full.LIST_86, get_array_joined([mls_full.LM_Char25_2, mls_full.LM_Char25_30], ", ")])); str += get_sub_section_html("Association Fee:", get_array_item([mls_data.ASSOCFEEYN, mls_full.AssociationYN]) ? price_str(get_array_item([mls_data.ASSOCIATIONFEE, mls_full.AssociationFee, mls_full.FEAT20110114205321972555000000])) : null).replaceAll(", ", ","); str += get_sub_section_html("Foreclosure:", mls_data.FORECLOSURE); str += get_sub_section_html("Auction:", get_bit_item(mls_data.AUCTIONYN)); str += get_sub_section_html("Lender Owned:", get_array_item([mls_data.LENDEROWNED, mls_full.LIST_110])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Listing Data") .replaceAll("$CONTENT$", str); } function get_school_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("District Number:", mls_data.SCHOOLDISTRICTNUMBER); str += get_sub_section_html("District Phone:", mls_data.SCHOOLDISTRICTPHONE); str += get_sub_section_html("Elementry:", mls_data.SCHOOLELEMENTARY); str += get_sub_section_html("Middle:", mls_data.SCHOOLMIDDLE); str += get_sub_section_html("High:", mls_data.SCHOOLHIGH); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "School Information") .replaceAll("$CONTENT$", str); } function get_finance_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Tax Property ID:", get_array_item([mls_data.PID, mls_full.ParcelNumber, mls_full.LIST_80, mls_full.LM_Char25_4])); str += get_sub_section_html("Tax Amount:", get_array_joined([ price_str(get_array_item([mls_data.TAXES, mls_full.TaxAnnualAmount, mls_full.LIST_75])), get_array_item([mls_data.TAXYEAR, mls_full.TaxYear, mls_full.LIST_76]) ], " for ")).replaceAll(", ", ","); let asset = mls_data.TAXWITHASSESSMENTS - mls_data.TAXES; str += get_sub_section_html("Assessments:", asset > 0 ? price_str(asset) : null); str += get_sub_section_html("Homestead:", mls_data.HOMESTEADDESC); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Financial Considerations") .replaceAll("$CONTENT$", str); } function get_property_waterfront_details_html() { let t = get_element_html(detail_template + "_section"); let str1 = get_property_details_html(); let str2 = get_waterfront_details_html(); let str = str1 + str2; if (str == "") return ""; if (str1 == "") return str2; if (str2 == "") return str1; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Property / Waterfront") .replaceAll("$CONTENT$", str); } function get_property_details_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Description:", mls_data.LOTDESCRIPTION); str += get_sub_section_html("Frontage:", get_array_item([mls_data.FRONTAGEFEET, mls_full.RoadFrontageType, mls_full.GF20110114205235046167000000, mls_full.GF20110114205242291497000000, mls_full.GF20110114205242397400000000, mls_full.GF20110114205252026359000000, mls_full.GF20110114205252760386000000, mls_full.LFD_ROADFRONTAGE_31, mls_full.LFD_ROADFRONTAGE_31])); str += get_sub_section_html("Garage:", get_array_joined([ get_array_item([mls_data.PARKINGGARAGE, mls_full.GarageSpaces, mls_full.LIST_125, mls_full.L_Keyword3], " spaces"), get_array_item([mls_data.GARAGEDESCRIPTION, mls_full.ParkingFeatures, mls_full.GF20110114205248104656000000, mls_full.GF20110114205248104656000000, mls_full.GF20110114205250168635000000, get_array_joined([mls_full.LFD_GARAGE_4, mls_full.LFD_GARAGE_84, mls_full.LM_Char10_28, mls_full.LFD_PARKING_36, mls_full.LFD_PARKING_47], ",") ]) ], ", ")); str += get_sub_section_html("Pool Features:", get_array_item([mls_data.POOLDESCRIPTION, mls_full.PoolFeatures, mls_full.GF20110114205234991063000000, mls_full.GF20110114205248490668000000, mls_full.GF20110114205250361234000000])); str += get_sub_section_html("Lot Dimensions:", get_array_item([mls_data.LOTSIZEDIMENSIONS, mls_full.LotSizeDimensions, mls_full.LIST_56, get_array_joined([mls_full.LM_Dec_1, mls_full.LM_Dec_2], "x") ])); str += get_sub_section_html("Amentities Unit:", get_array_item([mls_data.AMENITIESUNIT, mls_full.NST_AmenitiesUnit, get_array_joined([ mls_full.GF20110114205246780767000000, mls_full.GF20110114205235074697000000, mls_full.GF20110114205246834821000000, mls_full.GF20110114205247524779000000, mls_full.GF20110114205247594353000000, mls_full.GF20110114205249559836000000, mls_full.GF20110114205249609327000000, mls_full.GF20110114205249712770000000, mls_full.GF20110114205251236902000000, mls_full.GF20110114205251344315000000 ], ", ") ])); str += get_sub_section_html("Out Building:", mls_data.OUTBUILDINGS); str += get_sub_section_html("Agent Owned:", mls_data.AGENTOWNER == 1 ? "Yes" : "No"); str += get_sub_section_html("Development Status:", get_array_item([mls_full.DevelopmentStatus])); str += get_sub_section_html("Utilities:", get_array_item([mls_full.Utilities])); str += get_sub_section_html("Improvements:", get_array_item([mls_full.NST_Improvements])); str += get_sub_section_html("Topography:", get_array_item([mls_full.Topography])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Property Details") .replaceAll("$CONTENT$", str); } function get_waterfront_details_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Body of Water:", mls_data.WATERFRONTNAME);// str += get_sub_section_html("DNR Lake ID:", get_str(mls_data.WATERFRONTNUM).trim() != "" ? "" + mls_data.WATERFRONTNUM + "" : null); str += get_sub_section_html("Type:", mls_data.LAKEWATERFRONT);// str += get_sub_section_html("Frontage:", get_array_item([mls_data.WATERFRONTFEET, mls_full.NST_WaterfrontFeet], " ft")); str += get_sub_section_html("Lake Acres:", get_num1(mls_data.LAKEACRES), " acres");// str += get_sub_section_html("Max Depth:", get_array_item([mls_data.LAKEDEPTH, mls_full.NST_LakeDepth], " ft")); str += get_sub_section_html("Bottom:", mls_data.LAKEBOTTOM);// str += get_sub_section_html("View:", mls_data.WATERFRONTVIEW);// str += get_sub_section_html("Elevation:", get_array_item([mls_data.WATERFRONTELEVATION, mls_full.NST_WaterfrontElevation])); str += get_sub_section_html("Slope:", get_array_item([mls_data.WATERFRONTSLOPE1, mls_full.NST_WaterfrontSlope])); str += get_sub_section_html("Lakechain:", mls_data.LAKECHAINNAME);// str += get_sub_section_html("Lakechain Acres:", get_num1(get_array_item([mls_data.LAKECHAINACREAGE, mls_full.NST_LakeChainAcreage], " acres"))); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Waterfront Details") .replaceAll("$CONTENT$", str); } function get_more_details_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_in_home_details_html(); str += get_home_details_html(); str += get_utilities_html(); if (str == "") return ""; let title = "Details"; if (mls_data.MLSCLASS == "RES") title = "Home Details"; if (mls_data.MLSCLASS == "COM") title = "Building Details"; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", title) .replaceAll("$CONTENT$", str); } function get_bathrooms_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Full Baths:", get_array_item([mls_data.BATHSFULL, mls_full.BathroomsFull, mls_full.LIST_68])); str += get_sub_section_html("3/4 Baths:", get_array_item([mls_data.BATHSTHREEQUARTER, mls_full.BathroomsThreeQuarter, mls_full.LIST_70])); str += get_sub_section_html("1/2 Baths:", get_array_item([mls_data.BATHSHALF, mls_full.BathroomsHalf, mls_full.LIST_69])); str += get_sub_section_html("1/4 Baths:", get_array_item([mls_data.BATHQUARTER, mls_full.BathroomsOneQuarter, mls_full.LIST_52])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Bathrooms") .replaceAll("$CONTENT$", str); } function get_more_room_details_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Family:", get_array_item([mls_data.ROOMFAMILYCHAR, mls_full.RoomFamilyRoomLevel])); str += get_sub_section_html("Dining:", get_array_item([mls_data.DININGROOMDESCRIPTION, mls_full.NST_DiningRoomDescription, mls_full.GF20110114205234915916000000, mls_full.GF20110114205250023636000000])); str += get_sub_section_html("Bath Details:", get_array_item([mls_data.BATHDESC, mls_full.NST_BathDesc, mls_full.GF20110114205240026562000000, mls_full.GF20110114205249813734000000])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "More Room Details") .replaceAll("$CONTENT$", str); } function get_in_home_details_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Sq Ft Above Ground:", get_num1(get_array_item([mls_data.SQFTABOVEGROUND, mls_full.AboveGradeFinishedArea, mls_full.LIST_49, mls_full.LM_Int4_5])), " sq ft"); str += get_sub_section_html("Sq Ft Below Ground:", get_num1(get_array_item([mls_data.SQFTBELOWGROUND, mls_full.BelowGradeFinishedArea, mls_full.LIST_51])), " sq ft"); str += get_sub_section_html("Appliances:", get_array_item([mls_data.APPLIANCES, mls_full.Appliances, mls_full.GF20110114205241624648000000, mls_full.GF20110114205249663353000000, mls_full.LFD_APPLIANCES_9, mls_full.LFD_APPLIANCES_89])); str += get_sub_section_html("Basement:", get_array_joined([mls_data.BASEMENT, mls_full.GF20110114205246881701000000, mls_full.GF20110114205241726341000000, mls_full.GF20110114205247744985000000, mls_full.GF20110114205242036915000000, mls_full.GF20110114205249867914000000, mls_full.GF20110114205249969258000000, mls_full.LFD_CONSTRUCTION_3, mls_full.LFD_CONSTRUCTION_27, mls_full.LFD_CONSTRUCTION_44, mls_full.LFD_CONSTRUCTION_83], ", ")); str += get_sub_section_html("Construction Material:", get_array_item([mls_full.ConstructionMaterials])); str += get_sub_section_html("Electric:", get_array_item([mls_full.Electric])); str += get_sub_section_html("Fireplaces:", get_array_joined([ get_array_item([mls_data.FIREPLACES, mls_full.FireplacesTotal, mls_full.LIST_111]), get_array_item([mls_data.FIREPLACELOC, mls_full.FireplaceFeatures, mls_full.GF20110114205241573426000000, mls_full.GF20110225234837634312000000, mls_full.LFD_FIREPLACE_11, mls_full.LFD_FIREPLACE_91]) ], ", ")); str += get_sub_section_html("Additional Details:", get_array_item([mls_data.AMENITIESUNIT, mls_full.NST_AmenitiesUnit, get_array_joined([ mls_full.GF20110114205246780767000000, mls_full.GF20110114205235074697000000, mls_full.GF20110114205246834821000000, mls_full.GF20110114205247524779000000, mls_full.GF20110114205247594353000000, mls_full.GF20110114205249559836000000, mls_full.GF20110114205249609327000000, mls_full.GF20110114205249712770000000, mls_full.GF20110114205251236902000000, mls_full.GF20110114205251344315000000 ], ", ") ])); str += get_sub_section_html("Patio/Deck:", get_array_item([mls_data.LFD_PATIOPORCH_8, mls_full.LFD_PATIOPORCH_88])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "In Home Details") .replaceAll("$CONTENT$", str); } function get_home_details_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Siding:", mls_data.EXTERIOR); str += get_sub_section_html("Roof:", mls_data.ROOF); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Exterior") .replaceAll("$CONTENT$", str); } function get_utilities_html() { let t = get_element_html(detail_template + "_section"); // let ar = []; // if (mls_data.HEATINGDESCRIPTION != undefined && mls_data.HEATINGDESCRIPTION != "") ar.push(mls_data.HEATINGDESCRIPTION); // if (mls_data.FUEL != undefined && mls_data.FUEL != "") ar.push(mls_data.FUEL); let str = ""; str += get_sub_section_html("Utilities: ", get_array_item([mls_full.LFD_UTILITIES_19, mls_full.LFD_UTILITIES_20, mls_full.LFD_UTILITIES_33, mls_full.LFD_UTILITIES_56, mls_full.LFD_UTILITIES_99])); str += get_sub_section_html("Water: ", mls_data.WATER); str += get_sub_section_html("Sewer: ", mls_data.SEWER); str += get_sub_section_html("Cooling: ", get_array_item([mls_data.COOLINGDESCRIPTION, mls_full.Cooling, mls_full.GF20110114205241522537000000, mls_full.GF20110114205249454979000000, mls_full.GF20110114205252095697000000, mls_full.LFD_COOLING_14, mls_full.LFD_COOLING_35, mls_full.LFD_COOLING_49, mls_full.LFD_COOLING_94])); str += get_sub_section_html("Heating: ", get_array_joined([ get_array_item([mls_data.HEATINGDESCRIPTION, mls_full.Heating, mls_full.GF20110114205234862544000000, mls_full.GF20110114205242239642000000, mls_full.GF20110114205250194654000000, mls_full.GF20110114205252684451000000, mls_full.LFD_HEAT_13, mls_full.LFD_HEAT_34, mls_full.LFD_HEATING_48, mls_full.LFD_HEAT_93]), get_array_item([mls_data.FUEL, mls_full.NST_Fuel, mls_full.GF20110114205246657128000000, mls_full.GF20110114205248055366000000, mls_full.GF20110114205250126446000000, mls_full.GF20110114205252559166000000]) ], ", ")); str += get_sub_section_html("Fence: ", get_array_item([mls_data.FENCE, mls_full.Fencing, mls_full.LFD_FENCING_12, mls_full.LFD_FENCING_92])); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Utilites") .replaceAll("$CONTENT$", str); } function get_room_data_html() { let t = get_element_html(detail_template + "_section"); let str = ""; if(get_str(mls_full.PropertyRooms).startsWith("[{")) mls_full.PropertyRoomsParsed = JSON.parse(mls_full.PropertyRooms); else if(get_str(mls_full.Rooms).startsWith("[{")) mls_full.PropertyRoomsParsed = JSON.parse(mls_full.Rooms); else mls_full.PropertyRoomsParsed = []; str += get_bedrooms_html(); str += get_bathrooms_html(); str += get_main_floor_html(); str += get_lower_level_html(); str += get_upper_level_html(); str += get_more_room_details_html(); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Rooms") .replaceAll("$CONTENT$", str); } // function get_mlsgrid2_room_data() { // if(get_str(mls_full.PropertyRooms).startsWith("[{")) return JSON.parse(mls_full.PropertyRooms); // return []; // } function get_bedrooms_html() { let t = get_element_html(detail_template + "_section"); let str = ""; for (let i = 0; i < 14; i++) { if (mls_data.ROOMTYPE[i] == undefined || mls_data.ROOMAREA[i] == undefined || mls_data.ROOMFLOOR[i] == undefined) continue; if (!mls_data.ROOMTYPE[i].includes("Bed")) continue; if (get_str(mls_data.ROOMTYPE[i]) == "") continue; str += get_sub_section_html(get_array_item([mls_data.ROOMTYPE[i]], ":"), mls_data.ROOMAREA[i]); } mls_full.PropertyRoomsParsed.forEach(function(room) { if(get_str(room.RoomDescription).includes("Bed") || get_str(room.RoomType).includes("Bed")) { str += get_sub_section_html(get_array_item([room.RoomType], ":"), get_array_joined([room.RoomLevel, room.RoomDimensions], " ")); } }); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Bedrooms") .replaceAll("$CONTENT$", str); } function get_main_floor_html() { let t = get_element_html(detail_template + "_section"); let str = ""; for (let i = 0; i < 14; i++) { if (mls_data.ROOMTYPE[i] == undefined || mls_data.ROOMAREA[i] == undefined || mls_data.ROOMFLOOR[i] == undefined) continue; if (mls_data.ROOMFLOOR[i] != "Main") continue; if (get_str(mls_data.ROOMTYPE[i]) == "") continue; str += get_sub_section_html(get_array_item([mls_data.ROOMTYPE[i]], ":"), mls_data.ROOMAREA[i]); } mls_full.PropertyRoomsParsed.forEach(function(room) { if(room.RoomLevel == "Main") { str += get_sub_section_html(get_array_item([room.RoomType], ":"), get_array_joined([get_array_item([room.RoomDescription, room.RoomType]), room.RoomFeatures, room.RoomDimensions], ", ")); } }); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Main Floor") .replaceAll("$CONTENT$", str); } function get_lower_level_html() { let t = get_element_html(detail_template + "_section"); let str = ""; for (let i = 0; i < 14; i++) { if (mls_data.ROOMTYPE[i] == undefined || mls_data.ROOMAREA[i] == undefined || mls_data.ROOMFLOOR[i] == undefined) continue; if (mls_data.ROOMFLOOR[i] != "Lower") continue; if (get_str(mls_data.ROOMTYPE[i]) == "") continue; str += get_sub_section_html(get_array_item([mls_data.ROOMTYPE[i]], ":"), mls_data.ROOMAREA[i]); } mls_full.PropertyRoomsParsed.forEach(function(room) { if(room.RoomLevel == "Lower") { str += get_sub_section_html(get_array_item([room.RoomType], ":"), get_array_joined([get_array_item([room.RoomDescription, room.RoomType]), room.RoomFeatures, room.RoomDimensions], ", ")); } }); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Lower Level") .replaceAll("$CONTENT$", str); } function get_upper_level_html() { let t = get_element_html(detail_template + "_section"); let str = ""; for (let i = 0; i < 14; i++) { if (mls_data.ROOMTYPE[i] == undefined || mls_data.ROOMAREA[i] == undefined || mls_data.ROOMFLOOR[i] == undefined) continue; if (mls_data.ROOMFLOOR[i] != "Upper") continue; if (get_str(mls_data.ROOMTYPE[i]) == "") continue; str += get_sub_section_html(get_array_item([mls_data.ROOMTYPE[i]], ":"), mls_data.ROOMAREA[i]); } mls_full.PropertyRoomsParsed.forEach(function(room) { if(room.RoomLevel == "Upper") { str += get_sub_section_html(get_array_item([room.RoomType], ":"), get_array_joined([get_array_item([room.RoomDescription, room.RoomType]), room.RoomFeatures, room.RoomDimensions], ", ")); } }); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Upper Level") .replaceAll("$CONTENT$", str); } function price_display() { let ar = []; ar.push(price_str(mls_data.LISTPRICE) + " " + mls_hotdata_html(mls_data)); if(mls_data.LIVINGAREA) ar.push("
" + price_str(mls_data.LISTPRICE / mls_data.LIVINGAREA) + "/sf" + "
"); if(mls_data.ACRES) ar.push("
" + price_str(mls_data.LISTPRICE / mls_data.ACRES) + "/acre" + "
"); //return ar.join(" • "); return ar.join(""); } function get_summary_html() { let t = get_element_html(detail_template + "_section"); let type = get_array_item([mls_full.PropertyType, mls_data.STYLE]); let subtype = get_array_item([mls_full.PropertySubType]); let str = ""; str += get_sub_section_html("Type:", get_str(mls_data.MLSCLASS) + (type ? " | " + type : "") + (subtype ? " - " + subtype : "")); str += get_sub_section_html("Price:", price_display()).replaceAll(", ", ","); str += get_sub_section_html("Transaction:", mls_data.TRANSACTIONTYPE); str += get_sub_section_html("Status:", get_property_status(true)); str += get_sub_section_html("Contingencies:", get_array_item([mls_data.CONTINGENCY, mls_full.Contingency, mls_full.LIST_19])); str += get_sub_section_html("Agent Owned:", get_array_item([mls_full.NST_AgentOwner])); str += get_sub_section_html("Lender Owned:", get_array_item([mls_full.NST_LenderOwned])); str += get_sub_section_html("Manufactured Home:", get_array_item([mls_full.NST_ManufacturedHome])); str += get_sub_section_html("Current Use:", mls_data.CURRENTUSE); str += get_sub_section_html("Zoning:", mls_data.ZONING); str += get_sub_section_html("Bedrooms:", mls_data.BEDROOMS); str += get_sub_section_html("Bathrooms:", mls_data.BATHSTOTAL); str += get_sub_section_html("Square Footage:", get_num1(mls_data.LIVINGAREA), " sq ft"); str += get_sub_section_html("Total Square Footage:", get_num1(mls_full.NST_SqFtTotal), " sq ft"); str += get_sub_section_html("Lot Size:", get_num1(mls_data.ACRES), " acres"); str += get_sub_section_html("Year Built:", mls_data.YEARBUILT); str += get_sub_section_html("Foundation:", get_num1(get_array_item([mls_data.FOUNDATIONSIZE, mls_full.FoundationArea, mls_full.LIST_114])), " sq ft"); str += get_sub_section_html("Garage:", get_bit_item(get_array_item([mls_data.PARKINGGARAGE, mls_full.GarageSpaces, mls_full.LIST_125, mls_full.L_Keyword3]) > 0)); str += get_sub_section_html("Waterfront:", get_bit_item(mls_data.WATERFRONTPRESENT == 1)); str += get_sub_section_html("Stories:", get_array_item([mls_data.STORIES, mls_full.LIST_113, mls_full.LFD_STYLE_1, mls_full.LFD_STYLE_6, mls_full.Levels])); str += get_sub_section_html("New Construction:", get_bit_item(mls_full.NewConstructionYN)); str += get_sub_section_html("Listed at:", !mls_data.LISTDATE ? "Coming Soon" : datetime_string(get_array_item([mls_data.LISTDATE, mls_full.L_LvtDate]))); //str += get_sub_section_html("Listed by:", mls_data.OFFICE_OFFICENAME); // Hide because Listing data is already at the bottom str += get_sub_section_html("Listing Age:", !mls_data.LISTDATE ? "Coming Soon" : days_diff(new Date(get_array_item([mls_data.LISTDATE, mls_full.L_LvtDate])), new Date()) + " days"); str += get_sub_section_html("Construction Status:", get_array_item([mls_data.CONSTRUCTIONSTATUS, mls_full.LIST_112])); str += get_sub_section_html("School District:", get_str(mls_data.SCHOOLDISTRICTNUMBER) + (get_str(mls_data.SCHOOLDISTRICTPHONE) != "" ? " | " + get_str(mls_data.SCHOOLDISTRICTPHONE) : "")); str += get_sub_section_html("Neighborhoods:", get_str(mls_data.NEIGHBORHOOD)); str += get_sub_section_html("County:", mls_data.COUNTY); // str += get_sub_section_html("Map:", get_array_joined([ // get_array_item([mls_full.MapCoordinate]), // get_array_item([mls_full.MapCoordinateSource]), // ], ", ")); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Summary") .replaceAll("$CONTENT$", str); } function get_sold_summary_html() { let t = get_element_html(detail_template + "_section"); let str = ""; str += get_sub_section_html("Type:", get_str(mls_data.MLSCLASS) + (get_str(mls_data.STYLE) != "" ? " | " + get_str(mls_data.STYLE) : "")); str += get_sub_section_html("Price:", price_str(mls_data.LISTPRICE)).replaceAll(", ", ","); str += get_sub_section_html("Status:", get_property_status(true)); str += get_sub_section_html("Bedrooms:", mls_data.BEDROOMS); str += get_sub_section_html("Bathrooms:", mls_data.BATHSTOTAL); str += get_sub_section_html("Square Footage:", get_num1(mls_data.LIVINGAREA), " sq ft"); str += get_sub_section_html("Sold Price:", price_str(get_array_item([mls_full.SOLDPRICE, mls_full.ClosePrice, mls_full.L_SoldPrice]))).replaceAll(", ", ","); str += get_sub_section_html("Sold at:", datetime_string(get_array_item([mls_data.SOLDDATE, mls_full.CloseDate, mls_full.L_UpdateDate]))); if (str == "") return ""; return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", "Summary") .replaceAll("$CONTENT$", str); } function get_sub_section_html(label, data, suffix, prefix) { let str = get_str(data); if (str == "") return ""; if (typeof (str) == "string") str = str.replaceAll(",", ", ").replaceAll(":::", ","); let t = get_element_html(detail_template + "_sub_section"); return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", get_str(label)) .replaceAll("$CONTENT$", get_str(prefix) + str + get_str(suffix)); } function get_section_html(label, data) { let str = get_str(data); if (str == "") return ""; let t = get_element_html(detail_template + "_section"); return t .replaceAll("$CUSTOMCLS$", "") .replaceAll("$LABEL$", label) .replaceAll("$CONTENT$", str); } function print_property() { // hide_element("photo_counter_div"); // hide_element("photo_prev"); // hide_element("photo_next"); // hide_element("photo_full"); // hide_element("photo_desc_div"); // hide_element("favorite_mark"); // hide_element("type_status"); // hide_element("price"); // let info = document.getElementById("information"); // info.children[1].style.display = "none"; // let content = document.getElementById("print_content"); // let iframe = document.createElement("iframe"); // iframe.style.display = "none"; // document.body.appendChild(iframe); // iframe.contentDocument.write('' + document.title + ''); // iframe.contentDocument.write(''); // iframe.contentDocument.write(content.innerHTML); // iframe.contentDocument.write(''); // iframe.contentDocument.close(); // iframe.contentWindow.onload = function() { // setTimeout(function() { // iframe.contentWindow.print(); // document.body.removeChild(iframe); // }, 1000); // } // show_element("photo_counter_div"); // show_element("photo_prev"); // show_element("photo_next"); // show_element("photo_full"); // show_element("photo_desc_div"); // show_element("favorite_mark"); // show_element("type_status"); // show_element("price"); // info.children[1].style.display = "block"; window.print(); } function stylesheet_html() { let css = []; for (let sheeti = 0; sheeti < document.styleSheets.length; sheeti++) { let sheet = document.styleSheets[sheeti]; try { let rules = ('cssRules' in sheet) ? sheet.cssRules : sheet.rules; for (let rulei = 0; rulei < rules.length; rulei++) { let rule = rules[rulei]; if ('cssText' in rule) css.push(rule.cssText); else css.push(rule.selectorText + ' {\n' + rule.style.cssText + '\n}\n'); } } catch (ex) { } } return css.join('\n'); } function get_array_item(arr, suffix, prefix) { if(!arr) return ""; if(!suffix) suffix = ""; if(!prefix) prefix = ""; for(let i=0; i= hotdate) { let price = data.LISTPRICE-data.LASTPRICE; if(price < 0) { hotprice = "-" + price_short_str(-price); hotclass = "reduct"; } if(price > 0) { if(data.LASTPRICE == 0) { hotprice = "Repost"; hotclass = "repost"; } else { hotprice = "+" + price_short_str(price); hotclass = "rise"; } } if(price == 0) { hotprice = "New "; hotclass = "new"; let diff = Math.floor((new Date() - new Date(data.LASTPRICEDATE + "Z")) / 1000 / 60); if(diff < 60) { if(diff == 0) diff = 1; hotprice += diff + " Mins Ago"; } else { diff = Math.floor(diff / 60); if(diff < 24) { hotprice += diff + " Hrs Ago"; } else { diff = Math.floor(diff / 24); hotprice += Math.floor(diff) + " Days Ago"; } } } } return "" + hotprice + ""; } function push_in_array(ar, data) { let str = get_str(data); if (str != "") ar.push(str); } function get_data_str(data, suffix, prefix) { let str = get_str(data); if (suffix == undefined) suffix = ""; if (prefix == undefined) prefix = ""; if (str == "") return ""; return prefix + str + suffix; } function connect_data(data1, data2, joiner) { let ar = []; push_in_array(ar, data1); push_in_array(ar, data2); return ar.join(joiner); } function get_num1(data) { return get_num(data).replaceAll(",", ":::"); } function calc_compensation(price, comp) { return comp; // let percent = ''; // let dollar = ''; // if(comp.startsWith("$")) { // comp = comp.substring(1); // dollar = price_str(comp); // percent = Math.round(comp / price * 1000000) / 10000; // } else { // comp = comp.substring(0, comp.length - 1); // percent = comp; // dollar = price_str(price / 100 * percent); // } // return "" + dollar + " (" + percent + "%)"; } function mls_property_detail_fullwidth(element) {{ element.querySelector(".number").innerHTML = get_str(mls_data.MLSCLASS) + " • " + mls_listing_callback_numbershow(mls_data); element.querySelector(".address").innerHTML = mls_listing_address(mls_data); element.querySelector(".status").innerHTML = get_str(get_property_status()); element.querySelector(".status").className = "status " + get_str(mls_data.STATUS); element.querySelector(".price").innerHTML = price_str(mls_data.LISTPRICE) + mls_hotdata_html(mls_data); if(mls_data.PHOTOORDER2.length > 0) { let photo_path = "/Media/" + mls_data.SOURCE + "/" + mls_data.MLSNUMBER +"/" + mls_data.PHOTOORDER2[0]; element.querySelector(".photo").style.backgroundImage = "url(" + photo_path + ")"; mls_data.PHOTOINDEX = 0; } else { element.querySelector(".photo").style.backgroundImage = "url('/photo/coming_soon.jpg')"; element.querySelector(".photo").classList.add("coming_soon"); } if(!sold_limited) { element.querySelector(".remarks").innerHTML = get_str(mls_data.PUBLICREMARKS); element.querySelector(".direction").innerHTML = get_array_item([mls_data.DIRECTIONS, mls_full.Directions, mls_full.LIST_82, mls_full.LR_remarks11]); } else { element.querySelector(".remarks").style.display = "none"; element.querySelector(".direction").style.display = "none"; } element.querySelector(".information").innerHTML = get_detail_information(); element.querySelector(".office_info").innerHTML = element.querySelector(".office_info").innerHTML.replaceAll("RE/MAX Lakeside-West", get_str(mls_data.OFFICE_OFFICENAME)); element.querySelector(".office_logo").src = get_agency_logo_path(mls_data); if(check_prev_next_listings_flag(mls_data.MLSNUMBER) == false) { element.querySelector(".prev_property").style.display = "none"; element.querySelector(".next_property").style.display = "none"; } mls_search({ query: "STATUS=[Active,Coming Soon,Pending];RADIUS=10," + mls_data.LATITUDE + "," + mls_data.LONGITUDE + ";MLSNUMBER=!'" + mls_data.MLSNUMBER + "'", order: "!MODIFICATIONTIMESTAMP", offset: 0, size: 12 }, function (result, total_count) { if(result.length > 0) { element.querySelector(".neighbor_listings").innerHTML = mls_listing_html(result); element.querySelector(".neighbors").style.display = "block"; } else { element.querySelector(".neighbors").style.display = "none"; } return false; // }, function (error) { // if (error == "") { // } else show_message(error); }); if(mls_data.MLSCLASS != 'RNT') { let mort_form = init_mortgage_form(element.querySelector(".mortgage_calculator")); if(mort_form) { mort_form.querySelector(".total_amount").value = mls_data.LISTPRICE; mort_form.querySelector(".down_payment_amount").value = mls_data.LISTPRICE * 0.2; mort_form.querySelector(".down_payment_percent").value = 20; // Set default term to 30 years and corresponding rate mort_form.querySelector(".total_years").value = 30; mort_form.querySelector(".term_select").value = 30; mort_form.querySelector(".interest_rate").value = 6.125; // Add event listener to update hidden total_years and interest rate based on dropdown mort_form.querySelector(".term_select").addEventListener("change", function() { const term = parseInt(this.value); const rates = { 15: 5.375, 20: 6.000, 30: 6.125 }; mort_form.querySelector(".total_years").value = term; mort_form.querySelector(".interest_rate").value = rates[term]; mort_form.calc_mortgage(); }); mort_form.calc_mortgage(); } } else { element.querySelectorAll(".mortgage_calculator_element").forEach(function(e) { e.style.display = "none"; }); } if(!mls_full.BuyerCompensation && !mls_full.SellerCompensation) { element.querySelectorAll(".compensation_element").forEach(function(e) { e.style.display = "none"; }); } else { if(!mls_full.BuyerCompensation) { element.querySelectorAll(".buyer_compensation").forEach(function(e) { e.style.display = "none"; }); } else { element.querySelector(".buyer_compensation.value").innerHTML = calc_compensation(mls_data.LISTPRICE, mls_full.BuyerCompensation); } if(!mls_full.SellerCompensation) { element.querySelectorAll(".seller_compensation").forEach(function(e) { e.style.display = "none"; }); } else { element.querySelector(".seller_compensation.value").innerHTML = calc_compensation(mls_data.LISTPRICE, mls_full.SellerCompensation); } if(!mls_full.CompensationSource) { element.querySelectorAll(".compensation_source").forEach(function(e) { e.style.display = "none"; }); } else { element.querySelector(".compensation_source.value").innerHTML = get_str(mls_full.CompensationSource); } } }} function mls_property_detail_wrapper(element) { let photo_path = "/Media/" + mls_data.SOURCE + "/" + mls_data.MLSNUMBER +"/?"; // if(mls_data.ORGMARK != "MLSGrid") photo_path = "/Media/" + mls_data.ORGMARK + "/download/" + mls_data.ORGMARK + mls_data.ORGID + "/?"; if(mls_data.PHOTOCOUNT == 0) { element.querySelector(".photo").style.backgroundImage = "url('/photo/coming_soon.jpg')"; } else { let thumbs = element.querySelector(".thumbs"); mls_data.PHOTOORDER2.push(-100); if(mls_data.VIRTUALTOUR_URL1) { let t = document.createElement("div"); t.className = "thumb vtour"; // t.photo_path = photo_path.replaceAll("?", mls_data.PHOTOORDER2[0]) + "-320x180"; t.style.backgroundImage = "url('" + photo_path.replaceAll("?", mls_data.PHOTOORDER2[0]) + "-320x180')"; // if(index == 0) t.classList.add("show"); // t.index = -200; // t.order = order; // if(t.order == -100) { // t.remarks = get_array_item([mls_data.DIRECTIONS, mls_full.Directions, mls_full.LIST_82, mls_full.LR_remarks11]); // } else mls_data.PHOTOREMARKS2.forEach(function(p) { // if(p.Order == order) t.remarks = get_str(p.Remarks); // }); t.onclick = function() { window.open(mls_data.VIRTUALTOUR_URL1, "_blank"); } thumbs.appendChild(t); // if(index == 0) setTimeout(function() { t.click(); }, 0); } mls_data.PHOTOORDER2.forEach(function(order, index) { // for(let i=1; i<=mls_data.PHOTOCOUNT; i++) { let t = document.createElement("div"); t.className = "thumb"; t.photo_path = order != -100 ? photo_path.replaceAll("?", order) : "/MapCache/1943776.jpg"; t.style.backgroundImage = "url('" + t.photo_path + (order != -100 ? "-320x180" : "") + "')"; if(index == 0) t.classList.add("show"); t.index = index; t.order = order; if(t.order == -100) { t.remarks = get_array_item([mls_data.DIRECTIONS, mls_full.Directions, mls_full.LIST_82, mls_full.LR_remarks11]); } else mls_data.PHOTOREMARKS2.forEach(function(p) { if(p.Order == order) t.remarks = get_str(p.Remarks); }); t.onclick = function() { let photo_element = element.querySelector(".photo"); if(isInViewport(thumbs)) t.scrollIntoView({ behavior: 'smooth', block: 'nearest'}); element.querySelector(".thumbs").querySelectorAll(".thumb").forEach(function(t1) { t1.classList.remove("show"); }); t.classList.add("show"); let path = t.photo_path; //photo_path.replaceAll("?", t.order); let img = document.createElement("img"); img.src = path; let loading = create_loading_progress(); img.onload = function() { photo_element.style.backgroundImage = "url('" + path + "')"; photo_element.removeChild(img); if(t.remarks) { element.querySelector(".photo_remarks").innerHTML = t.remarks; element.querySelector(".photo_remarks").style.display = "block"; } else element.querySelector(".photo_remarks").style.display = "none"; remove_loading_progress(loading); if(t.order == -100) photo_element.onclick = on_map_click; else photo_element.onclick = undefined; }; photo_element.appendChild(img); } thumbs.appendChild(t); if(index == 0) setTimeout(function() { t.click(); }, 0); }); element.querySelector(".photo").style.backgroundImage = "url('" + photo_path.replaceAll("?", mls_data.PHOTOORDER2[0]) + "')"; element.querySelector(".photo_prev").style.display = "block"; element.querySelector(".photo_prev").onclick = function() { event && event.stopPropagation(); let t = thumbs.querySelector(".thumb.show").previousElementSibling; if(!t) t = thumbs.lastElementChild; t.click(); } element.querySelector(".photo_next").style.display = "block"; element.querySelector(".photo_next").onclick = function() { event && event.stopPropagation(); let t = thumbs.querySelector(".thumb.show").nextElementSibling; if(!t) t = thumbs.firstElementChild; t.click(); } } if(!sold_limited) { element.querySelector(".remarks").innerHTML = get_str(mls_data.PUBLICREMARKS); // element.querySelector(".direction").innerHTML = get_array_item([mls_data.DIRECTIONS, mls_full.Directions, mls_full.LIST_82, mls_full.LR_remarks11]); } else { element.querySelector(".remarks").style.display = "none"; // element.querySelector(".direction").style.display = "none"; } element.querySelector(".information").innerHTML = get_detail_information(); element.querySelector(".office_info").innerHTML = element.querySelector(".office_info").innerHTML.replaceAll("RE/MAX Lakeside-West", get_str(mls_data.OFFICE_OFFICENAME)); element.querySelector(".office_logo").src = get_agency_logo_path(mls_data); if(check_prev_next_listings_flag(mls_data.MLSNUMBER) == false) { element.querySelector(".prev_property").style.display = "none"; element.querySelector(".next_property").style.display = "none"; } mls_search({ query: "STATUS=[Active,Coming Soon,Pending];RADIUS=10," + mls_data.LATITUDE + "," + mls_data.LONGITUDE + ";MLSNUMBER=!'" + mls_data.MLSNUMBER + "'", order: "!MODIFICATIONTIMESTAMP", offset: 0, size: 12 }, function (result, total_count) { if(result.length > 0) { element.querySelector(".neighbor_listings").innerHTML = mls_listing_html(result); element.querySelector(".neighbors").style.display = "block"; } else { element.querySelector(".neighbors").style.display = "none"; } return false; // }, function (error) { // if (error == "") { // } else show_message(error); }); if(mls_data.MLSCLASS != 'RNT') { let mort_form = init_mortgage_form(element.querySelector(".mortgage_calculator")); if(mort_form) { mort_form.querySelector(".total_amount").value = mls_data.LISTPRICE; mort_form.querySelector(".down_payment_amount").value = mls_data.LISTPRICE * 0.2; mort_form.querySelector(".down_payment_percent").value = 20; // Set default term to 30 years and corresponding rate mort_form.querySelector(".total_years").value = 30; mort_form.querySelector(".term_select").value = 30; mort_form.querySelector(".interest_rate").value = 6.125; // Add event listener to update hidden total_years and interest rate based on dropdown mort_form.querySelector(".term_select").addEventListener("change", function() { const term = parseInt(this.value); const rates = { 15: 5.375, 20: 6.000, 30: 6.125 }; mort_form.querySelector(".total_years").value = term; mort_form.querySelector(".interest_rate").value = rates[term]; mort_form.calc_mortgage(); }); mort_form.calc_mortgage(); } } else { element.querySelectorAll(".mortgage_calculator_element").forEach(function(e) { e.style.display = "none"; }); } if(!mls_full.BuyerCompensation && !mls_full.SellerCompensation) { element.querySelectorAll(".compensation_element").forEach(function(e) { e.style.display = "none"; }); } else { if(!mls_full.BuyerCompensation) { element.querySelectorAll(".buyer_compensation").forEach(function(e) { e.style.display = "none"; }); } else { element.querySelector(".buyer_compensation.value").innerHTML = calc_compensation(mls_data.LISTPRICE, mls_full.BuyerCompensation); } if(!mls_full.SellerCompensation) { element.querySelectorAll(".seller_compensation").forEach(function(e) { e.style.display = "none"; }); } else { element.querySelector(".seller_compensation.value").innerHTML = calc_compensation(mls_data.LISTPRICE, mls_full.SellerCompensation); } if(!mls_full.CompensationSource) { element.querySelectorAll(".compensation_source").forEach(function(e) { e.style.display = "none"; }); } else { element.querySelector(".compensation_source.value").innerHTML = get_str(mls_full.CompensationSource); } } } function template_repeat(array, template, options, reserve) { let str = ""; array.forEach(function(item) { str += template_replace(item, template, options, reserve); }); return str; } function template_html(template) { if(typeof template === "string") { if(template.startsWith("<")) return template; template = document.querySelector("template#"+template); } if(!template) return ""; return template.innerHTML; } function template_replace(item, template, options, reserve) { template = template_html(template); if(template == "") return ""; let v = get_str(reserve); let t = template.replaceAll("$RESERVE$", v).replaceAll("$SHOW_RESERVE$", v == "" ? "hide" : ""); if(options) { for(var p in options) { if(options[p]) { let v = ""; if(options[p] == "default") v = template_repeat_default_callback(item, p); else if(options[p] == "bool") v = template_repeat_bool_callback(item, p); else if(options[p] == "price") v = template_repeat_price_callback(item, p); else if(options[p] == "shortprice") v = template_repeat_shortprice_callback(item, p); else if(options[p] == "number") v = template_repeat_number_callback(item, p); else if(options[p] == "date") v = template_repeat_date_callback(item, p); else if(options[p] == "datetime") v = template_repeat_datetime_callback(item, p); else if(options[p] == "shortdate") v = template_repeat_shortdate_callback(item, p); else if(options[p] == "shortdatetime") v = template_repeat_shortdatetime_callback(item, p); else if(options[p] == "fulldata") v = template_repeat_fulldata_callback(item, p); else if(options[p] == "base64") v = template_repeat_base64_callback(item, p); else if(options[p] == "url") v = template_repeat_url_callback(item, p); else if(typeof options[p] === "function") v = options[p](item, p); t = t.replaceAll("$" + p + "$", v).replaceAll("$SHOW_" + p + "$", v == "" ? "hide" : ""); } } } for(var p in item) { let v = get_str(item[p]); if(!options || !options[p]) { t = t.replaceAll("$" + p + "$", v).replaceAll("$SHOW_" + p + "$", v == "" ? "hide" : ""); } } return t; } function template_repeat_default_callback(data, property) { return get_str(data[property]); } function template_repeat_bool_callback(data, property) { if(data[property]) return "Yes"; return "No"; } function template_repeat_price_callback(data, property) { let d = data[property]; if(!d) return ""; d = Number.parseFloat(d); let sign = ""; if(d < 0) { sign = "-"; d *= -1; } return sign + "$" + d.toLocaleString(); } function template_repeat_shortprice_callback(data, property) { return price_short_str(data[property]); } function template_repeat_number_callback(data, property) { return get_num(data[property]); } function template_repeat_date_callback(data, property) { return date_string(data[property]); } function template_repeat_datetime_callback(data, property) { return datetime_string(data[property]); } function template_repeat_shortdate_callback(data, property) { return date_str(data[property]); } function template_repeat_shortdatetime_callback(data, property) { let d = data[property]; if (!d) return ""; if (d[d.length-1] != "Z") d = d + "Z"; let t = new Date(d); return two_digits(t.getHours()) + ":" + two_digits(t.getMinutes()) + " " + (t.getMonth()+1) + "/" + t.getDate(); } function template_repeat_fulldata_callback(data, property) { return JSON.stringify(data); } function template_repeat_base64_callback(data, property) { return btoa(JSON.stringify(data)); } function template_repeat_url_callback(data, property) { return url_str(data[property]); } var QRCode; !function() { function a(a) { this.mode = c.MODE_8BIT_BYTE, this.data = a, this.parsedData = []; for (var b = [], d = 0, e = this.data.length; e > d; d++) { var f = this.data.charCodeAt(d); f > 65536 ? (b[0] = 240 | (1835008 & f) >>> 18, b[1] = 128 | (258048 & f) >>> 12, b[2] = 128 | (4032 & f) >>> 6, b[3] = 128 | 63 & f) : f > 2048 ? (b[0] = 224 | (61440 & f) >>> 12, b[1] = 128 | (4032 & f) >>> 6, b[2] = 128 | 63 & f) : f > 128 ? (b[0] = 192 | (1984 & f) >>> 6, b[1] = 128 | 63 & f) : b[0] = f, this.parsedData = this.parsedData.concat(b) } this.parsedData.length != this.data.length && (this.parsedData.unshift(191), this.parsedData.unshift(187), this.parsedData.unshift(239)) } function b(a, b) { this.typeNumber = a, this.errorCorrectLevel = b, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [] } function i(a, b) { if (void 0 == a.length) throw new Error(a.length + "/" + b); for (var c = 0; c < a.length && 0 == a[c]; ) c++; this.num = new Array(a.length - c + b); for (var d = 0; d < a.length - c; d++) this.num[d] = a[d + c] } function j(a, b) { this.totalCount = a, this.dataCount = b } function k() { this.buffer = [], this.length = 0 } function m() { return "undefined" != typeof CanvasRenderingContext2D } function n() { var a = !1 , b = navigator.userAgent; return /android/i.test(b) && (a = !0, aMat = b.toString().match(/android ([0-9]\.[0-9])/i), aMat && aMat[1] && (a = parseFloat(aMat[1]))), a } function r(a, b) { for (var c = 1, e = s(a), f = 0, g = l.length; g >= f; f++) { var h = 0; switch (b) { case d.L: h = l[f][0]; break; case d.M: h = l[f][1]; break; case d.Q: h = l[f][2]; break; case d.H: h = l[f][3] } if (h >= e) break; c++ } if (c > l.length) throw new Error("Too long data"); return c } function s(a) { var b = encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g, "a"); return b.length + (b.length != a ? 3 : 0) } a.prototype = { getLength: function() { return this.parsedData.length }, write: function(a) { for (var b = 0, c = this.parsedData.length; c > b; b++) a.put(this.parsedData[b], 8) } }, b.prototype = { addData: function(b) { var c = new a(b); this.dataList.push(c), this.dataCache = null }, isDark: function(a, b) { if (0 > a || this.moduleCount <= a || 0 > b || this.moduleCount <= b) throw new Error(a + "," + b); return this.modules[a][b] }, getModuleCount: function() { return this.moduleCount }, make: function() { this.makeImpl(!1, this.getBestMaskPattern()) }, makeImpl: function(a, c) { this.moduleCount = 4 * this.typeNumber + 17, this.modules = new Array(this.moduleCount); for (var d = 0; d < this.moduleCount; d++) { this.modules[d] = new Array(this.moduleCount); for (var e = 0; e < this.moduleCount; e++) this.modules[d][e] = null } this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(a, c), this.typeNumber >= 7 && this.setupTypeNumber(a), null == this.dataCache && (this.dataCache = b.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, c) }, setupPositionProbePattern: function(a, b) { for (var c = -1; 7 >= c; c++) if (!(-1 >= a + c || this.moduleCount <= a + c)) for (var d = -1; 7 >= d; d++) -1 >= b + d || this.moduleCount <= b + d || (this.modules[a + c][b + d] = c >= 0 && 6 >= c && (0 == d || 6 == d) || d >= 0 && 6 >= d && (0 == c || 6 == c) || c >= 2 && 4 >= c && d >= 2 && 4 >= d ? !0 : !1) }, getBestMaskPattern: function() { for (var a = 0, b = 0, c = 0; 8 > c; c++) { this.makeImpl(!0, c); var d = f.getLostPoint(this); (0 == c || a > d) && (a = d, b = c) } return b }, createMovieClip: function(a, b, c) { var d = a.createEmptyMovieClip(b, c) , e = 1; this.make(); for (var f = 0; f < this.modules.length; f++) for (var g = f * e, h = 0; h < this.modules[f].length; h++) { var i = h * e , j = this.modules[f][h]; j && (d.beginFill(0, 100), d.moveTo(i, g), d.lineTo(i + e, g), d.lineTo(i + e, g + e), d.lineTo(i, g + e), d.endFill()) } return d }, setupTimingPattern: function() { for (var a = 8; a < this.moduleCount - 8; a++) null == this.modules[a][6] && (this.modules[a][6] = 0 == a % 2); for (var b = 8; b < this.moduleCount - 8; b++) null == this.modules[6][b] && (this.modules[6][b] = 0 == b % 2) }, setupPositionAdjustPattern: function() { for (var a = f.getPatternPosition(this.typeNumber), b = 0; b < a.length; b++) for (var c = 0; c < a.length; c++) { var d = a[b] , e = a[c]; if (null == this.modules[d][e]) for (var g = -2; 2 >= g; g++) for (var h = -2; 2 >= h; h++) this.modules[d + g][e + h] = -2 == g || 2 == g || -2 == h || 2 == h || 0 == g && 0 == h ? !0 : !1 } }, setupTypeNumber: function(a) { for (var b = f.getBCHTypeNumber(this.typeNumber), c = 0; 18 > c; c++) { var d = !a && 1 == (1 & b >> c); this.modules[Math.floor(c / 3)][c % 3 + this.moduleCount - 8 - 3] = d } for (var c = 0; 18 > c; c++) { var d = !a && 1 == (1 & b >> c); this.modules[c % 3 + this.moduleCount - 8 - 3][Math.floor(c / 3)] = d } }, setupTypeInfo: function(a, b) { for (var c = this.errorCorrectLevel << 3 | b, d = f.getBCHTypeInfo(c), e = 0; 15 > e; e++) { var g = !a && 1 == (1 & d >> e); 6 > e ? this.modules[e][8] = g : 8 > e ? this.modules[e + 1][8] = g : this.modules[this.moduleCount - 15 + e][8] = g } for (var e = 0; 15 > e; e++) { var g = !a && 1 == (1 & d >> e); 8 > e ? this.modules[8][this.moduleCount - e - 1] = g : 9 > e ? this.modules[8][15 - e - 1 + 1] = g : this.modules[8][15 - e - 1] = g } this.modules[this.moduleCount - 8][8] = !a }, mapData: function(a, b) { for (var c = -1, d = this.moduleCount - 1, e = 7, g = 0, h = this.moduleCount - 1; h > 0; h -= 2) for (6 == h && h--; ; ) { for (var i = 0; 2 > i; i++) if (null == this.modules[d][h - i]) { var j = !1; g < a.length && (j = 1 == (1 & a[g] >>> e)); var k = f.getMask(b, d, h - i); k && (j = !j), this.modules[d][h - i] = j, e--, -1 == e && (g++, e = 7) } if (d += c, 0 > d || this.moduleCount <= d) { d -= c, c = -c; break } } } }, b.PAD0 = 236, b.PAD1 = 17, b.createData = function(a, c, d) { for (var e = j.getRSBlocks(a, c), g = new k, h = 0; h < d.length; h++) { var i = d[h]; g.put(i.mode, 4), g.put(i.getLength(), f.getLengthInBits(i.mode, a)), i.write(g) } for (var l = 0, h = 0; h < e.length; h++) l += e[h].dataCount; // if (g.getLengthInBits() > 8 * l) // throw new Error("code length overflow. (" + g.getLengthInBits() + ">" + 8 * l + ")"); for (g.getLengthInBits() + 4 <= 8 * l && g.put(0, 4); 0 != g.getLengthInBits() % 8; ) g.putBit(!1); for (; ; ) { if (g.getLengthInBits() >= 8 * l) break; if (g.put(b.PAD0, 8), g.getLengthInBits() >= 8 * l) break; g.put(b.PAD1, 8) } return b.createBytes(g, e) } , b.createBytes = function(a, b) { for (var c = 0, d = 0, e = 0, g = new Array(b.length), h = new Array(b.length), j = 0; j < b.length; j++) { var k = b[j].dataCount , l = b[j].totalCount - k; d = Math.max(d, k), e = Math.max(e, l), g[j] = new Array(k); for (var m = 0; m < g[j].length; m++) g[j][m] = 255 & a.buffer[m + c]; c += k; var n = f.getErrorCorrectPolynomial(l) , o = new i(g[j],n.getLength() - 1) , p = o.mod(n); h[j] = new Array(n.getLength() - 1); for (var m = 0; m < h[j].length; m++) { var q = m + p.getLength() - h[j].length; h[j][m] = q >= 0 ? p.get(q) : 0 } } for (var r = 0, m = 0; m < b.length; m++) r += b[m].totalCount; for (var s = new Array(r), t = 0, m = 0; d > m; m++) for (var j = 0; j < b.length; j++) m < g[j].length && (s[t++] = g[j][m]); for (var m = 0; e > m; m++) for (var j = 0; j < b.length; j++) m < h[j].length && (s[t++] = h[j][m]); return s } ; for (var c = { MODE_NUMBER: 1, MODE_ALPHA_NUM: 2, MODE_8BIT_BYTE: 4, MODE_KANJI: 8 }, d = { L: 1, M: 0, Q: 3, H: 2 }, e = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 }, f = { PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], G15: 1335, G18: 7973, G15_MASK: 21522, getBCHTypeInfo: function(a) { for (var b = a << 10; f.getBCHDigit(b) - f.getBCHDigit(f.G15) >= 0; ) b ^= f.G15 << f.getBCHDigit(b) - f.getBCHDigit(f.G15); return (a << 10 | b) ^ f.G15_MASK }, getBCHTypeNumber: function(a) { for (var b = a << 12; f.getBCHDigit(b) - f.getBCHDigit(f.G18) >= 0; ) b ^= f.G18 << f.getBCHDigit(b) - f.getBCHDigit(f.G18); return a << 12 | b }, getBCHDigit: function(a) { for (var b = 0; 0 != a; ) b++, a >>>= 1; return b }, getPatternPosition: function(a) { return f.PATTERN_POSITION_TABLE[a - 1] }, getMask: function(a, b, c) { switch (a) { case e.PATTERN000: return 0 == (b + c) % 2; case e.PATTERN001: return 0 == b % 2; case e.PATTERN010: return 0 == c % 3; case e.PATTERN011: return 0 == (b + c) % 3; case e.PATTERN100: return 0 == (Math.floor(b / 2) + Math.floor(c / 3)) % 2; case e.PATTERN101: return 0 == b * c % 2 + b * c % 3; case e.PATTERN110: return 0 == (b * c % 2 + b * c % 3) % 2; case e.PATTERN111: return 0 == (b * c % 3 + (b + c) % 2) % 2; default: throw new Error("bad maskPattern:" + a) } }, getErrorCorrectPolynomial: function(a) { for (var b = new i([1],0), c = 0; a > c; c++) b = b.multiply(new i([1, g.gexp(c)],0)); return b }, getLengthInBits: function(a, b) { if (b >= 1 && 10 > b) switch (a) { case c.MODE_NUMBER: return 10; case c.MODE_ALPHA_NUM: return 9; case c.MODE_8BIT_BYTE: return 8; case c.MODE_KANJI: return 8; default: throw new Error("mode:" + a) } else if (27 > b) switch (a) { case c.MODE_NUMBER: return 12; case c.MODE_ALPHA_NUM: return 11; case c.MODE_8BIT_BYTE: return 16; case c.MODE_KANJI: return 10; default: throw new Error("mode:" + a) } else { if (!(41 > b)) throw new Error("type:" + b); switch (a) { case c.MODE_NUMBER: return 14; case c.MODE_ALPHA_NUM: return 13; case c.MODE_8BIT_BYTE: return 16; case c.MODE_KANJI: return 12; default: throw new Error("mode:" + a) } } }, getLostPoint: function(a) { for (var b = a.getModuleCount(), c = 0, d = 0; b > d; d++) for (var e = 0; b > e; e++) { for (var f = 0, g = a.isDark(d, e), h = -1; 1 >= h; h++) if (!(0 > d + h || d + h >= b)) for (var i = -1; 1 >= i; i++) 0 > e + i || e + i >= b || (0 != h || 0 != i) && g == a.isDark(d + h, e + i) && f++; f > 5 && (c += 3 + f - 5) } for (var d = 0; b - 1 > d; d++) for (var e = 0; b - 1 > e; e++) { var j = 0; a.isDark(d, e) && j++, a.isDark(d + 1, e) && j++, a.isDark(d, e + 1) && j++, a.isDark(d + 1, e + 1) && j++, (0 == j || 4 == j) && (c += 3) } for (var d = 0; b > d; d++) for (var e = 0; b - 6 > e; e++) a.isDark(d, e) && !a.isDark(d, e + 1) && a.isDark(d, e + 2) && a.isDark(d, e + 3) && a.isDark(d, e + 4) && !a.isDark(d, e + 5) && a.isDark(d, e + 6) && (c += 40); for (var e = 0; b > e; e++) for (var d = 0; b - 6 > d; d++) a.isDark(d, e) && !a.isDark(d + 1, e) && a.isDark(d + 2, e) && a.isDark(d + 3, e) && a.isDark(d + 4, e) && !a.isDark(d + 5, e) && a.isDark(d + 6, e) && (c += 40); for (var k = 0, e = 0; b > e; e++) for (var d = 0; b > d; d++) a.isDark(d, e) && k++; var l = Math.abs(100 * k / b / b - 50) / 5; return c += 10 * l } }, g = { glog: function(a) { if (1 > a) throw new Error("glog(" + a + ")"); return g.LOG_TABLE[a] }, gexp: function(a) { for (; 0 > a; ) a += 255; for (; a >= 256; ) a -= 255; return g.EXP_TABLE[a] }, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256) }, h = 0; 8 > h; h++) g.EXP_TABLE[h] = 1 << h; for (var h = 8; 256 > h; h++) g.EXP_TABLE[h] = g.EXP_TABLE[h - 4] ^ g.EXP_TABLE[h - 5] ^ g.EXP_TABLE[h - 6] ^ g.EXP_TABLE[h - 8]; for (var h = 0; 255 > h; h++) g.LOG_TABLE[g.EXP_TABLE[h]] = h; i.prototype = { get: function(a) { return this.num[a] }, getLength: function() { return this.num.length }, multiply: function(a) { for (var b = new Array(this.getLength() + a.getLength() - 1), c = 0; c < this.getLength(); c++) for (var d = 0; d < a.getLength(); d++) b[c + d] ^= g.gexp(g.glog(this.get(c)) + g.glog(a.get(d))); return new i(b,0) }, mod: function(a) { if (this.getLength() - a.getLength() < 0) return this; for (var b = g.glog(this.get(0)) - g.glog(a.get(0)), c = new Array(this.getLength()), d = 0; d < this.getLength(); d++) c[d] = this.get(d); for (var d = 0; d < a.getLength(); d++) c[d] ^= g.gexp(g.glog(a.get(d)) + b); return new i(c,0).mod(a) } }, j.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]], j.getRSBlocks = function(a, b) { var c = j.getRsBlockTable(a, b); if (void 0 == c) throw new Error("bad rs block @ typeNumber:" + a + "/errorCorrectLevel:" + b); for (var d = c.length / 3, e = [], f = 0; d > f; f++) for (var g = c[3 * f + 0], h = c[3 * f + 1], i = c[3 * f + 2], k = 0; g > k; k++) e.push(new j(h,i)); return e } , j.getRsBlockTable = function(a, b) { switch (b) { case d.L: return j.RS_BLOCK_TABLE[4 * (a - 1) + 0]; case d.M: return j.RS_BLOCK_TABLE[4 * (a - 1) + 1]; case d.Q: return j.RS_BLOCK_TABLE[4 * (a - 1) + 2]; case d.H: return j.RS_BLOCK_TABLE[4 * (a - 1) + 3]; default: return void 0 } } , k.prototype = { get: function(a) { var b = Math.floor(a / 8); return 1 == (1 & this.buffer[b] >>> 7 - a % 8) }, put: function(a, b) { for (var c = 0; b > c; c++) this.putBit(1 == (1 & a >>> b - c - 1)) }, getLengthInBits: function() { return this.length }, putBit: function(a) { var b = Math.floor(this.length / 8); this.buffer.length <= b && this.buffer.push(0), a && (this.buffer[b] |= 128 >>> this.length % 8), this.length++ } }; var l = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]] , o = function() { var a = function(a, b) { this._el = a, this._htOption = b }; return a.prototype.draw = function(a) { function g(a, b) { var c = document.createElementNS("http://www.w3.org/2000/svg", a); for (var d in b) b.hasOwnProperty(d) && c.setAttribute(d, b[d]); return c } var b = this._htOption , c = this._el , d = a.getModuleCount(); Math.floor(b.width / d), Math.floor(b.height / d), this.clear(); var h = g("svg", { viewBox: "0 0 " + String(d) + " " + String(d), width: "100%", height: "100%", fill: b.colorLight }); h.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"), c.appendChild(h), h.appendChild(g("rect", { fill: b.colorDark, width: "1", height: "1", id: "template" })); for (var i = 0; d > i; i++) for (var j = 0; d > j; j++) if (a.isDark(i, j)) { var k = g("use", { x: String(i), y: String(j) }); k.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template"), h.appendChild(k) } } , a.prototype.clear = function() { for (; this._el.hasChildNodes(); ) this._el.removeChild(this._el.lastChild) } , a }() , p = "svg" === document.documentElement.tagName.toLowerCase() , q = p ? o : m() ? function() { function a() { this._elImage.src = this._elCanvas.toDataURL("image/png"), this._elImage.style.display = "block", this._elCanvas.style.display = "none" } function d(a, b) { var c = this; if (c._fFail = b, c._fSuccess = a, null === c._bSupportDataURI) { var d = document.createElement("img") , e = function() { c._bSupportDataURI = !1, c._fFail && _fFail.call(c) } , f = function() { c._bSupportDataURI = !0, c._fSuccess && c._fSuccess.call(c) }; return d.onabort = e, d.onerror = e, d.onload = f, d.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==", void 0 } c._bSupportDataURI === !0 && c._fSuccess ? c._fSuccess.call(c) : c._bSupportDataURI === !1 && c._fFail && c._fFail.call(c) } if (this._android && this._android <= 2.1) { var b = 1 / window.devicePixelRatio , c = CanvasRenderingContext2D.prototype.drawImage; CanvasRenderingContext2D.prototype.drawImage = function(a, d, e, f, g, h, i, j) { if ("nodeName"in a && /img/i.test(a.nodeName)) for (var l = arguments.length - 1; l >= 1; l--) arguments[l] = arguments[l] * b; else "undefined" == typeof j && (arguments[1] *= b, arguments[2] *= b, arguments[3] *= b, arguments[4] *= b); c.apply(this, arguments) } } var e = function(a, b) { this._bIsPainted = !1, this._android = n(), this._htOption = b, this._elCanvas = document.createElement("canvas"), this._elCanvas.width = b.width, this._elCanvas.height = b.height, a.appendChild(this._elCanvas), this._el = a, this._oContext = this._elCanvas.getContext("2d"), this._bIsPainted = !1, this._elImage = document.createElement("img"), this._elImage.style.display = "none", this._el.appendChild(this._elImage), this._bSupportDataURI = null }; return e.prototype.draw = function(a) { var b = this._elImage , c = this._oContext , d = this._htOption , e = a.getModuleCount() , f = d.width / e , g = d.height / e , h = Math.round(f) , i = Math.round(g); b.style.display = "none", this.clear(); for (var j = 0; e > j; j++) for (var k = 0; e > k; k++) { var l = a.isDark(j, k) , m = k * f , n = j * g; c.strokeStyle = l ? d.colorDark : d.colorLight, c.lineWidth = 1, c.fillStyle = l ? d.colorDark : d.colorLight, c.fillRect(m, n, f, g), c.strokeRect(Math.floor(m) + .5, Math.floor(n) + .5, h, i), c.strokeRect(Math.ceil(m) - .5, Math.ceil(n) - .5, h, i) } this._bIsPainted = !0 } , e.prototype.makeImage = function() { this._bIsPainted && d.call(this, a) } , e.prototype.isPainted = function() { return this._bIsPainted } , e.prototype.clear = function() { this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height), this._bIsPainted = !1 } , e.prototype.round = function(a) { return a ? Math.floor(1e3 * a) / 1e3 : a } , e }() : function() { var a = function(a, b) { this._el = a, this._htOption = b }; return a.prototype.draw = function(a) { for (var b = this._htOption, c = this._el, d = a.getModuleCount(), e = Math.floor(b.width / d), f = Math.floor(b.height / d), g = [''], h = 0; d > h; h++) { g.push(""); for (var i = 0; d > i; i++) g.push(''); g.push("") } g.push("
"), c.innerHTML = g.join(""); var j = c.childNodes[0] , k = (b.width - j.offsetWidth) / 2 , l = (b.height - j.offsetHeight) / 2; k > 0 && l > 0 && (j.style.margin = l + "px " + k + "px") } , a.prototype.clear = function() { this._el.innerHTML = "" } , a }(); QRCode = function(a, b) { if (this._htOption = { width: 256, height: 256, typeNumber: 4, colorDark: "#000000", colorLight: "#ffffff", correctLevel: d.H }, "string" == typeof b && (b = { text: b }), b) for (var c in b) this._htOption[c] = b[c]; "string" == typeof a && (a = document.getElementById(a)), this._android = n(), this._el = a, this._oQRCode = null, this._oDrawing = new q(this._el,this._htOption), this._htOption.text && this.makeCode(this._htOption.text) } , QRCode.prototype.makeCode = function(a) { this._oQRCode = new b(r(a, this._htOption.correctLevel),this._htOption.correctLevel), this._oQRCode.addData(a), this._oQRCode.make(), this._el.title = a, this._oDrawing.draw(this._oQRCode), this.makeImage() } , QRCode.prototype.makeImage = function() { "function" == typeof this._oDrawing.makeImage && (!this._android || this._android >= 3) && this._oDrawing.makeImage() } , QRCode.prototype.clear = function() { this._oDrawing.clear() } , QRCode.CorrectLevel = d }(); function toggle_element(element) { if(typeof element == "string") element = document.getElementById(element); if(element == undefined || element == null) return; element.style.display = element.style.display != "block" ? "block" : "none"; } // show_dialog("sample", "dialog", null, -1); // show_dialog("sample", "dialog", "OK", 5000); // show_dialog("sample", "dialog", ["Yes", function (button) { alert(button); }, "No", "Cancel"], 1500); function getBrowserVersion() { var ua = navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if (/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return 'IE ' + (tem[1] || ''); } if (M[1] === 'Chrome') { tem = ua.match(/\b(OPR|Edge)\/(\d+)/); if (tem != null) return tem.slice(1).join(' ').replaceAll('OPR', 'Opera'); } M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?']; if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]); return M.join(' '); } function goback() { window.history.back(); } function hash(data) { return Sha256.hash(data); } function set_editor_content(content) { editor.setValue(get_str(content)); editor.setScrollPosition({ scrollTop: 0 }); editor.setPosition({ lineNumber: 0, column: 0 }); editor.focus(); } function start_heart_beat(interval) { if (is_null(interval)) interval = 60000; setInterval(function () { ajax("POST", "/Api/HeartBeat", null, function (data) { console.log(data); }); }, interval); } function start_auto_login(interval) { if (is_null(interval)) interval = 60000; let uuid = get_uuid(); if (uuid != "") { setInterval(function () { ajax("POST", "/Manager/Login/Api/AutoLogin", { uuid: uuid }); }, interval); } } function create_editor(id, lang) { if (lang == undefined || lang == "") lang = "html"; return monaco.editor.create(document.getElementById(id), { value: "", automaticLayout: true, language: lang, quickSuggestions: false, wordWrap: "bounded", wordWrapColumn: 1000, wrappingIndent: "indent" }); } function get_uuid() { let uuid = get_storage("REC_MANAGER_UUID"); if (uuid == undefined || uuid == "") { uuid = generate_uuid(); set_storage("REC_MANAGER_UUID", uuid); } return uuid; } function generate_uuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } function get_storage(key) { return localStorage.getItem(key); } function set_storage(key, value) { return localStorage.setItem(key, value); } function switch_elements(elements, index) { for (let i = 0; i < elements.length; i++) { if (i == index) show_element(elements[i]); else hide_element(elements[i]); } } function format_money(amount, decimalCount, decimal, thousands) { // = 2, decimal = ".", thousands = ",") { try { if (decimalCount == undefined) decimalCount = 2; if (decimal == undefined) decimal = "."; if (thousands == undefined) thousands = ","; decimalCount = Math.abs(decimalCount); decimalCount = isNaN(decimalCount) ? 2 : decimalCount; const negativeSign = amount < 0 ? "-" : ""; let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString(); let j = (i.length > 3) ? i.length % 3 : 0; return negativeSign + (j ? i.substr(0, j) + thousands : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands) + (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : ""); } catch (e) { console.log(e) } } function init_checkboxes() { let elements = document.querySelectorAll(".checkbox"); for (let i = 0; i < elements.length; i++) { let label = get_element_attr_value(elements[i], "label"); let checked = get_element_attr_value(elements[i], "checked"); elements[i].innerHTML = generate_checkbox_string(label, checked); elements[i].isChecked = function () { return this.querySelectorAll("input")[0].checked; }; elements[i].setCheck = function (checked) { this.querySelectorAll("input")[0].checked = checked; } } } function create_checkbox(label, checked) { let div_checkbox = document.createElement("div"); div_checkbox.className = "checkbox"; div_checkbox.innerHTML = generate_checkbox_string(label, checked); div_checkbox.isChecked = function () { return this.querySelectorAll("input")[0].checked; }; div_checkbox.setCheck = function (checked) { this.querySelectorAll("input")[0].checked = checked; } return div_checkbox; } function generate_checkbox_string(label, checked) { return ""; } function get_element_attr_value(element, attr) { let value = element.attributes[attr]; if (value == undefined) return ""; return value.value; } function init_links(query) { let elements = document.querySelectorAll(query); for (let i = 0; i < elements.length; i++) { let href = get_element_attr_value(elements[i], "href"); let target = get_element_attr_value(elements[i], "target"); if (target == "") target = "_current"; if (href == "") continue; elements[i].addEventListener("click", function (event) { window.open(href, target); }); } } function init_filter_inputs() { let inputs = document.getElementsByTagName("input"); for (let i = 0; i < inputs.length; i++) { let filter = get_element_attr_value(inputs[i], "filter"); if (filter == "") continue; let target = document.getElementsByName(filter); if (target.length == 0) continue; inputs[i].filter_target = target; inputs[i].addEventListener("keyup", function (event) { if (this.filter_target == undefined) return; for (let i = 0; i < this.filter_target.length; i++) { let options = this.filter_target[i].getElementsByTagName("option"); let key = this.value; for (let j = 0; j < options.length; j++) { options[j].style.display = options[j].innerHTML.toString().includes(key) == true ? "block" : "none"; } } }); } } function show_dialog(title, body, buttons, timeout, onclose) { let div_dialog = document.createElement("div"); div_dialog.className = "my_dialog"; let div_content = document.createElement("div"); div_content.className = "dlg_content"; div_dialog.appendChild(div_content); if (title != undefined && title != "") { let div_title = document.createElement("div"); div_title.className = "dlg_title"; div_title.innerHTML = title; div_content.appendChild(div_title); } if (body != undefined && body != "") { let div_message = document.createElement("div"); div_message.className = "dlg_message"; if (typeof (body) == "string") div_message.innerHTML = body; if (typeof (body) == "object") { div_message.innerHTML = ""; div_message.appendChild(body); } div_content.appendChild(div_message); } if (buttons != null && buttons.length > 0) { let div_buttons = document.createElement("div"); div_buttons.className = "dlg_buttons"; if (typeof (buttons) == "string") { let button = document.createElement("button"); button.innerHTML = buttons; button.addEventListener("click", function () { div_dialog.selected_button = button; close_dialog(div_dialog, onclose); }); div_buttons.appendChild(button); } else { for (let i = 0; i < buttons.length; i++) { if (typeof (buttons[i]) != "string") continue; let button = document.createElement("button"); button.innerHTML = buttons[i]; if (i < buttons.length - 1 && typeof (buttons[i + 1]) == "function") button.addEventListener("click", function () { div_dialog.selected_button = button; if (buttons[i + 1](button) != false) close_dialog(div_dialog, onclose); }); else button.addEventListener("click", function () { div_dialog.selected_button = button; close_dialog(div_dialog, onclose); }); div_buttons.appendChild(button); } } div_content.appendChild(div_buttons); } if (timeout > 0) setTimeout(function () { close_dialog(div_dialog, onclose); }, timeout); open_dialog(div_dialog); return div_dialog; } // let old_body_overflow_for_dialog = null; function open_dialog(dialog) { // old_body_overflow_for_dialog = document.body.style.overflow; // document.body.style.overflow = "hidden"; document.body.appendChild(dialog); } function close_dialog(dialog, onclose) { if (onclose != undefined) if (onclose(dialog.selected_button) == false) return; if (document.body.contains(dialog)) document.body.removeChild(dialog); // document.body.style.overflow = old_body_overflow_for_dialog; } function show_message(message, timeout, onclose) { if (timeout == undefined) timeout = 1000; return show_dialog(null, message, null, timeout, onclose); } function show_error(error, onclose) { return show_dialog(null, error, "OK", -1, onclose); } function show_dialog_for_design(title, design, buttons, timeout, onclose) { let div_design = document.getElementsByName(design); if (div_design.length == 0) return; return show_dialog(title, div_design[0], buttons, timeout, onclose); } function get_dialog_element_value(dialog, element_id) { let element = dialog.querySelector("#" + element_id); if (element == null) return null; return element.value; } function set_dialog_element_value(dialog, element_id, value) { let element = dialog.querySelector("#" + element_id); if (element == null) return null; element.value = value; } function get_dialog_element_checked(dialog, element_id) { let element = dialog.querySelector("#" + element_id); if (element == null) return null; return element.checked; } function set_dialog_element_checked(dialog, element_id, val) { let element = dialog.querySelector("#" + element_id); if (element == null) return null; return element.checked = val; } function dialog_element(dialog, element_id) { return dialog.querySelector("#" + element_id); } // Replace name with class function get_string(data) { if (is_null(data)) return ""; return data; } function add_str(arr, str) { if (is_null(str)) return; if (str.trim() == "") return; arr.push(str.trim()); } function get_addr_str(addr, city, state, zip) { let data = []; add_str(data, addr); add_str(data, city); add_str(data, state); add_str(data, zip); return data.join(","); } function is_null(data) { return data == undefined || data == null; } function get_email_atag(email, prefix) { if (is_null(email)) return ""; if (email == "") return ""; return get_str(prefix) + "" + email + ""; } function get_phone_atag(data, prefix) { if (is_null(data)) return ""; if (data == "") return ""; return get_str(prefix) + "" + data + ""; } function get_http_atag(data, prefix) { if (is_null(data)) return ""; if (data == "") return ""; return get_str(prefix) + "[" + data + "]"; } function get_agency_atag(data) { if (is_null(data)) return ""; return "" + get_string(data.Name) + ""; } function get_domain_atag(domain) { if (is_null(domain)) return ""; if (domain == "") return ""; return "[" + domain + "]"; } function get_domain_atag_v2(domain) { if (is_null(domain) || is_null(domain.Domain)) return ""; if (domain.Domain == "") return ""; return "[dev] [" + domain.Domain + "]"; } function get_dev_domain_atag(domain) { if (is_null(domain)) return ""; if (domain == "") return ""; return "[dev]"; } function get_http_url(url) { if (is_null(url) || url == "") return ""; if (url.startsWith("http")) return url; return "http://" + url; } if (typeof on_start === "function") window.addEventListener('load', on_start, false); if (typeof on_keyup === "function") window.addEventListener('keyup', on_keyup, false); if (typeof on_keydown === "function") window.addEventListener('keydown', on_keydown, false); if (typeof on_keypress === "function") window.addEventListener('keypress', on_keypress, false); function ismobile() { return screen.width < 900 || window.innerWidth < 900; } function on_load(callback) { if (callback && typeof callback == "function") window.addEventListener('load', callback, false); } function get_design_form_text(design_name, params) { let div_design = document.getElementsByName(design_name); if (div_design.length == 0) return ""; let str = div_design[0].innerText; if (params && params.length > 0) { for (let i = 0; i < params.length; i += 2) { if (i < params.length - 1) { str = str.replaceAll(params[i], params[i + 1]); } } } return str; } function get_class_form_html(design_id, params) { let div_design = document.getElementById(design_id); if (!div_design) return ""; let str = div_design.innerHTML; if (params && params.length > 0) { for (let i = 0; i < params.length; i += 2) { if (i < params.length - 1) { str = str.replaceAll(params[i], params[i + 1]); } } } return str; } function get_class_form_text(design_id, params) { let div_design = document.getElementById(design_id); if (!div_design) return ""; let str = div_design.innerText; if (params && params.length > 0) { for (let i = 0; i < params.length; i += 2) { if (i < params.length - 1) { str = str.replaceAll(params[i], params[i + 1]); } } } return str; } function get_template_html(template) { if(typeof template == "text") template = document.querySelector("template#" + template); if(!template) return ""; return template.innerHTML; } function getQueryString() { let key = false, res = {}, itm = null; let qs = location.search.substring(1); if (arguments.length > 0 && arguments[0].length > 1) key = arguments[0]; let pattern = /([^&=]+)=([^&]*)/g; while (itm = pattern.exec(qs)) { if (key !== false && decodeURIComponent(itm[1]) === key) return decodeURIComponent(itm[2]); else if (key === false) res[decodeURIComponent(itm[1])] = decodeURIComponent(itm[2]); } return key === false ? res : null; } function isInViewport(element) { if(typeof element === "string") element = document.getElementById(element); if(!element) return false; const rect = element.getBoundingClientRect(); return ( rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth) ); } function to_param_value(val) { var v = val.trim(); if (!v) return null; return v; } function valid_email(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } function ajax(method, url, param, callback, failed, prg) { let xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState == 4) { if (prg) close_dialog(prg); if (this.status == 200) { if (callback) callback(this.responseText); } else { if (failed) failed(this.responseText); } } }; xhttp.open(method, url, true); if (param) { xhttp.setRequestHeader("Content-type", "application/json"); xhttp.send(JSON.stringify(param)); } else xhttp.send(); } function ajax_xml(method, url, param, callback, failed, prg) { let xhttp = new XMLHttpRequest(); xhttp.onload = function () { if (callback) callback(xhttp.responseXML); }; xhttp.onerror = function () { if (failed) failed(xhttp.statusText); }; xhttp.open(method, url, true); if (param) { xhttp.setRequestHeader("Content-type", "application/json"); xhttp.send(JSON.stringify(param)); } else xhttp.send(); } function add_css_class(element, css_class) { css_class = css_class || ""; if(typeof element == "string") element = document.getElementById(element); if (!css_class || !element) return; element.classList.add(css_class); } function remove_css_class(element, css_class) { css_class = css_class || ""; if(typeof element == "string") element = document.getElementById(element); if (!css_class || !element) return; element.classList.remove(css_class); } function toggle_css_class(element, css_class) { css_class = css_class || ""; if(typeof element == "string") element = document.getElementById(element); if (!css_class || !element) return; if(element.classList.contains(css_class)) element.classList.remove(css_class); else element.classList.add(css_class); } function add_css_class_by_id(element_id, css_class, parent) { parent = parent || document; let element = parent.getElementById(element_id); add_css_class(element, css_class); } function remove_css_class_by_id(element_id, css_class, parent) { parent = parent || document; let element = parent.getElementById(element_id); remove_css_class(element, css_class); } function toggle_menu() { } function sticky_check() { if(isInViewport("sticky_checker")) remove_css_class_by_id("header_sticky", "sticky"); else add_css_class_by_id("header_sticky", "sticky"); } window.addEventListener("scroll", sticky_check); sticky_check(); if(window["mls_init_source_select"]) mls_init_source_select("select_source"); // var auto_testimonial_dialog_show = false; // var new_testimonial_path = "/TestimonialAdd"; // setTimeout(function () { // if(window.location.pathname == new_testimonial_path) return; // if(get_storage("REC_TESTIMONIAL") == "AlreadyLeft" || get_storage("REC_TESTIMONIAL") == "DontRemind") return; // if(auto_testimonial_dialog_show) return; // auto_testimonial_dialog_show = true; // ajax("POST", "/Api2/TestimonialNeed", null, function (data) { // if(data != "Yes") return; // show_dialog("Feedback?", "We would be happy to hear from you about your experience using our website. Would you like to leave feedback now?", [ // "Yes, leave feedback now.", function() { // window.location.href = new_testimonial_path; // }, "Remind me next visit", function() { // ajax("POST", "/Api2/TestimonialRemindNextTime"); // }, "No, don't remind me again.", function() { // set_storage("REC_TESTIMONIAL", "DontRemind"); // }]); // }); // }, 10000); // on_load(function() { // let token = getQueryString("token"); // if(token) set_storage("PDTOKEN", token); // else token = get_storage("PDTOKEN"); // if(window.location.pathname == "/" || window.location.pathname == "/Login" || window.location.pathname == "/RequestToken") return; // ajax("POST", "/Api2/PDTokenCheck", { token: token }, function (data) { // data = data.split(":"); // if(data[0] == "0") return; // if(window.location.pathname == "/ContactUs") return; // if(data[0] == "-2") { // show_message("This demo has expired. We hope you enjoyed the demo of our REC platform, please call 218 262-9553 to discuss development of your next Real Estate project. This page will be redirected to contact page for few seconds automatically.", -1); // setTimeout(function() { window.location.href = "/ContactUs"; }, 10000); // } else { // show_message("This is demo illustration.This page will be redirected to contact page if you wish to get our services.", -1); // setTimeout(function() { window.location.href = "/ContactUs"; }, 3000); // } // }, function (data) { // if (on_error != undefined) on_error("Error in Query POST."); // }); // }); var global_config = { mls_agents_template: "row", mls_listing_template: "card_full", mls_photo_gallery_type: "vertical", mls_property_detail_show: "_self", mls_property_detail_type: "wrapper", mls_map_search_type: "wrapper", mls_map_color_theme: "color", mls_map_listing_template: "card_small", mls_map_center: { lat: 42.4064708, lng: -88.1461539}, // mls_map_restricted_area: { // north: 48.754995, // west: -128.284486, // south: 21.461609, // east: -62.366525}, mls_map_default_zoom: 9.5, mls_map_minimal_zoom: 1, mls_map_remember_last_area: true, mls_map_remember_last_query: true, mls_map_search_timer: 4000, mls_map_drag_timer: 2000, mls_map_marker_html_callback: "my_mls_map_marker", mls_popup_listing_template: "card_mini", mls_no_listings_message: "", hide_create_alert_link: false, mls_map_search_init_query: "STATUS=[Active,Coming Soon]", mls_search_form_init_param: { order: "!MODIFICATIONTIMESTAMP", query: "STATUS=[Active,Coming Soon]" }, } function on_type_change() { mls_property_detail(get_element_val("select_type")); }