﻿
$(document).ready(function(){
    
    sizeElements()
    
    window.onresize = function() {
        sizeElements()
    }
    
    $('.slides').cycle({ 
        fx:      'scrollLeft', 
        speed:    500, 
        timeout:  5000,
        next:     '.next',
        prev:     '.prev'
    });

    $(".photo").cycle();
    
    $(".rollover").hover(function() {
        this.src = this.src.replace("_off","_rollover");
    },function() {
        this.src = this.src.replace("_rollover","_off");
    }
);

    
});

function sizeElements() {
    var width = $(window).width();
    var height = $(window).height();
    var height_header = $("#header").height() + 12;
    var height_content = $("#content").height();
    var height_footer = $("#footer").height() + 20;
    if ((height_footer + height_header + height_content) < height) {
        $("#content").css('height', (height - (height_footer + height_header + 55)) + 'px');
    }
}
