
//弹出窗体函数
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//设置在线编辑显示/屏蔽
function showHidely(e,f) {
	if (f =="show"){
	  e.style.display = '';
	}else{
	  e.style.display = 'none';
	}
}

//弹出在线编辑框
function funEditBotton(id,f,s,uid) {
  var c_flag=true;
  if (f=="d") {
    if(confirm("真要删除吗？删除后将无法恢复！")){
	  c_flag =true; 
	}
    else {
      c_flag =false; 
    }
  }
  if (c_flag) {
	  var mypop = showModalDialog ("/public/online_ly_frame.asp?c_lb="+s+"&c_flag="+f+"&auto_id="+id, "", "dialogWidth:25em; dialogHeight:15em; status:0");
	  if (mypop != null) 
	  {
		if ((uid!=null)&&(div_ctmp_right_lyinner != null)) {
		  grhyly_xml(uid,div_ctmp_right_lyinner,'0');
		}else{
		  window.location.reload();
		}
	  }
  }
}

//弹出在线编辑框，参数返回
function funEditBottonDiv(id,f,s,uid,x,sortid,parent_id) {
  var c_flag=true;
  if (f=="d") {
    if(confirm("真要删除吗？删除后将无法恢复！")){
	  c_flag =true; 
	}
    else {
      c_flag =false; 
    }
  }
  if (c_flag) {
	  var mypop = showModalDialog ("/public/online_ly_frame.asp?c_lb="+s+"&c_flag="+f+"&auto_id="+id, "", "dialogWidth:25em; dialogHeight:15em; status:0");
	  if (mypop != null) 
	  {
		switch (x) {
		  case 1:  //个人会员留言
		    if((uid!=null)&&(div_ctmp_right_lyinner != null)) {grhyly_xml(uid,div_ctmp_right_lyinner,'0');}
		    break;
		  case 2:  //个人会员评论
		    if((uid!=null)&&(div_ctmp_right_lyinner != null)) {wypl_xml(parent_id,sortid,uid,div_ctmp_right_lyinner);}
		    break;
		  default:
		    window.location.reload();
		}
	  }
  }
}

//下面是争对firefox游览器做的处理
var GetNodeValue = function(obj)
{
	var str = "";
	if(window.ActiveXObject)    //IE
	{
		str = obj.text;
	}
	else //Mozilla
	{
		try
		{
			str = obj.childNodes[0].nodeValue;
		}
		catch(ex)
		{
			str = "";
		}
	}
	return str;
}

if(document.implementation && document.implementation.createDocument)
{
	XMLDocument.prototype.loadXML = function(xmlString)
	{
		var childNodes = this.childNodes;
		for (var i = childNodes.length - 1; i >= 0; i--)
			this.removeChild(childNodes[i]);

		var dp = new DOMParser();
		var newDOM = dp.parseFromString(xmlString, "text/xml");
		var newElt = this.importNode(newDOM.documentElement, true);
		this.appendChild(newElt);
	};

	// check for XPath implementation
	if( document.implementation.hasFeature("XPath", "3.0") )
	{
	   // prototying the XMLDocument
	   XMLDocument.prototype.selectNodes = function(cXPathString, xNode)
	   {
		  if( !xNode ) { xNode = this; } 
		  var oNSResolver = this.createNSResolver(this.documentElement)
		  var aItems = this.evaluate(cXPathString, xNode, oNSResolver, 
					   XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)
		  var aResult = [];
		  for( var i = 0; i < aItems.snapshotLength; i++)
		  {
			 aResult[i] =  aItems.snapshotItem(i);
		  }
		  return aResult;
	   }

	   // prototying the Element
	   Element.prototype.selectNodes = function(cXPathString)
	   {
		  if(this.ownerDocument.selectNodes)
		  {
			 return this.ownerDocument.selectNodes(cXPathString, this);
		  }
		  else{throw "For XML Elements Only";}
	   }
	}

	// check for XPath implementation
	if( document.implementation.hasFeature("XPath", "3.0") )
	{
	   // prototying the XMLDocument
	   XMLDocument.prototype.selectSingleNode = function(cXPathString, xNode)
	   {
		  if( !xNode ) { xNode = this; } 
		  var xItems = this.selectNodes(cXPathString, xNode);
		  if( xItems.length > 0 )
		  {
			 return xItems[0];
		  }
		  else
		  {
			 return null;
		  }
	   }
	   
	   // prototying the Element
	   Element.prototype.selectSingleNode = function(cXPathString)
	   {    
		  if(this.ownerDocument.selectSingleNode)
		  {
			 return this.ownerDocument.selectSingleNode(cXPathString, this);
		  }
		  else{throw "For XML Elements Only";}
	   }
	}
}