var xmlHttp
var str_out
// alert ("str")
function parsehomecontent( str, page, lang)
{
		str_out = str;
    	xmlHttp=GetXmlHttpObject()
    	if (xmlHttp==null)
   		{
   	    	alert ("Browser does not support HTTP Request")
        	return
    	}
    	var url="/site2010/home.php";
    	url=url+"?filter="+str;
		url=url+"&page="+page;
		url=url+"&lang="+lang;
    	xmlHttp.onreadystatechange=stateChanged55
    	xmlHttp.open("GET",url,true)
    	xmlHttp.send(null)
}

function stateChanged55()
{
    if (xmlHttp.readyState==0)
	{
		if (document.getElementById("parse_the_home_content"))
		{
		document.getElementById("parse_the_home_content").innerHTML='<img src="/site2010/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("1 eloso")
	}
	else if (xmlHttp.readyState==1)
	{
		
		if (document.getElementById("parse_the_home_content"))
		{
		document.getElementById("parse_the_home_content").innerHTML='<img src="/site2010/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("2 ekloso")
	}
	else if (xmlHttp.readyState==2)
	{
		if (document.getElementById("parse_the_home_content"))
		{
		document.getElementById("parse_the_home_content").innerHTML='<img src="/site2010/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("3 heloso")
	}
	else if (xmlHttp.readyState==3)
	{
		if (document.getElementById("parse_the_home_content"))
		{
		document.getElementById("parse_the_home_content").innerHTML='<img src="/site2010/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("4 neloso")
	}
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {
		//alert('vegeztem');
		//alert(xmlHttp.responseText);
	if (document.getElementById("parse_the_home_content"))
	{
		if (str_out != "NULL")
		{
                    document.getElementById('parse_the_home_content').innerHTML = xmlHttp.responseText;
                    document.getElementById('parse_the_text').innerHTML = "";
		}
		else
		{
			
			document.getElementById('parse_the_text').innerHTML = xmlHttp.responseText;
			document.getElementById("parse_the_home_content").innerHTML="";
		}
	}
    }
}

function GetXmlHttpObject()
{
    var objXMLHttp=null
    if (window.XMLHttpRequest)
    {
        objXMLHttp=new XMLHttpRequest()
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp
}


