﻿
function resizeWindow(e) {
    sizeContent();
};

function sizeContent() {
    var height = ($(window).height());
    var lheight = ($('#leftcontent').height());
    var cheight = ($('#contentwrapper').height());
    var rheight = ($('#rightcontent').height());
    lheight = lheight + 200;
    rheight = rheight + 200;

    var myheight = 0;

    if (lheight > myheight) { myheight = lheight; }
    if (rheight > myheight) { myheight = rheight; }
    if (cheight > myheight) { myheight = cheight; }
    if (height > myheight) { myheight = height; }

    $('#contentwrapper').css('height', myheight);
    $('#left').css('height', myheight);
    $('#right').css('height', myheight);
};

function randomHeader(element, imagePath, imageExtension, imageTotal) {
    /* get a random number within the defined range and set the background
    image for the defined element accordingly */
    
    randomNumber = Math.round(Math.random() * (imageTotal - 1)) + 1;
    imgPath = (imagePath + randomNumber + imageExtension);
    $(element).css('background-image', ('url("' + imgPath + '")'));
};


function __changeDo(element) {
    var elem = $('div#rightcontent .ctext').length;
    for (var i = 0; i < elem; i ++) {
        $('div#rightcontent .ctext:eq('+i+')').css('display', 'none');
    }

    $('div#rightcontent .ctext:eq('+element+')').css('display', 'block');
};
