
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
function SubmitRateArticle(i,j)
{
        var xmlHttp=GetXmlHttpObject();
        xmlHttp.onreadystatechange=function()
        {
                if (xmlHttp.readyState==4)
                {
                        alert(xmlHttp.responseText);
                }

        }
        xmlHttp.open("GET","/rate_article.php?article="+i+"&opt="+j+"&"+new Date().getHours);
        xmlHttp.send(null);
}
function CounterArticle(i,j)
{
        var xmlHttp=GetXmlHttpObject();
        xmlHttp.open("GET","/ajax_count_article.php?article="+i+"&section="+j);
        xmlHttp.send(null);
}
function DisplayFormForComment(ArticleID,ArticleCommentLocked,src,ArticleTitle)
{
        src.style.display="none";
        if(ArticleCommentLocked)
        {
                alert('Sorry! Comment for this article is closed!');
                return false;
        }
        else if(document.getElementById("DivSubmitComment"))
        {
                var xmlHttp=GetXmlHttpObject();
                xmlHttp.onreadystatechange=function()
                {
                        if (xmlHttp.readyState==4)
                        {
                                document.getElementById("DivSubmitComment").innerHTML=xmlHttp.responseText;
                        }
                }
                xmlHttp.open("GET","/ajax_form_comment.php?article="+ArticleID+'&title='+ArticleTitle);
                xmlHttp.send(null);
        }
}
function SubmitCommentNoLogin(ArticleID)
{
        if(document.getElementById("CommentUserName").value.length<3)
        {
                alert("Please enter your name!");
                document.getElementById("CommentUserName").focus();
                return false;
        }
        else if(document.getElementById("CommentUserEmail").value.length<8)
        {
                alert("Please enter your valid email!");
                document.getElementById("CommentUserEmail").focus();
                return false;
        }
        else if(document.getElementById("CommentContent").value.length<20)
        {
                alert("The content is too short! MIN: 20 characters length.");
                document.getElementById("CommentContent").focus();
                return false;
        }
        else if(document.getElementById("SecurityWord").value.length<2)
        {
                alert("Please enter valid security word!");
                document.getElementById("SecurityWord").focus();
                return false;
        }
        else
        {
                var xmlHttp=GetXmlHttpObject();
                xmlHttp.onreadystatechange=function()
                {
                        if (xmlHttp.readyState==4)
                        {
                                document.getElementById("DivSubmitComment").innerHTML=xmlHttp.responseText;
                        }
                }
                if (xmlHttp.overrideMimeType) { xmlHttp.overrideMimeType('text/html');}
                var parameters='CommentUserName='+encodeURIComponent(document.getElementById("CommentUserName").value)+'&CommentUserEmail='+encodeURIComponent(document.getElementById("CommentUserEmail").value)+'&CommentUserWebsite='+encodeURIComponent(document.getElementById("CommentUserWebsite").value)+'&CommentTitle='+encodeURIComponent(document.getElementById("CommentTitle").value)+'&CommentContent='+encodeURIComponent(document.getElementById("CommentContent").value)+'&SecurityWord='+encodeURIComponent(document.getElementById("SecurityWord").value);
                xmlHttp.open("POST","/ajax_submit_comment.php?article="+ArticleID,true);
                xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                xmlHttp.setRequestHeader("Content-length", parameters.length);
                xmlHttp.setRequestHeader("Connection", "close");
                xmlHttp.send(parameters);
        }
}
function SubmitCommentLogin(ArticleID)
{
        if(document.getElementById("CommentContent").value.length<20)
        {
                alert("The content is too short! MIN: 20 characters length.");
                document.getElementById("CommentContent").focus();
                return false;
        }
        else
        {
                var xmlHttp=GetXmlHttpObject();
                xmlHttp.onreadystatechange=function()
                {
                        if (xmlHttp.readyState==4)
                        {
                                document.getElementById("DivSubmitComment").innerHTML=xmlHttp.responseText;
                        }
                }
                if (xmlHttp.overrideMimeType) { xmlHttp.overrideMimeType('text/html');}
                var parameters='CommentTitle='+encodeURIComponent(document.getElementById("CommentTitle").value)+'&CommentContent='+encodeURIComponent(document.getElementById("CommentContent").value);
                xmlHttp.open("POST","/ajax_submit_comment.php?article="+ArticleID,true);
                xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                xmlHttp.setRequestHeader("Content-length", parameters.length);
                xmlHttp.setRequestHeader("Connection", "close");
                xmlHttp.send(parameters);
        }
}
function FRKSIALSD()
{
}
function FRKSIALSD_BK()
{
        var xmlHttp=GetXmlHttpObject();
        xmlHttp.onreadystatechange=function()
        {
                if (xmlHttp.readyState==4)
                {
                        FRKSFSSAEAIALSD();
                }

        }
        xmlHttp.open("GET","/ajax_fetch_rss.php");
        xmlHttp.send(null);

}
function FRKSFSSAEAIALSD()
{
        var xmlHttp=GetXmlHttpObject();
        xmlHttp.open("GET","/ajax_fetch_content.php");
        xmlHttp.send(null);
}