
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

function getajaxsyn(mds,qstring,fnc)
{

var x=GetXmlHttpObject()
if (x==null) {return;}
x.onreadystatechange=function()
{
if (x.readyState == 4)
{
fnc(decodeURIComponent(x.responseText))
}

}
x.open("GET",mds+"?"+qstring,false);
x.send(null);
}

/*function getajaxsyn(mds,qstring,fnc)
{

qstring=encodeURIComponent(qstring);

//alert(qsrting);
var x=GetXmlHttpObject()
if (x==null) {return;}
var qs="";
if (qstring.length>0){qs='?'};
x.open("GET",mds+qs+qstring,false);
x.send(null);
fnc(decodeURIComponent(x.responseText))
/*if (w_browser=="FireFox")
{
var i=0
while((x.readyState != 4) ) {
            i++;
//            alert(i);
            
        } 
}

}
*/

function getajax(mds,qstring,fnc)
{

//qstring=encodeURIComponent(qstring);
//alert(qsrting);
var x=GetXmlHttpObject()
if (x==null) {return;}
x.onreadystatechange=function()
{
if (x.readyState == 4)
{
fnc(decodeURIComponent(x.responseText))
}

}
x.open("GET",mds+"?"+qstring,true);
x.send(null);
}


function postajax(mds,qstring,fnc)
{
var POSTDATA=qstring;
var POST_LENGTH=qstring.length;
var x=GetXmlHttpObject()
if (x==null) {return;}
x.onreadystatechange=function()
{

if (x.readyState == 4)
{
fnc(decodeURIComponent(x.responseText))
}
}
x.open('POST', mds, true);
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
x.setRequestHeader("Connection", "close");
x.setRequestHeader("Content-length", POST_LENGTH);
x.send(POSTDATA);
}

function postajaxsyn(mds,qstring,fnc)
{
var POSTDATA=qstring;
var POST_LENGTH=qstring.length;
var x=GetXmlHttpObject()
if (x==null) {return;}
x.onreadystatechange=function()
{

if (x.readyState == 4)
{
fnc(decodeURIComponent(x.responseText))
}
}
x.open('POST', mds, false);
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
x.setRequestHeader("Connection", "close");
x.setRequestHeader("Content-length", POST_LENGTH);
x.send(POSTDATA);
}



