$(function() {
    $('.map').maphilight({fade: false, strokeColor: '82ad06'});
});

$(document).ready(function() { 
    $('.alue').click(function(){
        //alert(this.id);
        $('#mapFinlandDefault').css({background: 'transparent url(/extension/nvkekkila/design/nvkekkila/img/map_finland_' + this.id +'.gif) no-repeat'});
        $('#growtharea').attr({value: this.id})
    });
    
    $('.plantLibraryFlowerColor').removeClass('plantLibraryFlowerColorActive');
    $('.plantLibraryFlowerColor').click(function(){
        if ($(this).hasClass('plantLibraryFlowerColorActive')) {
            $(this).removeClass('plantLibraryFlowerColorActive');
            $('#field' + this.id).attr({value: ''});
        } else {
            $(this).addClass('plantLibraryFlowerColorActive');
            $('#field' + this.id).attr({value: '1'});
        }
    });
    
    $('.plantLibraryWater').removeClass('plantLibraryWaterActive');
    $('.plantLibraryWater').click(function(){
        if ($(this).hasClass('plantLibraryWaterActive')) {
            $(this).removeClass('plantLibraryWaterActive');
            $('#field' + this.id).attr({value: ''});
        } else {
            $(this).addClass('plantLibraryWaterActive');
            $('#field' + this.id).attr({value: '1'});
        }
    });

    $('.plantLibraryLight').removeClass('plantLibraryLightActive');
    $('.plantLibraryLight').click(function(){
        if ($(this).hasClass('plantLibraryLightActive')) {
            $(this).removeClass('plantLibraryLightActive');
            $('#field' + this.id).attr({value: ''});
        } else {
            $(this).addClass('plantLibraryLightActive');
            $('#field' + this.id).attr({value: '1'});
        }
    });
    $('.explanationBox').hover(
        function(){
            $('#' + this.id + 'Box').show();
        },
        function(){
            $('#' + this.id + 'Box').hide();
        });
});
