function stateChangedQuestion()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	document.getElementById("hantar").innerHTML=xmlHTML=xmlHttp.responseText
	}
}

function stateChangedTopPhoto()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	document.getElementById("header").innerHTML=xmlHTML=xmlHttp.responseText
	}
}

function stateChangedMiddlePhoto()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	document.getElementById("middlephoto").innerHTML=xmlHTML=xmlHttp.responseText
	}
}

function stateChangedRightPhoto()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	document.getElementById("rightphoto").innerHTML=xmlHTML=xmlHttp.responseText
	}
}

function stateChangedCatDescription()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	document.getElementById("introBlock").innerHTML=xmlHTML=xmlHttp.responseText
	}
}


function topphoto(hm_id)
{
	var d = new Date();
	var randomnumber=Math.floor(Math.random()*101)+d.getTime();
	xmlHttp = GetXmlHttpObject();
	var url = "top_photo.php";
	url=url+"?hm_id="+hm_id+"&random="+randomnumber;
	xmlHttp.onreadystatechange=stateChangedTopPhoto
	xmlHttp.open( "GET", url, true ); 
   	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
   	xmlHttp.send(null);
}

function middlephoto(hm_id)
{
	var d = new Date();
	var randomnumber=Math.floor(Math.random()*101)+d.getTime();
	xmlHttp = GetXmlHttpObject();
	var url = "middle_photo.php";
	url=url+"?hm_id="+hm_id+"&random="+randomnumber;
	xmlHttp.onreadystatechange=stateChangedMiddlePhoto
	xmlHttp.open( "GET", url, true ); 
   	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
   	xmlHttp.send(null);
}

function rightphoto(hm_id)
{
	var d = new Date();
	var randomnumber=Math.floor(Math.random()*101)+d.getTime();
	xmlHttp = GetXmlHttpObject();
	var url = "right_photo.php";
	url=url+"?hm_id="+hm_id+"&random="+randomnumber;
	xmlHttp.onreadystatechange=stateChangedRightPhoto
	xmlHttp.open( "GET", url, true ); 
   	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
   	xmlHttp.send(null);
}

function hminfo(cat_id)
{
	var d = new Date();
	var randomnumber=Math.floor(Math.random()*101)+d.getTime();
	xmlHttp = GetXmlHttpObject();
	var url = "cat_description.php";
	url=url+"?cat_id="+cat_id+"&random="+randomnumber;
	xmlHttp.onreadystatechange=stateChangedCatDescription
	xmlHttp.open( "GET", url, true ); 
   	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
   	xmlHttp.send(null);
}


function sendquestion()
{
	alert(document.getElementById("name").value)
	var poststr = "name=" + encodeURI( document.getElementById("name").value ) +
                  "&email=" + encodeURI( document.getElementById("email").value ) + 
				  "&question=" + encodeURI( document.getElementById("question").value ) + 
				  "&no=" + encodeURI( document.getElementById("no").value );
				  
	var d = new Date();
	var randomnumber=Math.floor(Math.random()*101)+d.getTime();
	xmlHttp = GetXmlHttpObject();
	var url = "sendquestion.php";
	url=url+"?s=1&random="+randomnumber;
	http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);

}

function get(obj) {
      var poststr = "mytextarea1=" + encodeURI( document.getElementById("mytextarea1").value ) +
                    "&mytextarea2=" + encodeURI( document.getElementById("mytextarea2").value );
      makePOSTRequest('post.php', poststr);
   }

