/*//////////////////////////////////////////////////////////////////
 * Script For Artworld Program
 * Script For Xmldom,Xmlhttp & Ajax;
 * Version: 1.0
 * Copyright (C) 2001 - 2005 Artworld.cn
 *
 * For further information visit:
 * 		http://Artworld.cn/
 * 		http://www.artistsky.net/
 *
 * Builder: Sunwin
 * Created: 2006-12-10
//*/////////////////////////////////////////////////////////////////*/

function GetXMLDOM() {
  var xmlDoc=null;
	try{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	} catch(e) {
		try
		{
			 xmlDoc = document.implementation.createDocument("","",null);
		} catch(ex) {
			 var xmlDoc=null;
		}
	
	}
  return xmlDoc; 
}

function GetXMLHTTP() 
{ 
	var xmlhttp=null;
	try 
	{ 
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	} catch(e) { 
		try 
		{ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} catch(ex) { 
			xmlhttp=null;	
		} 
	} 
	if ( !xmlhttp && typeof XMLHttpRequest != "undefined" ) 
	{ 
		xmlhttp=new XMLHttpRequest(); 
	}
	return xmlhttp; 
}

//将字串XML对象化
function parseXML(st){
	var result;
    if(Artobj.IsIE){
        result = GetXMLDOM();
        result.loadXML(st);
    }else{
        var parser = new DOMParser();
        result = parser.parseFromString(st, "text/xml");
    }
    return result;
}
//将XML对象字符串化
function XMLToStr(xml){
	if(Artobj.IsIE){
		return xml.xml;
	}
	else{
		var xmls = new XMLSerializer(); 
		var s = xmls.serializeToString(xml);
		return s;
	}
}

function GetAjax(sUrl,ObjID){
	var HttpObj = GetXMLHTTP();
	HttpObj.open("GET",sUrl,false);
	HttpObj.send(null);
	try{
		var o=HttpObj.responseText;
		return o;
	}
	catch(e){
		return "";
	}
}

function PostAjax(sUrl,para) {
	var HttpObj = GetXMLHTTP();
	HttpObj.open("POST",sUrl,false);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	HttpObj.send(para);
	try{
		var o=HttpObj.responseText;
		return o;
	} 
	catch(e){
		return "";
	}
}
