function update_product(current_value)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",'Get_product_detail-'+current_value+'.php',true);
	xmlHttp.send(null);
	//request.open('get', 'Get_categories-'+current_value.options[current_value.selectedIndex].value+'.php');
}

	
function update_ecard(current_value)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	xmlHttp.onreadystatechange=stateChanged2;
	xmlHttp.open("GET",'Get_ecard_detail-'+current_value+'.php',true);
	xmlHttp.send(null);
	document.getElementById('div_ecardid').innerHTML = '<input type="hidden"  name="ecardid" value="'+current_value+'"  >';
	//request.open('get', 'Get_categories-'+current_value.options[current_value.selectedIndex].value+'.php');
}
		
function stateChanged() 
{ 
	if(xmlHttp.readyState == 1)
	{
		//alert(div_to_use);
		document.getElementById('detailproduct').innerHTML = 'Loading...';
	}
	if(xmlHttp.readyState == 4)
	{
		var answer = xmlHttp.responseText;
		document.getElementById('detailproduct').innerHTML = answer;
		//alert(answer);
	}	
}

function stateChanged2() 
{ 
	if(xmlHttp.readyState == 1)
	{
		//alert(div_to_use);
		document.getElementById('image_ecard').innerHTML = 'Loading...';
	}
	if(xmlHttp.readyState == 4)
	{
		var answer = xmlHttp.responseText;
		document.getElementById('image_ecard').innerHTML = answer;
		//alert(answer);
	}	
}

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;
}
