/*$(document).ready(function(){
$("span").live('click',function (e){
    $('ul[rel=' + $(e.target).attr('rel') + ']').slideToggle('slow');
    });
});*/

$(document).ready(function(){
    $("#content_repeat").css("minHeight", $("#left_catalog").css("height"));

    $(".fancyshow").fancybox({
        'opacity'		: true,
        'overlayShow'	: false,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'none'
    });
    pic = new Array(7);
    pic[0] = new Image();
    pic[1] = new Image();
    pic[2] = new Image();
    pic[3] = new Image();
    pic[4] = new Image();
    pic[5] = new Image();
    pic[6] = new Image();
    pic.src="/fancybox/fancybox.png";
    pic.src="/fancybox/fancy_shadow_n.png";
    pic.src="/fancybox/fancy_shadow_nw.png";
    pic.src="/fancybox/fancy_shadow_ne.png";
    pic.src="/fancybox/fancy_shadow_s.png";
    pic.src="/fancybox/fancy_shadow_se.png";
    pic.src="/fancybox/fancy_shadow_sw.png";
});

$(document).ready(function(){
    if ($.browser.msie && (parseInt($.browser.version) <= 6)) {
        $("body").empty();
        $.cookie("old", true);
        if ($.cookie("old")){
            alert("Вы используете очень старую версию браузера! Пожалуйста, обновите ваш браузер!");
        }
    }

    $(".show_form").fancybox({
        'titlePosition'		: 'inside',
        'transitionIn'		: 'none',
        'transitionOut'		: 'none',
        'scrolling'       : 'none',
        onComplete: function(){
            var $close_btn = $(".inline").find(".close_btn");
            if ($close_btn.length>0){
                $("#fancybox-close").css("display", "none");
            }
        }
        /*,
        onStart : function(){
            $('#submit').addClass("rc10");
            rocon.update($('#submit').target);
        }*/
    });
    $(".close_btn").click(function(){
        $("#fancybox-close").click();
    });
    $(".link-container").hover(
        function(){
            $(this).find("div.showflag").show();
        },
        function(){
            $(this).find("div.showflag").hide();
        }
    );

});

/***************** GALERY ON INDEX *****************/

function theRotator() {
	$('div.rotator ul li').css({opacity: 0.0});
	$('div.rotator ul li:first').css({opacity: 1.0});
	setInterval('rotate()',6500);
}

function rotate() {
	var current = ($('div.rotator ul li.show')?  $('div.rotator ul li.show') : $('div.rotator ul li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.rotator ul li:first') :current.next()) : $('div.rotator ul li:first'));
	// Расскомментируйте, чтобы показвать картинки в случайном порядке
	// var sibs = current.siblings();
	// var rndNum = Math.floor(Math.random() * sibs.length );
	// var next = $( sibs[ rndNum ] );
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1500);
	current.animate({opacity: 0.0}, 1500)
	.removeClass('show');
};

$(document).ready(function() {
	theRotator();
});

function theRotator2() {
	$('div.rotator2 ul li').css({opacity: 0.0});
	$('div.rotator2 ul li:first').css({opacity: 1.0});
	setInterval('rotate2()',6500);
}

function rotate2() {
	var current = ($('div.rotator2 ul li.show2')?  $('div.rotator2 ul li.show2') : $('div.rotator2 ul li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show2')) ? $('div.rotator2 ul li:first') :current.next()) : $('div.rotator2 ul li:first'));
	next.css({opacity: 0.0})
	.addClass('show2')
	.animate({opacity: 1.0}, 1500);
	current.animate({opacity: 0.0}, 1500)
	.removeClass('show2');
};

$(document).ready(function() {
	theRotator2();
});

/************************************************/


