" movingComparisonData = movingComparisonData + "
" movingComparisonData = movingComparisonData + "
" }) }) // Expected Spending Data $.ajax({ url: baseUrl + "api/api/GetTotalMonthlySpendingComparisonByHouseholdType?licenseeGuid=" + strGuid + "&indexType=" + indexType + "&fromPlace=" + fromPlaceId + "&toPlace=" + toPlaceId, dataType: "json", }).then(function (data) { var table = data.dataSet.Table1 expectedSpendingData = "
Household Type
" strCurClass = "sectionRowBg" $.each(table, function (key, value) { if (strCurClass == "sectionRowBg") { strCurClass = "sectionRowAltBg" } else { strCurClass = "sectionRowBg" } expectedSpendingData = expectedSpendingData + "
" + value.ExpenditureName + "
" }) }) // Index Comparison Data /*$.ajax({url: baseUrl + "api/api/GetCategoryComparisonByPlace?licenseeGuid=" + strGuid + "&indexType=" + indexType + "&fromPlace=" + fromPlaceId + "&toPlace=" + toPlaceId,dataType: "json",}).then(function (data) {var table = data.dataSet.Table1;indexComparisonData = "
Category
";strCurClass = "sectionRowBg";$.each(table, function (key, value) {if (strCurClass == "sectionRowBg") {strCurClass = "sectionRowAltBg";} else {strCurClass = "sectionRowBg";}var strCategory = value.Category_Name;if (strCategory.indexOf("(") >= 0) {strCategory = strCategory.substring(0, strCategory.indexOf("("));}indexComparisonData = indexComparisonData + "
" + strCategory + "
";});});*/ // Average Price Comparison Data /*if (indexType == "1") {$.ajax({url: baseUrl + "api/api/GetAveragePriceComparison?licenseeGuid=" + strGuid + "&indexType=" + indexType + "&fromPlace=" + fromPlaceId + "&toPlace=" + toPlaceId,dataType: "json",}).then(function (data) {var table = data.dataSet.Table1;averagePriceData = "
Item
";strCurClass = "sectionRowBg";$.each(table, function (key, value) {if (strCurClass == "sectionRowBg") {strCurClass = "sectionRowAltBg";} else {strCurClass = "sectionRowBg";}averagePriceData = averagePriceData + "
" + value.Category_Name + "
";});}).done(function() {$('#averagePriceBody').empty();$('#averagePriceBody').append(averagePriceData);});} else {$('#averagePriceTbl').hide();}*/ getImportInfo() return true }}function getImportInfo() { // Import Information $.ajax({ url: baseUrl + "api/api/GetIndexImportInformation?licenseeGuid=" + strGuid + "&indexType=" + indexType, dataType: "json", }).then(function (data) { rangeInfo = data.rangeInfo })}function isBlank(val) { if (val == null) { return true } for (var i = 0; i < val.length; i++) { if (val.charAt(i) != " " && val.charAt(i) != "\t" && val.charAt(i) != "\n" && val.charAt(i) != "\r") { return false } } return true}function IsNumeric(sText) { var ValidChars = "0123456789." var IsNumber = true var Char for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i) if (ValidChars.indexOf(Char) == -1) { IsNumber = false } } return IsNumber}function formSubmit() { document.forms["frm"].Submit()}function FormatNumber(nStr) { nStr += "" x = nStr.split(".") x1 = x[0] x2 = x.length > 1 ? "." + x[1] : "" var rgx = /(\d+)(\d{3})/ while (rgx.test(x1)) { x1 = x1.replace(rgx, "$1" + "," + "$2") } return x1 + x2}function IncludeZero(value) { if (value.indexOf(".") < 0) { value = value + ".0" } return value}function scrollToContent() { document.querySelector("#salaryBox").scrollIntoView({ behavior: "smooth", })}$(document).ajaxComplete(function () { $("#salaryResult").empty() $("#salaryTextResult").empty() var instructions = "Based on the Income that you entered, if you are earning $" + FormatNumber(income) + " after tax dollars in " + strFromName + ", " + strFromState + ", the comparable after-tax income in " + strToName + ", " + strToState + " is " + afterTax + "." $("#salaryResult").append(FormatNumber(afterTax)) $("#salaryTextResult").append(instructions) $("#movingComparisonHeader").empty() instructions = "If you move from" + strFromName + ", " + strFromState + "to" + strToName + ", " + strToState $("#movingComparisonHeader").append(instructions) $("#movingComparisonBody").empty() $("#movingComparisonBody").append(movingComparisonData) $("#expectedSpendingBody").empty() $("#expectedSpendingBody").append(expectedSpendingData) $("#indexComparisonBody").empty() $("#indexComparisonBody").append(indexComparisonData) //$('#averagePriceBody').empty(); //$('#averagePriceBody').append(averagePriceData); if (hasSearched) { // Sometimes this fails, so redo the query if (rangeInfo === "") { setTimeout(getImportInfo, 500) } $("#ImportInformation").empty() instructions = "Index and average prices are based on data gathered between " + rangeInfo + ". For more information on the methodology, please visit C2ER Cost of Living Index website (www.coli.org).
* See what's included in monthly expected spending here." $("#ImportInformation").append(instructions) setTimeout(scrollToContent, 350) }})