';
var defaultSource = '';
var formSuccess = false;
var internationalProperty = 'false';
var countryCode = 'USA';
var disableReferralTracking = 'False';
var hideContactRefer = 'False';
var timeoutValue = 120000;
var googleAnalyticsId = '';
var pageName = 'General';
var cmsSiteId = '34679';
var widgetName = 'rpWebpart_GoogleRecaptcha';
var enableRecaptcha = 'true';
var captchaToken;
var o = {};
var kpv = {
"Studio+" : { "key" : 192, "bed" : 0, "bath" : 0 },
"S Bed /1 Bath" : { "key" : 192, "bed" : 5, "bath" : 1 },
"S Bed /1.5 Bath" : { "key" : 192, "bed" : 5, "bath" : 1.5 },
"1 Bed /1 Bath" : { "key" : 193, "bed" : 1, "bath" : 1 },
"1 Bed /1.5 Bath" : { "key" : 193, "bed" : 1, "bath" : 1.5 },
"1 Bed /2 Bath" : { "key" : 194, "bed" : 1, "bath" : 2 },
"1 Bed /2.5 Bath" : { "key" : 194, "bed" : 1, "bath" : 2.5 },
"2 Bed /1 Bath" : { "key" : 195, "bed" : 2, "bath" : 1 },
"2 Bed /1.5 Bath" : { "key" : 195, "bed" : 2, "bath" : 1.5 },
"2 Bed /2 Bath" : { "key" : 196, "bed" : 2, "bath" : 2 },
"2 Bed /2.5 Bath" : { "key" : 196, "bed" : 2, "bath" : 2.5 },
"3 Bed /1 Bath" : { "key" : 197, "bed" : 3, "bath" : 1 },
"3 Bed /1.5 Bath" : { "key" : 197, "bed" : 3, "bath" : 1.5 },
"3 Bed /2 Bath" : { "key" : 198, "bed" : 3, "bath" : 2 },
"3 Bed /2.5 Bath" : { "key" : 198, "bed" : 3, "bath" : 2.5 },
"3 Bed /3 Bath": { "key": 199, "bed": 3, "bath": 3 },
"3 Bed /3.5 Bath" : { "key" : 199, "bed" : 3, "bath" : 3.5 },
"4 Bed /1 Bath" : { "key" : 200, "bed" : 4, "bath" : 1 },
"4 Bed /1.5 Bath" : { "key" : 200, "bed" : 4, "bath" : 1.5 },
"4 Bed /2 Bath" : { "key" : 201, "bed" : 4, "bath" : 2 },
"4 Bed /2.5 Bath" : { "key" : 201, "bed" : 4, "bath" : 2.5 },
"4 Bed /3 Bath" : { "key" : 202, "bed" : 4, "bath" : 3 },
"4 Bed /3.5 Bath" : { "key" : 202, "bed" : 4, "bath" : 3.5 }
};
$(document).ready(function () {
$.ajax({
type: 'GET',
url: 'CmsSiteManager/callback.aspx?act=Proxy/GetPropertyDetails',
dataType: 'json',
timeout: timeoutValue,
success: function (data) {
$rpdata = data;
$.ajax({
type: 'GET',
url: 'CmsSiteManager/callback.aspx?act=Proxy/GetFloorPlans',
dataType: 'json',
timeout: timeoutValue,
success: function (data) {
$rpunits = null;
$rpdata.floorplans = data;
f_afterDataLoad();
},
error: function (response) {
if (response.statusText === "timeout") {
$('#widget_contact_us_2').html("
Time Out Error . Refresh Page or Try Again Later
");
}
}
});
},
error: function (response) {
if (response.statusText === "timeout") {
$('#widget_contact_us_2').html("
Time Out Error . Refresh Page or Try Again Later
");
}
}
});
});
function sendContactV1() {
if (enableRecaptcha == "true")
{
o['cmsSiteId'] = cmsSiteId;
o['pageName'] = pageName;
o['widgetName'] = widgetName;
}
googleAnalyticsId = f_getCookie('_ga');
o['googleAnalyticsId'] = googleAnalyticsId;
var a = $('#widget_contact_us_2 .form-item').serializeArray();
var t = "";
$('#widget_contact_us_2 .form-item').each(function () {
if (this.name == 'usersource') {
t = $('option:selected', this).text();
} else if (internationalProperty == 'true' && this.name == 'movedate')
t = this.value.substring(3, 5) + '-' + this.value.substring(0, 2) + '-' + this.value.substring(6, 10);
else
t = this.value;
t = t.replace(/"/g, """);
t = encodeURIComponent(t);
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(t || '');
} else {
o[this.name] = t || '';
}
});
if ($('#widget_contact_us_2 #e-mail').val().length == 0) {
var id = $("#widget_contact_us_2 #bedbathid option:selected").val();
try {
//Format
var combinePhone = $('#widget_contact_us_2 #dayPhone1').val() + $('#widget_contact_us_2 #dayPhone2').val() + $('#widget_contact_us_2 #dayPhone3').val();
var formatPhone = rptracker.formatPhoneNumber(combinePhone, countryCode);
//Hash all the parts before sending them to RPTracker.
var first_name = rptracker.hash($('#widget_contact_us_2 #firstname').val());
var last_name = rptracker.hash($('#widget_contact_us_2 #lastname').val());
//var phone = rptracker.hash($('#widget_contact_us_2 #dayPhone1').val() + $('#widget_contact_us_2 #dayPhone2').val() + $('#widget_contact_us_2 #dayPhone3').val());
var phone = rptracker.hash(formatPhone);
var email = rptracker.hash($('#widget_contact_us_2 #email').val());
var source = $('#widget_contact_us_2 #usersource option:selected').text();
var bed = 0;
var bath = 0;
for (var key in kpv) {
// skip loop if the property is from prototype
if (!kpv.hasOwnProperty(key)) continue;
var item = kpv[key];
if (item.key === parseInt(id)) {
bed = item.bed;
bath = item.bath;
break;
}
}
//Send the informaiton back over to RPTracker.
rptracker.track('Form Submitted', {
first_name: first_name,
last_name: last_name,
email: email,
phone_number: phone,
bed: bed,
bath: bath,
movein_date: $('#widget_contact_us_2 #movedate').val(),
source: source,
comments: $('#widget_contact_us_2 #msg').val()
});
}
catch(err) {
console.log("RPTracker failed but it is not a dependancy for the contact form. Please continue.");
}
$.ajax({
type: "POST",
dataType: "json",
cache: false,
timeout: timeoutValue,
url: "CMSSiteManager/Callback.aspx?act=set_contact",
data: o,
success: function (json) {
if (json.ErrorNumber) {
formSuccess = false;
$("#widget_contact_us_2 .btn-txt2").html('Error Submitting!');
} else {
try {
ga('set', { 'dimension15': json.LeaseStarLeadId });
if (json.Lead2LeaseLeadId != 0)
ga('set', { 'dimension17': json.Lead2LeaseLeadId });
f_analyticsSendEvent('Contact', 'Information Request', 'Thank you');
ga('set', { 'dimension15': null, 'dimension17': null });
} catch (e) {
}
try {
_gaq.push(['_trackEvent', 'Contact', 'Information Request', 'Thank you',, false]);
} catch (e) {
}
if (successScreen == '') {
var msg = $('.pnlMessage').html();
$("#widget_contact_us_2 #cu_2_body").html('
' + msg + '
');
}
else
window.open(successScreen, '_self');
}
return false;
},
beforeSend: function (json) {
formSuccess = true;
$("#widget_contact_us_2 .btn-txt2").html('Sending ...');
$("#widget_contact_us_2 .cu-2-submit").attr('style', 'background-color:lightgray;');
},
error: function (e) {
$("#widget_contact_us_2 .btn-txt2").html('Error Submitting!');
formSuccess = false;
}
});
}
}
function f_afterDataLoad() {
handle_contact_us();
if (internationalProperty == 'true')
$("#widget_contact_us_2 #movedate").datepicker({ format: "dd-mm-yyyy", startDate: new Date() });
else
$("#widget_contact_us_2 #movedate").datepicker({ format: "mm-dd-yyyy",startDate: new Date() });
$("#widget_contact_us_2 .cu-2-submit").click(function () {
if (formSuccess == true) {
return false;
}
if (validateme()) {
sendContactV1();
}
});
if (defaultSource == 0)
$('#widget_contact_us_2 #usersource').val('');
else if (defaultSource)
$('#widget_contact_us_2 #usersource').val(defaultSource);
else if ($("#widget_contact_us_2 #usersource option:contains('Property web site')").length > 0)
$('#widget_contact_us_2 #usersource option:contains("Property web site")').prop('selected', true);
else if ($("#widget_contact_us_2 #usersource option:contains('Website')").length > 0)
$('#widget_contact_us_2 #usersource option:contains("Website")').prop('selected', true);
else if ($("#widget_contact_us_2 #usersource option:contains('website')").length > 0)
$('#widget_contact_us_2 #usersource option:contains("website")').prop('selected', true);
else if ($("#widget_contact_us_2 #usersource option:contains('Web Site')").length > 0)
$('#widget_contact_us_2 #usersource option:contains("Web Site")').prop('selected', true);
else if ($("#widget_contact_us_2 #usersource option:contains('web site')").length > 0)
$('#widget_contact_us_2 #usersource option:contains("web site")').prop('selected', true);
if (disableReferralTracking.toLowerCase() != 'true' && matchedSourceId) {
$('#widget_contact_us_2 #usersource').val(matchedSourceId);
$('#widget_contact_us_2 .usersources').hide();
}
if (hideContactRefer.toLowerCase() == 'true')
$('#widget_contact_us_2 .usersources').hide();
if (commentPlaceHolderText) {
$('#widget_contact_us_2 #msg').val(commentPlaceHolderText);
$('#widget_contact_us_2 #msg').addClass('empty');
$('#widget_contact_us_2 #msg').focus(function () {
if ($('#widget_contact_us_2 #msg').val() == commentPlaceHolderText) {
$('#widget_contact_us_2 #msg').val('');
$('#widget_contact_us_2 #msg').removeClass('empty');
}
});
$('#widget_contact_us_2 #msg').blur(function () {
if ($('#widget_contact_us_2 #msg').val() == '') {
$('#widget_contact_us_2 #msg').val(commentPlaceHolderText);
$('#widget_contact_us_2 #msg').addClass('empty');
}
});
}
$('#internationalPhone').on("keyup", function () {
var value = $(this).val();
var regex1 = /[^[0-9 +]]*/gi;
var regex2 = /[^[0-9]]*/gi;
var newValue = value.substring(0, 1).replace(regex1, '') + value.substring(1).replace(regex2, '');
$('#internationalPhone').val(newValue);
});
}
function isset(object) {
var def = true;
if (object == undefined) {
def = false;
}
return def;
}
function handle_contact_us() {
//src = $rpdata.thumbnail.replace('%s', '400x50');
$moveDate = realpage_blocks_movedate();
$img = '/sites/all/modules/custom/realpage_blocks/realpage_blocks_cu_2/images/contactus.jpg';
$addy1 = isset($rpdata.address.address1) ? $rpdata.address.address1 : "";
$addy2 = isset($rpdata.address.address2) ? $rpdata.address.address2 : "";
$sc = isset($rpdata.address.statecode) ? $rpdata.address.statecode : "";
$city = isset($rpdata.address.cityname) ? $rpdata.address.cityname : "";
$post = isset($rpdata.address.postalcode) ? $rpdata.address.postalcode : "";
$phone = isset($rpdata.phoneNumber) ? "
Leasing : " + $rpdata.phoneNumber + "
" : "";
$email = isset($rpdata.email) ? "
Email: Click here " : "";
$address = $addy1;
$htmladdress = $addy1;
if (isset($addy2)) {
$address += " " + $addy2;
$htmladdress += "
" + $addy2;
}
if (isset($city)) {
$address += ", " + $city;
$htmladdress += "
" + $city;
}
if (isset($sc)) {
$address += ", " + $sc;
$htmladdress += ", " + $sc;
}
if (isset($post)) {
$address += " " + $post;
$htmladdress += " " + $post;
}
$officehours = realpage_blocks_officehours();
$contactform = realpage_blocks_contact_form($moveDate);
$sHTML = '' +
'
' +
'
' +
'
If you have any questions, please let us know in the "comments" box below.
' +
'
' +
'
' +
'
';
jQuery('#widget_contact_us_2').html($sHTML);
}
function realpage_blocks_movedate() {
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
var d = new Date();
$m = d.getMonth();
$Y = d.getYear();
$month1 = new Date(d.setMonth(d.getMonth() + 1));
$month15 = new Date(d.setMonth(d.getMonth() + 1));
$month15 = new Date($month15.setDate(15));
$month2 = new Date(d.setMonth(d.getMonth() + 2));
$month25 = new Date(d.setMonth(d.getMonth() + 2));
$month25 = new Date($month25.setDate(15));
$month3 = new Date(d.setMonth(d.getMonth() + 3));
$month35 = new Date(d.setMonth(d.getMonth() + 3));
$month35 = new Date($month35.setDate(15));
$month4 = new Date(d.setMonth(d.getMonth() + 4));
return '
Early ' + monthNames[$month1.getMonth()] + ' ' +
'
Mid/Late ' + monthNames[$month1.getMonth()] + ' ' +
'
Early ' + monthNames[$month2.getMonth()] + ' ' +
'
Mid/Late ' + monthNames[$month2.getMonth()] + ' ' +
'
Early ' + monthNames[$month3.getMonth()] + ' ' +
'
Mid/Late ' + monthNames[$month3.getMonth()] + ' ' +
'
more than 3 months ';
}
function substr(value, start, end) {
return value.substring(start, end);
}
function realpage_blocks_officehours() {
$officehours = "";
if (isset($rpdata.propertyOfficeHours)) {
$start = "";
$end = "";
$start = substr($rpdata.propertyOfficeHours[0]["dayOfWeek"], 0, 3);
$open = $rpdata.propertyOfficeHours[0]["startTime1"];
$close = $rpdata.propertyOfficeHours[0]["endTime1"];
for (var i = 0; i ";
$start = substr($value["dayOfWeek"], 0, 3);
}
$end = substr($value["dayOfWeek"], 0, 3);
$open = $rpdata.propertyOfficeHours[i]["startTime1"];
$close = $rpdata.propertyOfficeHours[i]["endTime1"];
}
if ($start != $end) $officehours += $start + "-" + $end + ": " + $open + " to " + $close + "
";
if (($start == $end) && ($start != "")) $officehours += $start + ": " + $open + " to " + $close + "
";
}
return $officehours;
}
function variable_get(prop_config) {
if (prop_config == 'hide') {
return 0;
}
else {
return 1;
}
}
function realpage_blocks_contact_form($moveDate) {
var hideFlag = 'True';
$address = (hideAddress != hideFlag) ? "
" : "";
$cityValue = (hideCity != hideFlag) ? "
" : "";
$stateValue = (hideState != hideFlag) ? '
State ' +
'' +
'-Select State- ' +
'AK ' +
'AL ' +
'AR ' +
'AZ ' +
'CA ' +
'CO ' +
'CT ' +
'DC ' +
'DE ' +
'FL ' +
'GA ' +
'GU ' +
'HI ' +
'IA ' +
'ID ' +
'IL ' +
'IN ' +
'KS ' +
'KY ' +
'LA ' +
'MA ' +
'MD ' +
'ME ' +
'MI ' +
'MN ' +
'MO ' +
'MS ' +
'MT ' +
'NC ' +
'ND ' +
'NE ' +
'NH ' +
'NJ ' +
'NM ' +
'NV ' +
'NY ' +
'OH ' +
'OK ' +
'OR ' +
'PA ' +
'PR ' +
'RI ' +
'SC ' +
'SD ' +
'TN ' +
'TX ' +
'UT ' +
'VA ' +
'VI ' +
'VT ' +
'WA ' +
'WI ' +
'WV ' +
'WY ' +
"
" : "";
$zipCode = (hideZip != hideFlag) ? '
' : "";
$howdidyouhear = hdyhSources;
$noHousehold = (hideNoHouseHold != hideFlag) ? '
' : "";
$cmsg = (hideMessage != hideFlag) ? '
' : "";
/*$cpriceRange = (hidePriceRange != hideFlag) ? "" : "";
$sLast = "";
$sRentDD = "";
ForEach ($aDropdowns["rent"] as $key => $value)
{
If ( $sLast != "" )
$sRentDD += "
$" + number_format($sLast, 2, ',', ',') . " - $" . number_format($value, 2, ',', ',') . " ";
$sLast = $value;
}
$cpriceRange = '
Price Range
-select amount-
'.$sRentDD.'
';*/
$cmoveDate = '
* Move-in Date (' + (internationalProperty == 'true' ? 'dd-mm-yyyy' : 'mm-dd-yyyy') + ')
';
$chavePets = (hideHavePets != hideFlag) ? '
Do you (or will you) have pets?
' +
'' : "";
$cpreferedCtc = (hidePreferedCtc != hideFlag) ? '
Contact me by:
' +
'' : "";
$cdayOfWeek = (hideDayOfWeek != hideFlag) ? '
Best day/time to call:
' +
'-Select Day- ' +
'any day ' +
'weekdays ' +
'weekends ' +
'
' : "";
$cunitType = "";
$bathRooms = 0;
$bedRooms = 0;
if (hideUnitType != hideFlag) {
$cunitType = '
Unit Type
' +
'' +
'- ';
if ($rpunits != null && $rpunits.units != null) {
for (var i = 0; i ' + str + '';
} catch(err) {
//This error typically happens when it cannot find the str and consaquently cannot find the key.
}
$bathRooms = $currentbathRooms;
$bedRooms = $currentbedRooms;
}
}
$cunitType += '
';
}
else
$cunitType = "";
}
var reasonsArray = listofReasons.split('|');
$reason = (hideReason == hideFlag || listofReasons == '') ? "" : '
Reason
' +
'
' +
'- Select Reason - ' +
(reasonsArray.indexOf('188') >= 0 ? 'Make Appointment to Visit ' : '') +
(reasonsArray.indexOf('189') >= 0 ? 'Question About Rent ' : '') +
(reasonsArray.indexOf('190') >= 0 ? 'Question About Lease Terms ' : '') +
(reasonsArray.indexOf('203') >= 0 ? 'Affordable Housing ' : '') +
(reasonsArray.indexOf('191') >= 0 ? 'Other ' : '') + '
';
var $phoneNo = (hidePhoneNumber != hideFlag) ? '
' : "";
$propetyId = isset($rpdata.id) ? $rpdata.id : "";
$lcid = f_getCookie('RP_LSWS_LCID');
$lcid = $lcid ? $lcid : "4";
$cid = f_getCookie('RP_LSWS_SEM');
$cid = $cid ? $cid : "Property Website";
if ($cid != "Property Website") {
$cid = decodeURIComponent(matchedSource); //The logic for setting the matchedSource based on the cid value in the commondata.ascx file
}
$trackingId = f_analyticsGetTrackingId() || '';
$sHTML = '
' +
'
' +
'
' +
'
' +
'
';
return $sHTML;
}
function validPhone(b) {
var a = window.event ? b.keyCode : b.which;
if (internationalProperty == 'true' && $('#internationalPhone').val().length == 0 && b.shiftKey && b.keyCode == 43)
return true;
if (a == 0 || a == 8)
return true;
if (a > 47 && a 47 && a 95 && a = $(t).attr("maxlength"))
$('#' + to).focus();
}
}
function backspaceOnly(b, t, from) {
var a = window.event ? b.keyCode : b.which;
if (a == 8) {
if ($(t).val().length == 0) {
var noErrors = true;
try {
$('#' + from)[0].setSelectionRange($(t).attr("maxlength"), $(t).attr("maxlength"));
}
catch (err) { // IE8 does not recognize setSelectionRange, just making sure it doesn't break the page.
noErrors = false;
}
if(noErrors)
$('#' + from).focus();
}
}
}
/*
**
** Turn serialized form data into JSON.
**
** @use $('#debug').text(JSON.stringify($('form').serializeObject()));
**
*/
$.fn.serializeObject = function () {
var o = {};
var a = this.serializeArray();
var t = "";
$.each(a, function () {
t = this.value;
t = t.replace(/"/g, """); // Needs to be a better solution to this. But replacing with %22 (like it should be) was also killing the PHP (breaking up the POST array the same way unescaped "&"'s were).
t = encodeURIComponent(t); // Encode "&"'s and such. The original code on stackoverflow doesn't (http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-jquery).
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(t || '');
} else {
o[this.name] = t || '';
}
});
return o;
};
function validateme() {
var error = 0;
var errorList = "";
var foxusset = false;
var reg = /^(([^()[\]\\.,;:\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,}))$/;
$('#widget_contact_us_2 #cu_2_error_list').empty();
var f = $('#widget_contact_us_2 #firstname');
try {
if (f.val() == '') {
f.css('borderColor', 'red');
f.attr("aria-invalid", "true");
f.focus();
foxusset = true;
errorList += '
First name is required ';
} else {
f.css('borderColor', '');
f.removeAttr("aria-invalid");
}
} catch (e) { }
try {
f = $('#widget_contact_us_2 #lastname');
if (f.val() == '') {
f.css('borderColor', 'red');
f.attr("aria-invalid", "true");
if (!foxusset) {
f.focus();
foxusset = true;
}
errorList += '
Last name is required ';
} else {
f.css('borderColor', '');
f.removeAttr("aria-invalid");
}
} catch (e) { }
try {
f = $('#widget_contact_us_2 #movedate');
if (f.val() == '') {
f.css('borderColor', 'red');
f.attr("aria-invalid", "true");
if (!foxusset) {
f.focus();
foxusset = true;
}
errorList += '
Move-in date is required ';
} else {
f.css('borderColor', '');
f.removeAttr("aria-invalid");
}
} catch (e) { }
if ($('#widget_contact_us_2 #dayPhone1').length > 0) {
if ($('#widget_contact_us_2 #dayPhone1').val() == '' || $('#widget_contact_us_2 #dayPhone2').val() == '' || $('#widget_contact_us_2 #dayPhone3').val() == '' ||
$('#widget_contact_us_2 #dayPhone1').val().length != 3 || $('#widget_contact_us_2 #dayPhone2').val().length != 3 || $('#widget_contact_us_2 #dayPhone3').val().length != 4) {
errorList += '
Valid phone number is required ';
}
if ($('#widget_contact_us_2 #dayPhone1').val() == '' || $('#widget_contact_us_2 #dayPhone1').val().length != 3) {
$('#widget_contact_us_2 #cu_2_error_phone_and_email').css('display', 'block');
$('#widget_contact_us_2 #dayPhone1').css('borderColor', 'red');
$('#widget_contact_us_2 #dayPhone1').attr("aria-invalid", "true");
} else {
$('#widget_contact_us_2 #dayPhone1').css('borderColor', '');
$('#widget_contact_us_2 #dayPhone1').removeAttr("aria-invalid");
}
}
if ($('#widget_contact_us_2 #dayPhone2').length > 0) {
if ($('#widget_contact_us_2 #dayPhone2').val() == '' || $('#widget_contact_us_2 #dayPhone2').val().length != 3) {
$('#widget_contact_us_2 #cu_2_error_phone_and_email').css('display', 'block');
$('#widget_contact_us_2 #dayPhone2').css('borderColor', 'red');
$('#widget_contact_us_2 #dayPhone2').attr("aria-invalid", "true");
} else {
$('#widget_contact_us_2 #dayPhone2').css('borderColor', '');
$('#widget_contact_us_2 #dayPhone2').removeAttr("aria-invalid");
}
}
if ($('#widget_contact_us_2 #dayPhone3').length > 0) {
if ($('#widget_contact_us_2 #dayPhone3').val() == '' || $('#widget_contact_us_2 #dayPhone3').val().length != 4) {
$('#widget_contact_us_2 #cu_2_error_phone_and_email').css('display', 'block');
$('#widget_contact_us_2 #dayPhone3').css('borderColor', 'red');
$('#widget_contact_us_2 #dayPhone3').attr("aria-invalid", "true");
} else {
$('#widget_contact_us_2 #dayPhone3').css('borderColor', '');
$('#widget_contact_us_2 #dayPhone3').removeAttr("aria-invalid");
}
}
try {
f = $('#widget_contact_us_2 #email');
if (f.val() == '' || reg.test(f.val()) == false) {
f.css('borderColor', 'red');
f.attr("aria-invalid", "true");
if (!foxusset) {
f.focus();
foxusset = true;
}
errorList += '
Valid email address is required ';
} else {
f.css('borderColor', '');
f.removeAttr("aria-invalid");
}
} catch (e) { }
if ($('#widget_contact_us_2 #movedate').val() != '') {
var today = f_todayYYYYMMDD();
var splits = $('#widget_contact_us_2 #movedate').val().split('-');
splits[0] = (splits[0].length == 1) ? '0' + splits[0] : splits[0];
splits[1] = (splits[1].length == 1) ? '0' + splits[1] : splits[1];
var moveInDate = splits[2] + '-' + splits[0] + '-' + splits[1];
if (moveInDate Move-in date cannot be in the past.';
} else {
$('#widget_contact_us_2 #movedate').css('borderColor', '');
$('#widget_contact_us_2 #movedate').removeAttr("aria-invalid");
}
}
if (errorList != "") {
$('#widget_contact_us_2 #cu_2_error_list').append(errorList);
$('#widget_contact_us_2 #cu_2_error_list li').first().attr("role", "alert");
document.getElementById('cu_2_error').style.display = 'block';
return false;
}
return true;
}
function f_todayYYYYMMDD() {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
return yyyy + '-' + (mm