ml_txt = 'Введите Ваш e-mail';
src_txt = 'Поиск по блогу';
$(document).ready(function(){
	top_scrol = function (s) {
		if ($.browser.safari) {
			$("body").animate({ scrollTop: s* -1}, 300);
		}else{
			$("html").animate({ scrollTop: s* -1}, 300);
		}
	}
	$("input[name='s']").focus(function () {
		if($(this).val() == src_txt)
			$(this).val('');
	});
	$("input[name='s']").blur(function () {
		if($(this).val() == '')
			$(this).val(src_txt);
	});
	$("input[name='email']").focus(function () {
		if($(this).val() == ml_txt)
			$(this).val('');
	});
	$("input[name='email']").blur(function () {
		if($(this).val() == '')
			$(this).val(ml_txt);
	});
	$(".cmm > strong.opn> a").click(function(){
		if ( $(this).parent().parent().is(":not(.act)") )
			$(this).parent().parent().addClass("act");
		else
			$(this).parent().parent().removeClass("act");
		return false;
	});
	$("a.rpl").click(function(){
		if ( $(".cmm").is(":not(.act)") )
			$(".cmm").addClass("act");
	});
	$(".pst li").hover(
		function () {
			$(this).addClass("hvr");
		},
		function () {
			$(this).removeClass("hvr");
		}
	);
	$("#frn li").hover(
		function () {
			$(this).addClass("hvr");
		},
		function () {
			$(this).removeClass("hvr");
		}
	);
/*	$(".mlm").click(function(){
		top_scrol($(this).offset().top);
		if($("#hdr .mlm").html() == 'Контакты'){
			if($("#t_f").html() == '&nbsp;'){
				$.ajax({
					url:"/kontakty.html",
					data: "topform",
					cache: true,
					dataType:"html",
					success:function(d){
						$("#t_f").html(d);
						$("#t_f").animate({ 'margin-top' : 0 }, 300, function(){
							$("#hdr .mlm").text('Свернуть');
						});
					}
				});
			}else{
				$("#t_f").animate({ 'margin-top' : 0 }, 300, function(){
					$("#hdr .mlm").html('Свернуть');
				});
			}
		}else{
			if ($(this).parent().parent().parent().attr("id") == 'hdr' ){
				$("#t_f").animate({ 'margin-top' : '-273px' }, 300, function(){
					$("#hdr .mlm").html('Контакты');
				});
			}
		}
		return false;
	});
*/	if($("#frn").length){
		$("#frn a").attr('target', '_blank');
	}
	if($("#flickr").length){
		$("#flickr a").attr('target', '_blank');
	}
	if($("#bnnr").length){
		$("#bnnr a").attr('target', '_blank');
	}
	if($(".flc").length){
		$(".flc a").attr('target', '_blank');
	}
	$("#umi a").attr('target', '_blank');
	$(".tp a").click(function(){
		top_scrol($(this).offset().top);
		return false;
	});
});