$(document).ready(function(){
	$("#titles").append("<button id='ask'> </button>");
	var iserror = $("#iserror");
	if(iserror.html()){
		$("body").prepend("<div id='rising'> </div>");
		$("#rising").css("height",getyScroll()+"px");
		$("#forms").addClass("js").fadeIn("100").find("textarea").val("");
	} else {
		clicked();
	}
});

function clicked(){
	$("#forms").css("display","none");
	$("#ask").click(function(){
		$("body").prepend("<div id='rising'> </div>");
		$("#rising").css("height",getyScroll()+"px");
		$("#forms").addClass("js").fadeIn("100").find("textarea").val("");
	});
}

/* special thanx to habrahabr js-coder */
function getyScroll(){yScroll = 0;if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX){yScroll = window.innerHeight + window.scrollMaxY;xScroll = window.innerWidth + window.scrollMaxX;var deff = document.documentElement;var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;xScroll -= (window.innerWidth - wff);yScroll -= (window.innerHeight - hff);} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){yScroll = document.body.scrollHeight;xScroll = document.body.scrollWidth;}else{yScroll = document.body.offsetHeight;xScroll = document.body.offsetWidth;}return yScroll;}
