$(document).ready(function(){    
    $('.popupContainer .popup').mouseenter(function() {
        $(this).stop(true, true).animate({borderColor: '#333333'});
    }).mouseleave(function() {
        $(this).stop(true, true).animate({borderColor: '#e9e9e9'});
    });
    
    $('#contactForm').each(function() {
        $(this).parent().addClass('slimer');
    });
    
    $('#contactForm .reset').click(function() {
        $(this).parent().parent().find('.row').removeClass('error');
        $(this).parent().parent().find('label').each(function(){
            $(this).text($(this).attr('title') + ':');
        });
        $(this).parent().parent().find('input.text, textarea').each(function(){
            $(this).val('');
            $(this).text('');
        });
        return false;
    });
    
    $("a.popup").fancybox();
    
    $("div.captcha .refresh").click(function() {
        $(this).parent().find('img').attr('src', $(this).attr('href') + '&time=' + Math.random());
        return false;
    });
});

$(window).load(function() {
    $('#topmapSlider').nivoSlider({ 
        pauseTime : 5000, 
        pauseOnHover : false,
        directionNav : false,
        controlNav : false,
        slices : 25
    });
});
