var xmlHttp

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


function get_more_img(img_id,pro_id)
{
img_xmlHttp=GetXmlHttpObject();
if (img_xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var img_url;
img_url="get_img.php?img_id="+img_id+"&pro_id="+pro_id;
img_xmlHttp.onreadystatechange=img_stateChanged;
img_xmlHttp.open("GET",img_url,true);
img_xmlHttp.send(null);
} 



function img_stateChanged()
{
if(img_xmlHttp.readyState==2)
{ 
document.getElementById("more_img").innerHTML=" Loading image.. ";
}
if(img_xmlHttp.readyState==3)
{ 
document.getElementById("more_img").innerHTML=" Loading image.. ";
}

if(img_xmlHttp.readyState==4)
{ 
document.getElementById("more_img").innerHTML=img_xmlHttp.responseText;
}

}



function ajax_child_ages(no_of_children)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url;
url="getchildren.php?no_of_children="+no_of_children;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 


function stateChanged() 
{ 
if(xmlHttp.readyState==3)
{ 
document.getElementById("children_ages").innerHTML="Loading...";
}

if(xmlHttp.readyState==4)
{ 
document.getElementById("children_ages").innerHTML=xmlHttp.responseText;
}
}
