$(document).ready(function() {	$('#preview').click(function() {		$('form#qrform').append("<input type='hidden' name='preview' value='1'>");		document.getElementById('qrform').submit();	});		$('#gosearch').click(function() {		var a = $('input[name|=query]').attr('value');		$("form#mysearch").find("input[name|=query]").attr("value", a);		document.getElementById("mysearch").submit();	});		$('#sbmt').click(function() {		var txt = $('textarea[name|=message]').attr('value').length;		if($('input[name|=username]').hasClass('username') == true) {			var usname = $('input[name|=username]').attr('value').length;		} else {			var usname = 3;		}				if(txt <= 10) {			alert("Слишком короткое сообщение!");		} else if(usname <= 2) {			alert("Слишком короткое имя!");		} else {			document.getElementById('qrform').submit();		}	});		var imfff=document.URL;	imfff=imfff.replace("http://","").replace(document.domain+"/","").split("&");	$('a[href|='+imfff[0]+']').parent("li").addClass("current");        $('a[href|='+imfff[0]+']').css("color","black");        $('a[href|='+imfff[0]+']').css("text-decoration","none");	$('.quote').click(function(){		var quote = $(this).attr("id");		var post_id = quote.split("_");		var post = $("#post_"+quote).text();		var user = $("a[name='post"+post_id[1]+"']").next().text();		var time = $("a[name='post"+post_id[1]+"']").next().next().find('i').text();		var text = $('textarea[name|=message]').val();		$('textarea[name|=message]').val(text+'[QUOTE][B]'+user+'. '+time+'[/B]'+post+'[/QUOTE]');	});		$("a.edit_post").click(function(){		var n = /[0-9]+/.exec($(this).attr("id"));		if($('#post_message_'+n).css("display") == "none"){			$('#textarea_'+n).css("display","none");			$('#post_message_'+n).css("display","block");		}else{			var post = $('#post_message_'+n).html();			$('#post_message_'+n).css("display","none");			$('#textarea_'+n).css("display","block");			$('#textarea_'+n).find('textarea').html(post);			}	});	if(window.location.hash == "#user_faild"){		$('#error_message').html("<span style='color:red;font-weight:bold;'>Ошибка!</span> Пользователь с данным именем зарегистрирован в системе.");	}		$("span.fuck_engine").find("a").removeAttr("href").css("cursor", "default");		$("tr[rel=show]").hover(		function() {			var postId = $(this).attr("class");			$(this).find("td div[rel="+postId+"]").show();			$(this).find("div.top_line").css("visibility","visible");		},		function() {			var postId = $(this).attr("class");			$(this).find("td div[rel="+postId+"]").hide();			$(this).find("div.top_line").css("visibility","hidden");		}	);	});	
