﻿$(document).ready(function(){
    $("a#link-authoriz").bind("click", function(){
		$("#box-authorization").show();
		return false;
	});

    $("#back-window").height($(document).height());

    $("#header a.feedback").bind("click", function(){
		$("div.open-window.feedback").fadeIn(300, function(){
            $("#back-window").show();
			var target_href = jQuery("#feedback_link").attr("target_href");	
			jQuery("#bubbles_content").html('<h2>Загрузка</h2>Подождите, идёт загрузка данных...');
			jQuery("#bubbles_content").load(target_href);			
		});
		return false;
	});

	$("div.open-window a.close").bind("click", function(){
		$("div.open-window.feedback").fadeOut(300, function(){
			$("#back-window").hide();
		});
		return false;
	});   
	
	$("#link-registration").bind("click", function(){
		$("div.open-window.feedback").fadeIn(300, function(){
            $("#back-window").show();
			var target_href = jQuery("#link-registration").attr("href");	
			jQuery("#bubbles_content").html('<h2>Загрузка</h2>Подождите, идёт загрузка данных...');
			jQuery("#bubbles_content").load(target_href);			
		});
		return false;
	});	

    $("#central div.box div.item ul.drop-down li").click(function(){
  	    $(this).children("div").slideToggle(300).siblings("li div:visible").slideUp(300);
  	    $(this).toggleClass("active");
        $(this).siblings("li.active").children("div").slideToggle(300);
        $(this).siblings("li").removeClass("active");
  	    return false;
    });
	
	$("#directions div.item").bind("mousemove", function(event){
        $(this).children("div").show();
        $(this).addClass("active");
        return false;
    });

    $("#directions div.item").bind("mouseleave", function(event){
        $(this).children("div").hide();
        $(this).removeClass("active");
    });

});
