var xmlHttp
//first function


function setValue(cat)
{	//alert(cat);
	//document.getElementById('processing').style.display='block';
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
  
		var url="getSubValue.php";
		
		url=url+"?cat_id="+cat;
			
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		
		
	function stateChanged() 
	{ 
		if (xmlHttp.readyState==4)
		{ 
			//alert(document.getElementById('sub').innerHTML);
			//alert(xmlHttp.responseText);
			document.getElementById('sub').innerHTML=xmlHttp.responseText;	
			//alert(document.getElementById('sub').innerHTML);
			document.getElementById('processing').style.display='none';
		}
	}
} 


function showHint(cat,cake,img,new_id)
{
	//document.getElementById('processing').style.display='block';
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
  
				
		var url="getSubValue.php";
		
		url=url+"?cat_id="+cat;
		url=url+"&cake_id="+cake;
		url=url+"&img_id="+img;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		document.getElementById('processing').style.display='block';
} 
function showajax(imgpath,imgid)
{
	
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
  
				
		var url="testajax.php";
		
		url=url+"?img_path="+imgpath;
		url=url+"&imgid="+imgid;	
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
} 


//second function

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
//alert(xmlHttp.responseText);
document.getElementById('sub').innerHTML=xmlHttp.responseText;	
document.getElementById('processing').style.display='none';
}
}


//third function

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;
}// JavaScript Document// JavaScript Document