﻿
function initialize() {

    var container = getElementById('rotator-container');
    var description = getElementById('rotator-description');

    var random = Math.floor(Math.random() * 4);
    if (random == 0) {
        random = 1;
    }
    else if (random < descriptions.length + 1) {
        random = 3;
    }

    if (container) {
        container.style.backgroundImage = "url('images/intro-dsv4-" + random + ".png')";
        if (description) {
            description.innerHTML = descriptions[(random - 1)];
        }
    }
}

/*
function nextSlide(id) {
    location.hash = '#rotator';
    if (id > 0 && id < descriptions.length) {
        
    }
    else {
        id = 0;
    }
    var container = getElementById('rotator-container');
    var description = getElementById('rotator-description');
    var arrow = getElementById('rotator-arrow');
    if (container) {
        container.style.backgroundImage = "url('images/intro-dsv4-" + (id + 1) + ".png')";
        if (description) {
            description.innerHTML = descriptions[id];
        }
        if (arrow) {
            arrow.href = "javascript:nextSlide(" + (id + 1) + ")";
        }
    }
    if (id > 0 && id < descriptions.length - 1) {
        id += 1;
    }
    else {
        id = 0;
    }
}
*/

var descriptions = [
    '<p><strong>Cultivating Independence</strong></p><p>Available 24 hours per day 7 days per week from anywhere in the world, students have access to request accommodations, check the status of their request, and update their information as necessary.</p>',
    '<p><strong>Rich Features</strong></p><p>Integrated emailing capabilities - track all sent information to students. Go paperless and centralize all your information in one easy to use system. Customize your faculty notification letters and automate your processes.</p>',
    '<p><strong>Generate Metrics</strong></p><p>Obtain instant metrics and information on your unique demographics. Provide metrics on primary disabilities, target specific groups, or perform trend analysis.</p>'];

/**
* Get an object, this function is cross browser
* *** Please do not remove this header. ***
* This code is working on my IE7, IE6, FireFox, Opera and Safari
* 
* Usage: 
* var object = get_object(element_id);
*
* @Author Hamid Alipour Codehead @ webmaster-forums.code-head.com  
**/
function getElementById(id) {
    var object = null;
    if (document.layers) {
        object = document.layers[id];
    } else if (document.all) {
        object = document.all[id];
    } else if (document.getElementById) {
        object = document.getElementById(id);
    }
    return object;
}

