
IE7_PNG_SUFFIX = "_t.png";

var cc = {

    /**
    * Init functions
    */
    init: function() {
    
        cc.rollovers();
        cc.emulateHover($('#nav li'));
    },

    /**
    * Rollovers buttons
    */
    rollovers: function() {
        $('.rollover').hover(function() {
            $(this).attr('src', $(this).attr('src').replace(/.gif/, '_over.gif'));
            $(this).attr('src', $(this).attr('src').replace(/.png/, '_over.png'));
        },

            function() {
                $(this).attr('src', $(this).attr('src').replace(/_over.gif/, '.gif'));
                $(this).attr('src', $(this).attr('src').replace(/_over.png/, '.png'));
            }
        );
    },

    /**
    * Preload images
    * @param {Array} images array with names of images   
    */
    preloadImages: function(images) {
        for (var i = 0; i < images.length; i++) {
            var image = new Image();
            image.src = images[i];
        }
    },

    /**
    * Emulate hover in IE6
    */
    emulateHover: function(items) {
        items.hover(
            function() {
                $(this).addClass('hover');
            },
            function() {
                $(this).removeClass('hover');
            }
        )
    }
}

$(document).ready(function() {
    cc.init();
});
