/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var xmlHttp2
var str_out
// alert ("str")
function calculatePrice( price, totalprice, lang)
{
	/*alert (str);
	alert(page);
	alert(menu);*/
        //alert(price);
        //alert(lang);
    	xmlHttp2=GetXmlHttpObject()
    	if (xmlHttp2==null)
   		{
   	    	alert ("Browser does not support HTTP Request")
        	return
    	}
    	var url="/site2010/calculate_price.php";
    	url=url+"?filter="+price;
        url=url+"&tprice="+totalprice;
        url=url+"&lang="+lang;
		//alert(url);
    	xmlHttp2.onreadystatechange=stateChanged59
    	xmlHttp2.open("GET",url,true)
    	xmlHttp2.send(null)
}

function stateChanged59()
{
    if (xmlHttp2.readyState==0)
	{
		if (document.getElementById("parse_the_home_content"))
		{
		document.getElementById("parse_the_home_content").innerHTML='<img src="/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("1 eloso")
	}
	else if (xmlHttp2.readyState==1)
	{

		if (document.getElementById("parse_the_price_content"))
		{
		document.getElementById("parse_the_price_content").innerHTML='<img src="/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("2 ekloso")
	}
	else if (xmlHttp2.readyState==2)
	{
		if (document.getElementById("parse_the_price_content"))
		{
		document.getElementById("parse_the_price_content").innerHTML='<img src="/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("3 heloso")
	}
	else if (xmlHttp2.readyState==3)
	{
		if (document.getElementById("parse_the_price_content"))
		{
		document.getElementById("parse_the_price_content").innerHTML='<img src="/images/ajax-loader.gif" alt="loader" >';
		}
		//alert("4 neloso")
	}
    if (xmlHttp2.readyState==4 || xmlHttp.readyState=="complete")
    {
		//alert('vegeztem');
		//alert(xmlHttp.responseText);
	if (document.getElementById("parse_the_price_content"))
	{
            document.getElementById("parse_the_price_content").innerHTML = xmlHttp2.responseText;
	}
    }
}

function GetXmlHttpObject()
{
    var objXMLHttp=null
    if (window.XMLHttpRequest)
    {
        objXMLHttp=new XMLHttpRequest()
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp
}
