$(document).ready(function() {
$("a").focus(function(){this.blur();});
$("#error").vkfade().append("<span id='close_error' class='close_link' href='#'>Щёлкните по этому сообщению, чтобы закрыть его.</span>");
$("#error").click( function() {
$("#error_container").slideUp("fast");
})

$("a.showfull_link").html("Развернуть&nbsp;&darr;").prev("div").after("<div class=\"full\"></div>");
$("a.showfull_link").after("<img style=\"float:right;\" class=\"loading_img\" src=\"/3ngine/ajax/loader.gif\" />");
$(".loading_img").hide();
$("div.full").hide();

$("a.showfull_link").click( function(){ 
if ($(this).prev("div.full").html() == '') 
	{
	$.post("/3ngine/ajax/pages.php",
	  { newsid: $(this).prev('div').prev().attr('id'), lang: $('#lang').val() },
	  function(xml){
//		alert('div#news-id-'+$("id",xml).text());
		$('div#news-id-'+$("id",xml).text()).next("div").next("a.showfull_link").next(".loading_img").show();
		$('div#news-id-'+$("id",xml).text()).next("div").html($("story",xml).text()).animate({opacity: 'toggle',height: 'toggle'},1000,'',function(){$(this).next("a.showfull_link").html("Свернуть&nbsp;&uarr;").next(".loading_img").hide();});
	  }
);
	}
else {
	$(this).next(".loading_img").show();
		$(this).prev("div.full").animate({opacity: 'toggle',height: 'toggle'},1000,'',function(){
		if ($(this).next("a.showfull_link").is(":contains('Свернуть')")) { $(this).next("a.showfull_link").html("Развернуть&nbsp;&darr;").next(".loading_img").hide();;}
		else $(this).next("a.showfull_link").html("Свернуть&nbsp;&uarr;").next(".loading_img").hide();;
	});
				
}
return false;

}

 )

}
);