	/***********************************************************
	*   Filename: ajax.js                                                              
	*   Purpose: make Ajax Request                                                        
	*   (c) Thakares Infotech Pvt. Ltd.                                                     
	*   Website: http://www.thakares.com                                                   
	*   e-Mail: info@thakares.com                                                           
	*   (c) Copyright by Thakares Infotech Pvt. Ltd.                                      
	*   Released under GPL. But not for commercial purpose                                 
	***********************************************************/

var XmlHttp = false;

// create an instance of XMLHTTPRequest Object, varies with browser type, try for IE first then Mozilla

	// try creating for IE (note: we don't know the user's browser type here, just attempting IE first.)
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}
	// if unable to create using IE specific code then try creating for Mozilla (FireFox) 
	if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttp = new XMLHttpRequest();
	}



function makeRequest(method, serverPage, objID) {      // Ajax server file request function 
    var obj = document.getElementById(objID);  // find Target TAG 
     obj.innerHTML = '<small>Loading..</small><img src="./thumbs/wait16trans.gif" alt="loading..." />'; 
          // Print wait text while ajax gets a response  
    XmlHttp.open(method, serverPage, true);     // make a request using method 
    XmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    
    XmlHttp.onreadystatechange = function() {
        if (XmlHttp.readyState == 4 && XmlHttp.status == 200) {   //4 - request complete, 200 - No error response OK
            obj.innerHTML = XmlHttp.responseText;  // Print to the target Tag
        }
    }
    
    XmlHttp.send(null);
} 



/****************************end of file ****************************************************/
