function NeatDialog(sHTML, sTitle, bCancel)
{
  window.neatDialog = null;
  this.elt = null;
  if (document.createElement  &&  document.getElementById)
  {
    var dg = document.createElement("div");
    dg.className = "neat-dialog";
    if (sTitle)
      sHTML = '<div class="neat-dialog-title">'+sTitle+
              ((bCancel)?
                '<img src="x.gif" alt="Cancel" class="nd-cancel" />':'')+
                '</div>\n' + sHTML;
    dg.innerHTML = sHTML;

    var dbg = document.createElement("div");
    dbg.id = "nd-bdg";
    dbg.className = "neat-dialog-bg";

    var dgc = document.createElement("div");
    dgc.className = "neat-dialog-cont";
    dgc.appendChild(dbg);
    dgc.appendChild(dg);

    //adjust positioning if body has a margin
    if (document.body.offsetLeft > 0)
      dgc.style.marginLeft = document.body.offsetLeft + "px";

    document.body.appendChild(dgc);
    if (bCancel) document.getElementById("nd-cancel").onclick = function()
    {
      window.neatDialog.close();
    };
    this.elt = dgc;
    window.neatDialog = this;
  }
}
NeatDialog.prototype.close = function()
{
  if (this.elt)
  {
    this.elt.style.display = "none";
    this.elt.parentNode.removeChild(this.elt);
  }
  window.neatDialog = null;
}

function openDialog()
  {

var sHTML = '<div class=ccc1><span class=t3><img src=images/dot3.gif width=19 height=13 align="absmiddle" />维修基金查询:</span></div><div class=ccc2><a onclick="window.neatDialog.close()" href=#><img src=images/dot4.gif width=32 height=25 border=0 /></a></div><br><br>请输入个人身份证号码:<br><input name=textfield type=text class=INPUT id=textfield /><br>请输入姓名:<br><input name=textfield2 type=text class=INPUT id=textfield2 />'+
      '<br><img src=images/seach.gif width=46 height=20 />';
    new NeatDialog(sHTML, "", false);
  
}
