function quick() {
	if ( $("#quick textarea").val() != "" ) {
		$("#quick span").html( "Отправляем..." );
		$.post("/quick.php", {
				text: $("#quick textarea").val()
			},
			function(data){
				$("#quick").html( data );
			}
		);
	}
	else {
		alert("Нам явно будет не интересно читать пустые письма");
	};
};

function settings_show() {
	$("#settings input:checkbox").each(function () {
		var id = $(this).attr('id');
		if ( $.cookie(id) == 1 )
			$("#"+id).attr({'checked':'checked'});
	});
	if ( $.cookie('start_rating') ) {
		$('#start_rating option').removeAttr('selected');
		$('#start_rating option[value='+$.cookie("start_rating")+']').attr('selected', 'selected');
	};
	if ( $.cookie('sites_on_page') ) {
		$('#sites_on_page option').removeAttr('selected');
		$('#sites_on_page option[value='+$.cookie("sites_on_page")+']').attr('selected', 'selected');
	};
	$("#settings_border").show();
};
function default_btn() {
	$("#settings input:checkbox:enabled").removeAttr('checked');
	$('#start_rating option')
		.add('#sites_on_page option').removeAttr('selected');
	$('#start_rating option[value="6"]')
		.add('#sites_on_page option[value="16"]').attr('selected', 'selected');
	$(".save_btn").focus();
};
function cancel_btn() {
	$("#settings_border").hide();
};
function save_btn() {
	$("#settings input:checkbox").each(function () {
		var id = $(this).attr('id');
		if ( $("#"+id).attr('checked') )
			$.cookie(id, '1', { expires: 720, path: '/'});
		else
			$.cookie(id, '1', { expires: -1,  path: '/'});
	});
	$.cookie('start_rating', $("#start_rating").val(), { expires: 720,  path: '/'});
	$.cookie('sites_on_page', $("#sites_on_page").val(), { expires: 720,  path: '/'});
	$('#btns').css({"color":"#0087E6"}).html("Сохраняем...");
	window.location = "/save";
};

function show_wmz() {
	$(".screenshot_s:first").css({"background-image":"url(/wp-content/themes/fancygallery/images/shadow_top.png?3)"});
	$("#n-big").add("#n-btn").add("#n-pay").fadeIn(300);
	$("#n-bn").fadeOut(300);
	$(".screenshot_s:eq(1)").animate({"opacity":"0.3"}, 300);
}
function hide_wmz() {
	$("#n-bn").fadeIn(300);
	$("#n-big").add("#n-btn").add("#n-pay").fadeOut(300);
	$(".screenshot_s:first").css({"background-image":"url(/wp-content/themes/fancygallery/images/shadow.png)"});
	$(".screenshot_s:eq(1)").animate({"opacity":"1"}, 300);
}