// "WSM v2.0" /MAIN JS/ (25.12.2008)

function AnswerComments(msg) { _('CommentsProgress').innerHTML = msg; }
function UpdateComments(value) { _('CommentsTotal').innerHTML = value; comments_added = 1; }
function CreateAnswer(parent)
{
	if (parent == 0)
	{
		if (comments_answer > 0)
		{
			_('commentform').innerHTML = _('commentform'+comments_answer).innerHTML;
			_('commentform'+comments_answer).innerHTML = '';
			_('commentform'+comments_answer).style.display = 'none';
		}
		if (comments_answer == 0)
		{
			_('addcomment').innerHTML=label_to_comments;
			_('commentform').style.display = 'none';
			comments_answer = -1;
		}
		else
		{
			_('addcomment').innerHTML=label_to_hide;
			_('commentform').style.display = 'block';
			comments_answer = 0;
		}
	}
	else
	{
		_('addcomment').innerHTML = label_to_comments;
		_('commentform').style.display = 'none';
		if (comments_answer == parent)
		{
			_('commentform').innerHTML = _('commentform'+parent).innerHTML;
			_('commentform'+parent).innerHTML = '';
			_('commentform'+parent).style.display = 'none';
			comments_answer = -1;
		}
		else if ((comments_answer != parent) && (comments_answer > 0))
		{
			_('commentform'+parent).innerHTML = _('commentform'+comments_answer).innerHTML;
			_('commentform'+parent).style.display = 'block';
			_('commentform'+comments_answer).innerHTML = '';
			_('commentform'+comments_answer).style.display = 'none';
			comments_answer = parent;
		}
		else
		{
			_('commentform'+parent).innerHTML = _('commentform').innerHTML;
			_('commentform'+parent).style.display = 'block';
			_('commentform').innerHTML = '';
			comments_answer = parent;
		}
	}
	_('commentid').value = (parent == -1) ? 0 : parent;
	_('commentlimit').innerHTML = '1000';
}
function SubmitComment(form) { new AJAX(form.action,{dataSend: GetFORM(form)}); }
function CaptchaComment() { Captcha('capimg','/captcha/'); }
function SetCountry(value)
{	document.cookie = 'LNG='+value+'; path=/; expires=Mon, 01-Jan-2015 00:00:00 GMT';
	window.location.reload(true);}