﻿var AJAX_Result='';

function AJAX_RequestData(pg)
{
         AJAX_myXML = new ActiveXObject('Microsoft.XMLHTTP');
         typeOfComponent = 'XMLHTTP';
         AJAX_myXML.open('POST', pg, false);
         AJAX_myXML.onreadystatechange = AJAX_CheckState;
         AJAX_myXML.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
         AJAX_myXML.send();
}

function AJAX_CheckState()
{
    var state = AJAX_myXML.readyState;
    if (state == 4)
    {
        var tmp;
        if (typeOfComponent=='XMLHTTP') 
        {
        	var x = new ActiveXObject('Microsoft.XMLDOM');
        	x.loadXML(AJAX_myXML.responseText);
        	tmp = x.documentElement;
        }
        else 
        {
        	tmp = AJAX_myXML.responseXML.documentElement;
        }
        
        try
        {
        	AJAX_ResultScript(tmp);
        }
        catch(ex)
        {
        	alert('Result function render error!');
        }
    } 
} 

function AJAX_Update(p) 
{
	pg=p;
	AJAX_RequestData()
}
         
function AJAX_ResultScript(xml)
{
	AJAX_Result=xml;
}
   
