‘;
var top = ”;
$(‘section#search-results’).empty().append(top);
if ($(‘#search-input’).text() != ”) {
for (i = 0; i
‘ + searchedData[i].rank + ‘
‘ + growth + ‘
‘ + revenue + ‘
‘ + searchedData[i].industry + ‘
‘ + searchedData[i].country + ‘
‘;
$(‘section#search-results’).append(row);
}
} else {
$(‘section#search-results’).html(‘
Please search by company, industry, or metro area above…
‘);
}
}
function searchData() {
searchedData = _.filter(returnedData, function(item) {
// return searchTerm.test(item.company) || searchTerm.test(item.city) || searchTerm.test(item.state_l) || searchTerm.test(item.industry);
return searchTerm.test(item.company) || searchTerm.test(item.industry) || searchTerm.test(item.metro);
});
showData();
}
function numberWithCommas(x) {
var parts = x.toString().split(“.”);
parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, “,”);
return parts.join(“.”);
}
function roundRevenue(rev) {
var revenue = Math.round(rev);
var rLength = revenue.toString().length;
var rW = [];
revenue = revenue.toString();
switch(rLength) {
case 12:
rW[1] = revenue.substring(0,3);
rW[2] = revenue.substring(3,4);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘b’;
return revenue;
break;
case 11:
rW[1] = revenue.substring(0,2);
rW[2] = revenue.substring(2,3);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘b’;
return revenue;
break;
case 10:
rW[1] = revenue.substring(0,1);
rW[2] = revenue.substring(1,2);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘b’;
return revenue;
break;
case 9:
rW[1] = revenue.substring(0,3);
rW[2] = revenue.substring(3,4);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘m’;
return revenue;
break;
case 8:
rW[1] = revenue.substring(0,2);
rW[2] = revenue.substring(2,3);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘m’;
return revenue;
break;
case 7:
rW[1] = revenue.substring(0,1);
rW[2] = revenue.substring(1,2);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘m’;
return revenue;
break;
case 6:
rW[1] = revenue.substring(0,3);
rW[2] = revenue.substring(3,4);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘k’;
return revenue;
break;
case 5:
rW[1] = revenue.substring(0,2);
rW[2] = revenue.substring(2,3);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘k’;
return revenue;
break;
case 4:
rW[1] = revenue.substring(0,1);
rW[2] = revenue.substring(1,2);
if (rW[2] > 0) {rW[0] = ‘.’;} else {rW[0] = ”; rW[2] = ”;}
revenue = ‘$’ + rW[1] + rW[0] + rW[2] + ‘k’;
return revenue;
break;
}
}
// }
});
‘);
$(‘.status’).css(‘display’, ‘flex’);
$.post(‘../lib/newsletter-signup.php’, formValues, function(data) {
if (data == ‘1’) {
$(‘.form-messages’).html(“Thank you for signing up for Inc. Must Reads!”);
document.cookie = “incNewsletterFlyinCompleted=true; expires=Fri, 1 Jan 2100 00:00:00 UTC; path=/”;
setTimeout(function() {
$(‘#newsletter-flyin’).remove();
}, 2000);
} else if (data == ‘-1’) {
$(‘.form-messages’).html(“This email address is already signed up.”);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
}, 5000);
} else {
$(‘.form-messages’).html(“Something went wrong…”);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
}, 2000);
}
});
} else {
$(‘.form-messages’).html(“Please enter a valid email address”);
$(‘.status’).css(‘display’, ‘flex’);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
}, 2000);
}
return false;
});
});