$('.current').corner();

function fontSize() {
  var width = 1002; // ширина, от которой идет отсчет
  var fontSize = 16; // минимальный размер шрифта
  var bodyWidth = $('html').width();
  var multiplier = bodyWidth / width;
  if ($('html').width() >= width) fontSize = Math.floor(fontSize * multiplier);
  $("p.sl").css({fontSize: fontSize+'px'});
}
$(function() { fontSize(); });
$(window).resize(function() { fontSize(); });


$(document).ready(function(){
    $('.sh').hover(
        function() {
            
            $(this).find('ul').stop(true, true);
            $(this).find('ul').fadeIn('slow');
        },
        function() {            
            $(this).find('ul').fadeOut('fast'); 
        }
    );    
});
//---------------------------------------------------------
$(document).ready(function(){

$('div.item1').Zoomer({speedView:200,speedRemove:400,altAnim:true,speedTitle:400,debug:false});
$('div.item2').Zoomer({speedView:200,speedRemove:400,altAnim:true,speedTitle:400,debug:false});
$('div.item3').Zoomer({speedView:200,speedRemove:400,altAnim:true,speedTitle:400,debug:false});


    $('.clk1').click(
        function() {
			$("div.info1").fadeIn('slow');
			$("div.info2").fadeOut('slow');
			$("div.info3").fadeOut('slow');
			$("div.info4").fadeOut('slow');
			$("div.info5").fadeOut('slow');
			$("div.info6").fadeOut('slow');
        }
        
    );    
	$('.clk2').click(
        function() {
			$("div.info2").fadeIn('slow');
			$("div.info1").fadeOut('slow');
			$("div.info3").fadeOut('slow');
			$("div.info4").fadeOut('slow');
			$("div.info5").fadeOut('slow');
			$("div.info6").fadeOut('slow');
        }    ); 
	$('.clk3').click(
        function() {
			$("div.info3").fadeIn('slow');
			$("div.info1").fadeOut('slow');
			$("div.info2").fadeOut('slow');
			$("div.info4").fadeOut('slow');
			$("div.info5").fadeOut('slow');
			$("div.info6").fadeOut('slow');
        }    );
	$('.clk4').click(
        function() {
			$("div.info4").fadeIn('slow');
			$("div.info1").fadeOut('slow');
			$("div.info2").fadeOut('slow');
			$("div.info3").fadeOut('slow');
			$("div.info5").fadeOut('slow');
			$("div.info6").fadeOut('slow');
        }    );
	$('.clk5').click(
        function() {
			$("div.info5").fadeIn('slow');
			$("div.info1").fadeOut('slow');
			$("div.info2").fadeOut('slow');
			$("div.info3").fadeOut('slow');
			$("div.info4").fadeOut('slow');
			$("div.info6").fadeOut('slow');
        }    );
	$('.clk6').click(
        function() {
			$("div.info6").fadeIn('slow');
			$("div.info1").fadeOut('slow');
			$("div.info2").fadeOut('slow');
			$("div.info3").fadeOut('slow');
			$("div.info5").fadeOut('slow');
			$("div.info4").fadeOut('slow');
        }    );
});


//-----------
 function setEqualHeight(columns)
{
var tallestcolumn = 0;
columns.each(
function()
{
currentHeight = $(this).height();
if(currentHeight > tallestcolumn)
{
tallestcolumn = currentHeight;
}
}
);
columns.height(tallestcolumn);
}
$(document).ready(function() {
setEqualHeight($("#page > div"));
});

//------------------------

function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

