$(document).ready(function() {
    if ($.browser.msie) {
        $('#navMain li').hover(function(){
            $(this).addClass('hover');
        }, function(){
            $(this).removeClass('hover');
        });
    }
    if ($('#headerpic ul').length > 0) {
        $('#headerpic ul').cycle({
            pager: '#headerpicsNav',
            pagerAnchorBuilder: function(index, DOMelement){
                a = '<a href="#"><span>' + (index + 1) + '</span></a>';
                return a;
            }
        });
    }
    if($('form').length > 0) {
        $('form select').selectreplace();
    }
    
    $('a.smoothscroll').click(function(e) {
        e.preventDefault();
        if ($($(this).attr('href')).length == 0)
            return false;
        var st = $($(this).attr('href')).offset().top;
        $('html,body').animate({ scrollTop: st }, 500);
    });
	 
	 if($('a.color').length > 0) {
		 $('a.color').colorbox({
			maxWidth: '90%',
			maxHeight: '90%'
		});
	 }
	 
	 $('a.extern').attr('target','_blank');
});
