jQuery(document).ready(function(){
   var cookier = -1;
    var actr = cookier ? cookier : 0;
   var cookiel = -1;
    var actl = cookiel ? cookiel : 0;
jQuery(".text02 .linked").css('display','none');
//    jQuery(".text02 a:eq("+actr+")").addClass("active");
//    jQuery(".text02 div:eq("+actr+")").show();

    jQuery(".text02 a").click(function(){
        var index = jQuery(".text02 a").index(this);

        jQuery(this).next("div").slideToggle("fast")
        .siblings("div:visible").slideUp("fast");
        jQuery(this).toggleClass("active");
        jQuery(this).siblings("a").removeClass("active");

    });
    jQuery(".maps").click(function(){
	var id = jQuery(this).attr('id');
	$("."+id).slideToggle("fast");
    });

});
$(function () {
$('.top').each(function () {

var distance = 0;
var time = 250;

var beingShown = false;
var shown = false;

var signin = $('.signin', this);
var close = $('.close', this);
var popup = $('.popup', this);//.css('opacity', 0);

$([close.get(0)]).click(function () {
popup.animate({
top: '-=' + distance + 'px',
opacity: 0
}, time, 'swing', function () {
//отслеживаем переменные
shown = false;
popup.css('display', 'none');
});
});
//наводим на элемент
$([signin.get(0), popup.get(0)]).click(function () {
// показывать элемент
// не вызывают анимации снова, если уже виден
if (beingShown || shown) {
return;
} else {
beingShown = true;

// сбросить позиции всплывающее окно
popup.css({
bottom: 0,
right: 0,
display: 'block' // Приносит всплывающих назад, чтобы посмотреть
})

// (we're using chaining on the popup) now animate it's opacity and position
.animate({
top: '-=' + distance + 'px',
opacity: 1
}, time, 'swing', function() {
// once the animation is complete, set the tracker variables
beingShown = false;
shown = true;
});
}
});
});
});
