<!--

function sendLink() {

	document.all.popup.style.width = document.body.scrollWidth;

	if (document.body.scrollHeight > document.body.clientHeight) {

		document.all.popup.style.height = document.body.scrollHeight;

	}

	else {

		document.all.popup.style.height = document.body.clientHeight;

	}

	document.all.popup.style.display = '';

	document.all.popup_form_bg.style.top = (document.body.clientHeight - 275) / 2 + document.body.scrollTop;
	document.all.popup_form_bg.style.left = (document.body.clientWidth - 320) / 2 + document.body.scrollLeft;
	document.all.popup_form.style.top = (document.body.clientHeight - 275) / 2 + document.body.scrollTop + 5;
	document.all.popup_form.style.left = (document.body.clientWidth - 320) / 2 + document.body.scrollLeft + 10;

	document.all.popup_form_bg.style.display = '';
	document.all.popup_form.style.display = '';

	document.all.send_link_name.focus();

}



function closePopup() {

	document.all.popup.style.display = 'none';
	document.all.popup_form_bg.style.display = 'none';
	document.all.popup_form.style.display = 'none';

}



function checkResize() {

	if (document.all.popup.style.display == '') {

		document.all.popup.style.width = document.body.scrollWidth;
		document.all.popup.style.height = document.body.scrollHeight;

	}

}



function sendLinkSubmit() {

	xmlHttp = GetXmlHttpObject();

	var postForm = 'send_link_referer=' + document.all.send_link_referer.value + '&send_link_name=' + document.all.send_link_name.value + '&send_link_friend_name=' + document.all.send_link_friend_name.value + '&send_link_friend_email=' + document.all.send_link_friend_email.value + '&send_link_comment=' + document.all.send_link_comment.value;
	xmlHttp.onreadystatechange = sendLinkAfterSubmit;
	xmlHttp.open('POST', '/rus/send_link/', true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postForm.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(postForm);

	document.all.popup_form.style.display = 'none';
	document.all.popup_form_bg.innerHTML = '<h4 style="margin: 20 0 0 20">Отправляется...</h4>';

}



function sendLinkAfterSubmit() {

	closePopup();

}



function sendMistake(event) {

	if (event.ctrlKey && event.keyCode == 13) {

		if (navigator.appName == 'Microsoft Internet Explorer') {

			var selection = document.selection.createRange();
			var selectionText = selection.text;

		}

		else {

			var selectionText = document.getSelection();

		}


		xmlHttp = GetXmlHttpObject();

		var postForm = 'content=' + selectionText + '&referer=' + document.all.send_mistake_referer.value;
		xmlHttp.open('POST', '/rus/send_mistake/', true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", postForm.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.send(postForm);
		xmlHttp.onreadystatechange = sendMistakeAfterSubmit;

	}

}



function sendMistakeAfterSubmit() {

	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {

		alert(document.all.send_mistake_post_message.value);

	}

}

//-->