// JavaScript Document
var ajax='';
function requestAjax(url,parameter,method,callfunc)
{
    if (window.ActiveXObject)
    {
        ajax = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest)
    {
        ajax = new XMLHttpRequest();
    }
    else
    {
        return false;
    }

    if (method == 'GET' || method == 'get')
    {
        url = url + "?" + parameter;
     ajax.open("GET", url, true);
     ajax.send(null);
        ajax.onreadystatechange = function () {
            if(ajax.readyState == 4)
            {
                if(ajax.status == 200)
                {
                    callfunc();
                }
            }    
        };
    }
    else if (method == 'POST' || method == 'post')
    {
     ajax.open("POST", url, true);
        ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
     ajax.send(parameter);
        ajax.onreadystatechange = function () {
            if(ajax.readyState == 4)
            {
                if(ajax.status == 200)
                {
                    callfunc();
                }
            }    
        };
    }
}
