$(document).ready(function(){
						//ie detected!   
						if($.browser.msie && $.browser.version<7)
						$('#in_process').before(
							'<div id="ie6detect">'+
							'<strong>Внимание! Вы используете Internet Explorer шестой или более ранней версии!</strong><br />'+
							'К сожалению, Ваш браузер безнадёжно устарел и не может корректно воспроизводить содержимое данного сайта.'+
							'Мы рекомендуем Вам обновить браузер до последней версии или выбрать один из <a href="http://web-bricks.ru/browsers.html">СЛЕДУЮЩИХ</a>.'+
							'</div>'
						);
						
						//slide panel
						$(".btn-slide").click(function(){
							$("#slide-panel").slideToggle("slow");
							$(this).toggleClass("active_login");
						});
						
						//drop down
						$("ul.subnav").parent().append("<span></span>");						
						$("ul.topnav li span").hover(function() { 
							$(this).parent().find("ul.subnav").slideDown('fast').show(); 
							$(this).parent().hover(function() {
							}, function(){	
								$(this).parent().find("ul.subnav").slideUp('slow'); 
							});
							}).hover(function() { 
								$(this).addClass("subhover");
							}, function(){
								$(this).removeClass("subhover");
						});
						
						//click
						$("ul.links_panel li.line").click(function(){
							window.location=$(this).find("a").attr("href"); return false;
						});
						
						//grayscale effect
						$("#twitter, #rss").hover(function() {
						var thumbOver = $(this).find("img").attr("src");
						$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
						$(this).find("span").stop().fadeTo('normal', 0 , function() {
							$(this).hide()
						}); 
						} , function() {
						$(this).find("span").stop().fadeTo('normal', 1).show();
						});
						
						//tips
						$("#twitter a, #rss a").hover(function() {
							$(this).next(".tip").animate({opacity: "show", top: "-75"}, "slow");
						}, function() {
							$(this).next(".tip").animate({opacity: "hide", top: "-85"}, "fast");
						});
												
						//hide block
						$("img.close").click(function(){
        				$(this).parents("#in_process").animate({ opacity: "hide" }, "slow");
    					});
						
						// scroll
						$(".scroll").click(function(event){
						//prevent the default action for the click event
						event.preventDefault();						
						//get the full url - like mysitecom/index.htm#home
						var full_url = this.href;						
						//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
						var parts = full_url.split("#");
						var trgt = parts[1];						
						//get the top offset of the target anchor
						var target_offset = $("#"+trgt).offset();
						var target_top = target_offset.top;						
						//goto that anchor by setting the body scroll top to anchor top
						$('html, body').animate({scrollTop:target_top}, 1500);
						});
						$(".gototop").click(function(event){
						event.preventDefault();						
						//get the full url - like mysitecom/index.htm#home
						var full_url = this.href;						
						//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
						var parts = full_url.split("#");
						var trgt = parts[1];						
						//get the top offset of the target anchor
						var target_offset = $("#"+trgt).offset();
						var target_top = target_offset.top;						
						//goto that anchor by setting the body scroll top to anchor top
						$('html, body').animate({"opacity": "hide"}, "fast")
									   .animate({scrollTop:target_top}, 1)
									   .animate({"opacity": "show"}, "normal");
						});
						
						// quote
						var comment_area = '.comment' // класс родительского блока комментария
						var commenter_info   = '.commenter'; // класс блока, содержащего инфо об авторе комментария
						var commenter_name   = '.commenter_name'; // класс блока с именем автора комментария
						var comment_date   = '.comment_date'; // класс блока с датой комментария
						var comment_text   = '.comment_text'; // класс блока с текстом комментария
						var quote_link_class   = '.quote'; // класс триггера для вставки цитаты
						var textarea_id  = '#comment'; // id элемента textarea, в который помещаем цитату
						
						$(quote_link_class).click(function () {
							var qAuthor = $(this).parent(comment_area).find(commenter_name).text();
							var qDate = $(this).parent(comment_area).find(comment_date).text();
							var qComment = $(this).parent(comment_area).children(comment_text).text();
							var exText = $(textarea_id).val();
							$(textarea_id).val(exText + '[quote]\r\n[b]' + qAuthor + '[/b] в ' + qDate + '\r\n' + qComment + '[/quote]\r\n');
							var target_offset = $("#add_comment").offset();
							var scroll_to = target_offset.top;
							$('html, body').animate({scrollTop:scroll_to}, 50);
							$(textarea_id).focus();
							return false;
						});

});
