function loadPage(fileName, targetID, path, loadingDisplay)
{
	if(loadingDisplay == undefined)
		loadingDisplay = 0;
		
	var http_request = false;
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) 
		{
			// set type accordingly to anticipated content type
			//http_request.overrideMimeType('text/xml');
			http_request.overrideMimeType('text/html');
		}
	} 
	else if (window.ActiveXObject) 
	{ // IE
		try 
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				 http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) 
			{}
		}
	}
	if (!http_request) 
	{
		document.getElementById(targetID).innerHTML = "Cannot create XMLHTTP instance";
		return false;
	}
	dateTime = new Date();
	url = path+fileName;
	http_request.open("GET", url+"?"+dateTime.getTime(), true);
	if(loadingDisplay == 1)
	document.getElementById(targetID).innerHTML = "<img src='Images/loading.gif'>&nbsp;&nbsp;&nbsp;载入中....";
	http_request.onreadystatechange = function () 
	{
		if (http_request.readyState == 4) 
		{
			if(http_request.status == 200) 
			{
				//Cannot load frame page in table
				document.getElementById(targetID).innerHTML = http_request.responseText;
			} 
			else 
			{
				document.getElementById(targetID).innerHTML = 'ERROR Loading. Please refresh the page';
				//fileName+' Get Fail '+http_request.status;
			}
		}
		else
		{
		
		}
	}
	http_request.send(null);
}
	
function submitPost(fileName, targetID, path, resource, type, loadingDisplay, position, refrs)
{
	if(loadingDisplay == undefined)
		loadingDisplay = 0;
	if(position == undefined)
		position = 0;
	if(refrs == undefined)
		refrs = 0;
		
	fileNameList = (fileName).split("!");
	targetIDList = (targetID).split("!");

	inputList = (resource).split("!");
	var poststr = "";
	for(var i = 0; i<inputList.length; i++)
	{
		/*if(document.getElementById(inputList[i]) != undefined)
		{*/
			if(type == 1)
			{
				poststr += inputList[i]+"=" + encodeURI(document.getElementById(inputList[i]).value)+"&";
			}
			else if(type == 2)
			{
				poststr += inputList[i]+"=" + encodeURI(document.getElementById(inputList[i]).innerHTML)+"&";
			}
			else
			{
				
			}
		//}
	}
	
	var http_post_request = false;
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari,...
		http_post_request = new XMLHttpRequest();
		if (http_post_request.overrideMimeType) 
		{
			http_post_request.overrideMimeType('text/html');
		}
	}
	else if (window.ActiveXObject) 
	{ // IE
		try 
		{
			http_post_request = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
			   http_post_request = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) 
			{}
		}
	}
	if (!http_post_request) 
	{
		document.getElementById(targetIDList[position]).innerHTML = "Cannot create XMLHTTP instance";
		return false;
	}
	dateTime = new Date();
	url = path + fileNameList[position];
	
	if(loadingDisplay == 1)
	document.getElementById(targetIDList[position]).innerHTML = "<img src='Images/loading.gif'>&nbsp;&nbsp;载入中....";
	else if(loadingDisplay ==2)
	document.getElementById(targetIDList[position]).innerHTML = "<img src='Images/loading.gif'>&nbsp;&nbsp;Loading....";
	
	http_post_request.onreadystatechange = function () 
	{
		if (http_post_request.readyState == 4) 
		{
			if(http_post_request.status == 200) 
			{
				//Cannot load frame page in table
				document.getElementById(targetIDList[position]).innerHTML = http_post_request.responseText;
				
				if(position < fileNameList.length-1)
					submitPost(fileName, targetID, path, resource, type, loadingDisplay, position+1);
				
				if(refrs == 1)
					parent.resizeCaller();
			} 
			else 
			{
				document.getElementById(targetIDList[position]).innerHTML = 'ERROR Loading. Please refresh the page';
					//'fileName+' Get Fail '+http_post_request.status;
			}
		}
		else
		{
			
		}
	};
	
	http_post_request.open('POST', url+"?"+dateTime.getTime(), true);
	http_post_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_post_request.setRequestHeader("Content-length", poststr.length);
	http_post_request.setRequestHeader("Connection", "close");
	http_post_request.send(poststr);
}