﻿function $id(id) { return document.getElementById(id);}

var xmlHttp

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 addPostParam(sParam, sParamName,sParamValue)
{
    if (sParam.length > 0) { 
        sParam += "&"; 
    }
    return sParam + encodeURIComponent(sParamName)+"="+encodeURIComponent(sParamValue);
}

/* 此函数将被放弃，由 CFH.js 中 function ShowJSONMsg(msg) 函数代替 */
function ShowMsg(cData)
{
    var data=eval("("+cData+")");
    if (data.STATUS=="OK")
    {
        alert(data.INFO);
        return true;
    }
    if (data.STATUS=="ERROR")
    {
        alert(data.INFO+"  错误原因:"+data.DEBUG);
        return false;
    }
    alert("发生未知的意外错误！");
    return false;
}

