﻿// JScript File

// Ajax -coded by Dileep Paul 31/05/08

   var req = false;
   var divname;  
   try 
   {
        req = new XMLHttpRequest();
   } 
   catch (trymicrosoft)
   {
         try 
         {
            req = new ActiveXObject("Msxml2.XMLHTTP");
         }
         catch (othermicrosoft)
         {
                try 
                {
                    req = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (failed)
                {
                     req = false;
                }  
         }
   }

   if (!req)
   {
        alert("Error occured in initializing 'XMLHttpRequest', so you might not be able to enjoy full features of this page. Please try with latest browser.!");
   }
   

   function callServerDesc(url,updatePage) 
   { 
        req.open("GET", url, true);  
        req.onreadystatechange = updatePage; 
        req.send(null);
   }   

function updateDesc(divid,id)
{
document.getElementById(divid).innerHTML="Loading..";
document.getElementById(divid).style.display="block";
divname=divid;
var url="ProcessAjax.aspx?fid="+id;  
callServerDesc(url,updateDescPg)
}
function updateDescPg()
{
if (req.readyState == 4) 
{ 
var res =req.responseText;
document.getElementById(divname).innerHTML=res;
}
}