﻿////////////////////////////// ADD ":" TO LABELS /////////////////////////////////////////////////////// by johan
$(document).ready(function() {
    $("label").append(":");
});


////////////////////////////// FADE /////////////////////////////////////////////////////// by johan

$(document).ready(function() {
    $('a.logo').hover(
		function() { $(this).fadeTo('fast', 0.8); },
		function() { $(this).fadeTo('fast', 1); }
	);
});


////////////////////////////// HOME FEATURE ACCORDION //////////////////////////////////// by johan (requires hoverIntent or replace ".hoverIntent" with ".hover")

$(document).ready(function() {
    $('.pic-1').delay(200).slideUp('slow'),
    $('.pic-2').delay(400).slideUp('slow'),
    $('.pic-3').delay(600).slideUp('slow'),
    $('.pic-4').delay(800).slideUp('slow'),

    $('.btn-1').hoverIntent(
        function() { $('.pic-1').slideDown('fast'); },
        function() { $('.pic-1').delay(300).slideUp(); }
    );

    $('.btn-2').hoverIntent(
        function() { $('.pic-2').slideDown('fast'); },
        function() { $('.pic-2').delay(300).slideUp(); }
    );

    $('.btn-3').hoverIntent(
        function() { $('.pic-3').slideDown('fast'); },
        function() { $('.pic-3').delay(300).slideUp(); }
    );

    $('.btn-4').hoverIntent(
        function() { $('.pic-4').slideDown('fast'); },
        function() { $('.pic-4').delay(300).slideUp(); }
    );
});

////////////////////////////// HOME NEWS IMAGES //////////////////////////////////// by johan
function showHomeNewsImage(index) {
    for (i = 1; i <= 10; i++) {
        if (i == index)
            $('#home-boxes .news-image-' + i).show();
        else
            $('#home-boxes .news-image-' + i).hide();
    }
    return false;
}

$(document).ready(function() {
    showHomeNewsImage(1);
    $('#home-boxes .news-item-1').hover(function() { showHomeNewsImage(1); });
    $('#home-boxes .news-item-2').hover(function() { showHomeNewsImage(2); });
    $('#home-boxes .news-item-3').hover(function() { showHomeNewsImage(3); });
    $('#home-boxes .news-item-4').hover(function() { showHomeNewsImage(4); });
    $('#home-boxes .news-item-5').hover(function() { showHomeNewsImage(5); });
    $('#home-boxes .news-item-6').hover(function() { showHomeNewsImage(6); });
    $('#home-boxes .news-item-7').hover(function() { showHomeNewsImage(7); });
    $('#home-boxes .news-item-8').hover(function() { showHomeNewsImage(8); });
    $('#home-boxes .news-item-9').hover(function() { showHomeNewsImage(9); });
    $('#home-boxes .news-item-10').hover(function() { showHomeNewsImage(10); });
});

////////////////////////////// TABLE ROW COLOURS ////////////////////////////////////  by johan

$(document).ready(function() {
    $('table tr:odd').addClass('odd');
    $('table tr:even').addClass('even');
});
