
function getMouseCoords(e) {
    e = e||window.event;
    alert('x: '+ e.clientX +', y: '+ e.clientY);
}

function ShowCommentForm(pcid,e)
{
 var mn, mn2;
 document.newcommentform.pcid.value=0;
 if (pcid>0) {document.newcommentform.pcid.value=pcid; }
 mn = document.getElementById('new-comment');
 mn2 = document.getElementById('adder-sit-'+pcid);
 if(mn != null)
 {
   mn.parentNode.removeChild(mn);
   mn2.appendChild(mn);
   mn.style.display = '';
 }
  return '';
}

function HideComentForm()
{
 mn = document.getElementById('new-comment');
 if(mn != null)
 {
  mn.style.display = 'none';
 }
}

function submit_comment()
{
    var errors = 0;
    var errstr = '';
    // если не авторизован проверем имя и имейл
     if (document.newcommentform.username.value=='')
     {
       errstr +=' Вы не указали свое имя.';
       errors = 1;
     }
     if (document.newcommentform.email.value=='')
     {
       errstr +=' Не указан E-mail.';
       errors = 1;
     }
     if (document.newcommentform.message.value=='')
     {
       errstr +=' Сообщение пустое.';
       errors = 1;
     }
    if (!errors)
    {
        document.newcommentform.submit();
    } else
    {
      alert(errstr);
    }
}

