// Promo object
var Promo = new Class({
    initialize: function(div) {
        this.div = div;
    },
    strings: ["Award-winning prairie and native plantings specialist will manage Rhapsody Cove's open space","Four-acre community garden promoting children’s education in conservation practices","Five miles of recreational trails on 243 acres, 63 percent of which is open space","17-acre family park with old fashioned baseball and soccer field","20 acres of federally protected wetlands","21-acre sportsman's lake for fishing and boating","107 estate home sites; choose from the area's best builders","No home backs to another home","Curved linear roads with landscaped European style turnabouts to slow traffic","Nearly 100% of all mature high quality trees preserved and hundreds more planted","Ideally located near Interstate 57 and Route 45 adjacent to Bourbonnais and Manteno"],
    counter: -1
});
Promo.implement({
    fadeOut: function() {
        $(this.div).effect('opacity', {duration: 500}).custom(1,0);
    },
    fadeUp: function() {
        $(this.div).effect('opacity', {duration: 1500}).custom(0,1);
    },
    update: function() {
        this.counter = (this.counter < this.strings.length-1) ? this.counter+1 : 0;
        $(this.div).setHTML(this.strings[this.counter]);
        this.fadeUp();
    }
});

// Initialize
function preparePromo() {
    if (!document.getElementById) return false;
    if(!document.getElementById('promo')) return false;
    var hide = new Fx.Style('promo', 'opacity').set(0);
    PR.update();
    refreshPromo.periodical(7000);
}
// Update
function refreshPromo() {
    PR.fadeOut();
    (function() {PR.update()}).delay(700);
}

var PR = new Promo('promo');
window.addEvent('domready', preparePromo);