﻿//*************************************************************************************
// File     : cetr_functions.js
// Requires : jquery.js (version 1.3.2+), braingnat.js (version 0.3.1+)
// Author   : Kyle Weems (ksw)
// Origin   : mindfly.com
// Created  : April 06, 2009
// Modified : May 21, 2009
//*************************************************************************************

$(document).ready(function() {
    setContentHeight(280);
    homeBannerRotator();
});

function setContentHeight(verticalOffset) {
    if (!verticalOffset) {
        verticalOffset = 0;
    }
    var minContentHeight = $(window).height() - verticalOffset;
    if ($('.section.content').height() < minContentHeight) {
        $('.section.content').height(minContentHeight);
    } 
}

function homeBannerRotator() {
    if ($('.homeBanner').length > 0) {
        $.get('/Controls/CETR/imageList/imageList.aspx?dir=/uploads/Images/rotator/', function(data) {
            var images = data.split("|");
            images.pop();
            var r = Math.floor(Math.random() * images.length);
            BrainGnat.slideshow.fadein('.homeBanner', images, 5000, 1000, r);
        });
    }
}

