var http = createRequestObject();
function createRequestObject()
 {  
	// find the correct xmlHTTP, works with IE, FF and Opera
	var xmlhttp;
	try {
  	xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e) {
    			try {
    					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    				}
    			catch(e)
			    	{
			    		xmlhttp=null;
    				}
  			}
  if(!xmlhttp&&typeof XMLHttpRequest!="undefined") {
  	xmlhttp=new XMLHttpRequest();
  }

	return  xmlhttp;
}
 
 
 
 
function parentRequest(id,pkey,mid)
{
    document.getElementById('wait').style.display='';
	if(mid)
	{
  		var url="getparent.php?cid="+id+"&pkey=" + pkey + "&mid=" + mid;
	}
	else
	{
		var url="getparent.php?cid="+id+"&pkey=" + pkey;
	}
   /*alert(url); 
   document.getElementById('divparentInfo').innerHTML = '<a href="' +  url + '">a</a>';*/
  http.open("GET",url,true);   
  http.onreadystatechange = handleHttpResponse_state; 
  http.send(null); 
}

function handleHttpResponse_state() 
 {              
  	if (http.readyState == 4)
  	{                
    	if(http.status==200) 
		{     
	      var results=http.responseText; 
		  document.getElementById('divparentInfo').innerHTML = results;    
		  document.getElementById('wait').style.display='none';		  
		}
    }
 }
 
 
 

 