function resize() {
    //adjust to the size of the images used as background.		
    var width = 1500;
    var height = 1000;

    var browserwidth = $(window).width();
    var browserheight = $(window).height();

    var minheight = 590;
    var maxheight = browserheight - 40;

    if (maxheight < minheight) {
        maxheight = minheight;
    }

    $('#sImg').width(width * maxheight / height);
    $('#sImg').height(maxheight);

    $('#container').width(width * maxheight / height);
    $('#container').height(maxheight);
    $('#sImg').attr('src', background );

    if($('.maximize').length) {
        $('.maximize').width((width * maxheight / height) - 305);
    }
}

$(document).ready(function() {
    resize();
});

$(window).resize(function() {
    resize();
});

var cochin = {
    src: '/sifr.swf'
      , ratios: [7, 1.32, 11, 1.31, 13, 1.24, 14, 1.25, 19, 1.23, 27, 1.2, 34, 1.19, 42, 1.18, 47, 1.17, 48, 1.18, 69, 1.17, 74, 1.16, 75, 1.17, 1.16]
};


// You probably want to switch this on, but read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad> first.
sIFR.useStyleCheck = true;
sIFR.activate(cochin);

sIFR.replace(cochin, {
    selector: 'h1,h4,h5'
      , css: [
        '.sIFR-root { font-weight: bold; color: #FFFFFF; }'
        , 'a { text-decoration: none; }'
        , 'a:link { color: #000000; }'
        , 'a:hover { color: #CCCCCC; }'
      ],
    wmode: 'transparent'
});

sIFR.replace(cochin, {
    selector: 'h2'
      , css: [
        '.sIFR-root { font-weight: bold; color: #FFFFFF; margin-left:10px; }'
        , 'a { text-decoration: none; }'
        , 'a:link { color: #FFFFFF; }'
        , 'a:hover { color: #FFFFFF; }'
      ],
    wmode: 'transparent'
});

sIFR.replace(cochin, {
    selector: 'h3'
      , css: [
        '.sIFR-root { font-weight: bold; color: #333333; }'
        , 'a { text-decoration: none; color: #333333;}'
        , 'a:link { color: #333333; }'
        , 'a:hover { color: #333333; }'
      ],
    wmode: 'transparent'
});

sIFR.replace(cochin, {
    selector: '.uur h5'
      , css: [
        '.sIFR-root {text-align: right; color: #333333;}'
      ]
});

sIFR.replace(cochin, {
    selector: 'h5'
      , css: 'em { font-style: normal; color: #FFFFFF;}'
      , selectable: false
});

$(function() {
    $('#pane1').jScrollPane();
    $('#logo a').mouseover( function() {$(this).css('cursor', 'pointer')} ).mouseout(function() {$(this).css('cursor', 'default')} );
});

