﻿var xHttp;
function showresult(extension)
{
	callpopup(extension);

}

function callpopup(ext)
{
document.getElementById("PopUp").innerHTML="";
xHttp=GetXmlHttpObject();
if (xHttp==null) 
{
alert("Your browser does not support Ajax");
return;

}

var address="Call_popup.aspx";
address=address+"?extension='0'";
xHttp.onreadystatechange=function()
{
	
  if (xHttp.readyState==4)
 	{
		
		 if (xHttp.status==200)
		 {
		    
			 document.getElementById("PopUp").innerHTML="";
			 document.getElementById("PopUp").innerHTML=xHttp.responseText;

		 document.getElementById("PopUp").style.visibility = "visible";
		 }
	    else
	    {
			 //alert("There is techincal problem while retrieving data from server");
	    }
 	 }
};


xHttp.open("GET",address,true);

xHttp.send(null); 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}

catch (e)
{

try
{
xmlHttp=new  ActiveXObject("Msxml2.XMLHTTP.3.0");

}
catch(e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
try
{
xmlHttp=new  ActiveXObject("Msxml2.XMLHTTP");

}
catch(e)
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP.3.0");
}
}}
return xmlHttp;
}


var xmlhttp; 
function loadXMLDoc(url) 
{ 
    
	if (window.XMLHttpRequest) 
  {// code for all new browsers 
    xmlhttp=new XMLHttpRequest(); 
   // xmlhttp=new ActiveXObject('Msxml2.DOMDocument.6.0');
  } 
else if (window.ActiveXObject) 
  {// code for IE5 and IE6 
      xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
  } 
	if (xmlhttp!=null) 
  { 
  //try{

  
      xmlhttp.onreadystatechange=state_Change; 
	  xmlhttp.open("GET",url,true); 
	  xmlhttp.send(null); 
     // }
     // catch(e)
      //{}
  } 
else 
  { 
      alert("Your browser does not support XMLHTTP."); 
  } 
} 
 
function state_Change() 
{ 
    if (xmlhttp.readyState==4) 
      {// 4 = "loaded" 
          if (xmlhttp.status==200) 
            {// 200 = OK 
             //xmlhttp.data and shtuff 
            // ...our code here... 
        } 
  else 
        { 
            alert("Problem retrieving data"); 
        } 
  } 
} 
