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";

	sHTML = '<div id=sHTML >' + sHTML + '</div>';
	
    sHTML = '<div class="neat-dialog-title"><span id=sTitle>' + sTitle + 
	        '</span><img id="nd-cancel" src="Images/x.gif" class="nd-cancel" ' +
			((bCancel)?'style="display:;cursor:hand;"':'style="display:none;cursor:hand;"') + '/>' + 
            '</div>\n' + sHTML;

    dg.innerHTML = sHTML;
    
    var dbg = document.createElement("div");
    dbg.id = "nd-bdg";
    dbg.className = "neat-dialog-bg";
	dbg.style.width = document.body.scrollWidth+"px";
	dbg.style.height = document.body.scrollHeight+"px";


        
    var dgc = document.createElement("div");
	dgc.id = "nd-dgc";
    dgc.className = "neat-dialog-cont";
    
    dgc.appendChild(dbg);
             
    dgc.appendChild(dg);



    document.body.appendChild(dgc);
    if (bCancel) document.getElementById("nd-cancel").onclick = function()
    {
      window.neatDialog.close();
    };

	//alert(document.body.innerHTML);
    this.elt = dgc;
	dgc.focus();
	//
    window.neatDialog = this;
	//document.body.style.overflow="visible";
	if(isIe){setSelectState('hidden');}
  }
}
NeatDialog.prototype.close = function()
{
  if (this.elt)
  {
    this.elt.style.display = "none";
    this.elt.parentNode.removeChild(this.elt);
  }
  window.neatDialog = null;
  document.body.style.overflow="";
  if(isIe){setSelectState('');}
}

function openDialog(openurl,opentext) {

	var sHTML = '<iframe border="0" frameborder="0" framespacing="0" height="100%" marginheight="0" marginwidth="0" noresize scrolling="no" src="'+openurl+'" width="100%" vspale="0"></iframe>';
	new NeatDialog(sHTML, opentext, true);
}

function openDialog2(opencontent,opentext) {

	var sHTML = '<table border="0" cellspacing="5" cellpadding="5" width="100%"><tr><td align="center">'+opencontent+'</td></tr></table>';
	new NeatDialog(sHTML, opentext, true);
}

window.alert = function openDialog3(opencontent) {

	var sHTML = '<table border="0" cellspacing="0" cellpadding="15" width="100%"><tr><td align="left" height=80 style="font-size:14px;"><img src=Images/Dialogico.gif>&nbsp;'+opencontent+'</td></tr><tr><td align=right class="table_bg"><input name="button" type="button" class="btn1_mouseout" onMouseOver="this.className=\'\
btn1_mouseover\'\" onMouseOut="this.className=\'\
btn1_mouseOut\'\" value="确 定" onclick="window.neatDialog.close();" id="CancelBut"></td></tr></table>';
	new NeatDialog(sHTML, "万村网提示", true);
	document.getElementById("CancelBut").focus();
}

function openDialog4(openurl) {

	var sHTML = '<table border="0" cellspacing="0" cellpadding="15" width="100%"><form method="post" action="'+openurl+'"><tr><td align="left" height=80 style="font-size:14px;"><img src=Images/Dialogico.gif>&nbsp;您确定要删除这条信息吗？删除后不可恢复。</td></tr><tr><td align=right class="table_bg"><input name="button" type="submit" class="btn1_mouseout" onMouseOver="this.className=\'\
btn1_mouseover\'\" onMouseOut="this.className=\'\
btn1_mouseOut\'\" value="确 定" id="CancelBut"> <input name="button" type="button" class="btn1_mouseout" onMouseOver="this.className=\'\
btn1_mouseover\'\" onMouseOut="this.className=\'\
btn1_mouseOut\'\" value="取 消" onclick="window.neatDialog.close();"></td></tr></table>';
	new NeatDialog(sHTML, "万村网提示", true);
	document.getElementById("CancelBut").focus();
}


function openDialog5(openurl,opentext) {

	var sHTML = '<table border="0" cellspacing="0" cellpadding="15" width="100%"><form method="post" action="'+openurl+'"><tr><td align="left" height=80 style="font-size:14px;"><img src=Images/Dialogico.gif>&nbsp;'+opentext+'</td></tr><tr><td align=right class="table_bg"><input name="button" type="submit" class="btn1_mouseout" onMouseOver="this.className=\'\
btn1_mouseover\'\" onMouseOut="this.className=\'\
btn1_mouseOut\'\" value="确 定" id="CancelBut"> <input name="button" type="button" class="btn1_mouseout" onMouseOver="this.className=\'\
btn1_mouseover\'\" onMouseOut="this.className=\'\
btn1_mouseOut\'\" value="取 消" onclick="window.neatDialog.close();"></td></tr></table>';
	new NeatDialog(sHTML, "万村网提示", true);
	document.getElementById("CancelBut").focus();
}



var isIe=(document.all)?true:false;
//设置select的可见状态
function setSelectState(state)
{
var objl=document.getElementsByTagName('select');
for(var i=0;i<objl.length;i++)
{
objl[i].style.visibility=state;
}
}