
var featuredLeft = {
    properties: false,
    ids: [],
    total: 0,
    show: 4,
    start: 0,
    end: 0,
    intervalID: 0,
    init: function()
    {
        featuredLeft.properties = jQuery('div.propertySlideleft');
        featuredLeft.total = (featuredLeft.properties.length-1);
        featuredLeft.properties.each(function(i)
        {
            if(featuredLeft.start < featuredLeft.show)
            {
                jQuery(this).fadeIn(500);
                featuredLeft.start++;
            }
            else
            {
                jQuery(this).css('display', 'none');
            }
            featuredLeft.ids[i] = jQuery(this).attr('id');
        });
        featuredLeft.intervalID = setInterval('featuredLeft.animate()', 5000);
    },
    animate: function()
    {
        featuredLeft.properties.css('display','none');
        featuredLeft.start = (featuredLeft.start >= (featuredLeft.total - featuredLeft.show))? 0 : featuredLeft.start + featuredLeft.show;
        featuredLeft.end = (featuredLeft.end >= featuredLeft.total + 1)? featuredLeft.show : (featuredLeft.start + featuredLeft.show);
        for(var k = featuredLeft.start; k < featuredLeft.end; k++)
        {
            jQuery('#'+featuredLeft.ids[k]).fadeIn(500);
        }
    }
};

var featuredRight = {
    properties: false,
    ids: [],
    total: 0,
    show: 4,
    start: 0,
    end: 0,
    intervalID: 0,
    init: function()
    {
        featuredRight.properties = jQuery('div.propertySlideright');
        featuredRight.total = (featuredRight.properties.length-1);
        featuredRight.properties.each(function(i)
        {
            if(featuredRight.start < featuredRight.show)
            {
                jQuery(this).fadeIn(500);
                featuredRight.start++;
            }
            else
            {
                jQuery(this).css('display', 'none');
            }
            featuredRight.ids[i] = jQuery(this).attr('id');
        });
        featuredRight.intervalID = setInterval('featuredRight.animate()', 5000);
    },
    animate: function()
    {
        featuredRight.properties.css('display','none');
        featuredRight.start = (featuredRight.start >= (featuredRight.total - featuredRight.show))? 0 : featuredRight.start + featuredRight.show;
        featuredRight.end = (featuredRight.end >= featuredRight.total + 1)? featuredRight.show : (featuredRight.start + featuredRight.show);
        for(var k = featuredRight.start; k < featuredRight.end; k++)
        {
            jQuery('#'+featuredRight.ids[k]).fadeIn(500);
        }
    }
};

