var FeaturedPropertyFormClass = Class.create(); FeaturedPropertyFormClass.prototype = { initialize: function(options) { }, getStartDate: function() { var dY = parseInt($('select[name="start_date[Y]"]').val()); var dM = parseInt($('select[name="start_date[M]"]').val()); var dD = parseInt($('select[name="start_date[d]"]').val()); if (isNaN(dY) || isNaN(dM) || isNaN(dD)) { return false; } return sprintf('%04d-%02d-%02d', dY, dM, dD); }, getEndDate: function() { var dY = parseInt($('select[name="end_date[Y]"]').val()); var dM = parseInt($('select[name="end_date[M]"]').val()); var dD = parseInt($('select[name="end_date[d]"]').val()); if (isNaN(dY) || isNaN(dM) || isNaN(dD)) { return false; } return sprintf('%04d-%02d-%02d', dY, dM, dD); }, getCurrentDate: function() { var d = new Date(); var y = d.getYear(); if (y < 1900) { y += 1900; } return sprintf('%04d-%02d-%02d', y, d.getMonth() + 1, d.getDate()); }, updateStatus: function() { var sd = this.getStartDate(); var ed = this.getEndDate(); var cd = this.getCurrentDate(); var status = 'Inactive'; if (sd && ed) { if (sd <= cd && ed >= cd) { status = 'Showing on homepage'; } else if (sd > cd) { status = 'Inactive - will be shown in future' } else if (ed < cd) { status = 'Inactive - was shown before'; } } $('#id_active').html(status); } }; var featuredPropertyForm = new FeaturedPropertyFormClass(); // --------------------------------------------------------------------------------------------------------------- var slideTimer = null; var slideWidth = 0; var slidesWidth = 0; var slideCurrentOffset = 0; var slideMaxOffset = 0; var frameSize = null; //5; var centerFrame = 3; var slidesData = null; var slidesMoving = false; var shortTimeout = 7000; var longTimeout = 20000; function slideTimeoutStart(timeout) { timeout = parseInt(timeout) || shortTimeout; slideTimer = setTimeout("prevSlides();", timeout); return true; } function slideTimeoutStop() { if (slideTimer != null) { clearTimeout(slideTimer); slideTimer = null; } return true; } function slideShowActive() { var slideId = $(".slide_list div:eq(2)").attr('id'); slideShowItem(slideId); } function nextSlides(timeout, step) { if (typeof step == 'undefined') { step = frameSize; } slideTimeoutStop(); if (slideMaxOffset > step && !slidesMoving) { var duration = 1000; if (step < frameSize) { duration = duration / (frameSize - step); } slidesMoving = true; var appendFrame = $('div.slide_list div[id^=property_slide_]:lt(' + step + ')'); $(appendFrame).each(function () { $('div.slide_list').append('
'
+ ' ';
/*if (slidesData[idSlide].be_seen_url) {
html += ' | '
+ ' '
+ ' ' + slidesData[idSlide].property_name + ' '
+ ' ' + slidesData[idSlide].availability_title + ' '
+ ' ' + slidesData[idSlide].property_address + ' '
+ ' ' + slidesData[idSlide].property_city + ', ' + slidesData[idSlide].property_state + ' ' + slidesData[idSlide].property_zip + ' Type: ' + slidesData[idSlide].property_type + ' '
+ ' Contact: ' + slidesData[idSlide].contact_name + ', ' + slidesData[idSlide].company + ' '
+ ' VIEW DETAILS'
+ ' | '
+ '