﻿$(document).ready(function() {

			/* start links */
			$(".news_content").hide();
			$(".news_content").append("<div class='hide'><a href='javascript:;'>свернуть</a></div>");
			$("#news_list dt a").click(function(){if($(this).hasClass('opened')) {$(this).removeClass('opened'); $(this).parent().next().find(".news_content").slideUp().prev(".news_desc").css("color","#5C4743").find("a").css("color","#C67556");} else {$(this).addClass('opened').parent().next().find(".news_content").slideDown().prev(".news_desc").css("color","#aa928d").find("a").css("color","#c5907c");} return;});
			$(".news_content .hide a").click(function(){$(this).parent().parent().slideUp().prev(".news_desc").css("color","#5C4743").find("a").css("color","#C67556").parent().parent().find('a').removeClass('opened');});
			/* end links */
			/* table start */
			$("table.alter tr:odd").addClass("oddrow");
			/* table end */
			/* fixed branches */
			$(".link_desc").css({"min-height" : $(".link_desc").prev().find("img").attr("height") + 15 + 'px'});
			/* fixed end */
			/* start links */
			$("#links dd").hide();
			$("#links dt:first").find(".link_group").addClass("opened").parent().next("dd").show();
			$("#links .link_group").click(function(){if($(this).hasClass('opened')) {$(this).removeClass('opened'); $(this).parent().next("dd").slideUp();} else {$(this).addClass('opened').parent().next("dd").slideDown();} return;});
			/* end links */
			
			/* start scroll */
    		$(".scroll_up a").click(function(){$('html, body').animate({scrollTop:0}, 'slow'); return false;});
			/* end scroll */
			
			/* start cities */
			$("#cities dd").hide().append("<div class='hide'><a href='javascript:;'>свернуть</a></div>");
			$("#cities dd .hide a").click(function(){$(this).parent().parent().slideUp().prev().find(".link_group").removeClass('opened');});
			$("#cities dt:first").find(".link_group").addClass("opened").parent().next("dd").show();
			$("#cities .link_group").click(function(){if($(this).hasClass('opened')) {$(this).removeClass('opened'); $(this).parent().next("dd").slideUp();} else {$(this).addClass('opened').parent().next("dd").slideDown();} return;});			
			/* end cities */
			
			/* librow start */
			$("#lib_rows dt").click(function(){if($(this).hasClass('opened')) {$(this).removeClass('opened'); $(this).next().slideUp();} else {$(this).addClass('opened').next().slideDown();} return;});
			/* librow end */
			/* slider start */
			$(".slider_content").hide();
			$(".slider_content").append("<div class='hide'><a href='javascript:;'>свернуть</a></div>");
			$(".show_slider").click(function(){if($(this).hasClass('opened')) {$(this).removeClass('opened'); $(this).parent().next(".slider_content").slideUp();} else {$(this).addClass('opened').parent().next(".slider_content").slideDown();} return;});
			$(".slider_content .hide a").click(function(){$(this).parent().parent().slideUp().parent().parent().find('a').removeClass('opened');});
    		$(".scroll_up a").click(function(){$('html, body').animate({scrollTop:0}, 'slow'); return false;});			
			/* slider end */
});