var working = false;
var C=function(){
	var s=document.getElementById('login_pass');
	if(s) if(s.value) clean(s);
}
setInterval(C,100);

function get_http(){
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlhttp = new
                ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlhttp = false;
            }
        }
    @else
        xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    return xmlhttp;
}

function rate(Id, Raiting){
  document.getElementById("FaqRate").innerHTML="<div style=\"padding-top:4px;\"><b>Спасибо за ответ.</b><div>";
  if(!this.http){
    this.http = get_http();
    working = false;
  }

  if (!working && this.http) {
    var http = this.http;
    url = "/faq/rate.html?id="+Id+"&raiting="+Raiting;
    this.http.open("GET", url, true);
    this.http.onreadystatechange = function() {
      if (http.readyState == 4) {
        working = false;
      }
    }
    working = true;
    this.http.send(null);
  }
}

function clean(a)
{
	var p=a.previousSibling;
	if(p)
	{
		p.style.top="-9999px";
		a.onblur=function()
		{
			if(!a.value)
			{
				p.style.top=""
			}
		};
	}
}
