function showOrders(cldFrm)
{
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null)
	{
		alert (ajaxErrMsg);
		return;
	}
	/*=====================
	cldFrm = 1, means called from Show Orders
	cldFrm = 2, means called from RMA
	=====================*/
	
	loadAccPage(true, null);
	var url = 'account_Orders.php?cldFrm='+cldFrm+'&purpose=showOrders&'+Math.random();
	xmlHttp.onreadystatechange = stateChanged_showOrders;
	xmlHttp.open('GET', url, true);
	xmlHttp.send(null);
}
function stateChanged_showOrders()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{
		if (xmlHttp.responseText.indexOf('E~X~P~I~R~E~D') != -1)
			window.location = 'login.php?m=2';
		else
			loadAccPage(false, xmlHttp.responseText);
	}
}
/*
function showOrdersSearch()
{
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null)
	{
		alert (ajaxErrMsg);
		return;
	}
	loadAccPageSearch(true, null);
	var url = 'account_Orders.php?purpose=showOrdersSearch&'+Math.random();
	xmlHttp.onreadystatechange = stateChanged_showOrdersSearch;
	xmlHttp.open('GET', url, true);
	xmlHttp.send(null);
}
function stateChanged_showOrdersSearch()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{
		if (xmlHttp.responseText.indexOf('E~X~P~I~R~E~D') != -1)
			window.location = 'login.php?m=2';
		else
			loadAccPageSearch(false, xmlHttp.responseText);
	}
}
*/
function showOrderDetail(OrderId)
{
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null)
	{
		alert (ajaxErrMsg);
		return;
	}
	document.getElementById('dvOrderCart').innerHTML = '';	
	document.getElementById('statusLoaderOrderData').style.display = '';
	document.getElementById('orderDataArea').innerHTML = '';
	var url = 'account_Orders.php?OrderId='+OrderId+'&purpose=showOrderDetail&'+Math.random();
	xmlHttp.onreadystatechange = stateChanged_showOrderDetail;
	xmlHttp.open('GET', url, true);
	xmlHttp.send(null);
}
function stateChanged_showOrderDetail()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{
		if (xmlHttp.responseText.indexOf('E~X~P~I~R~E~D') != -1)
			window.location = 'login.php?m=2';
		else
		{
			document.getElementById('statusLoaderOrderData').style.display = 'none';
			document.getElementById('orderDataArea').innerHTML = xmlHttp.responseText;
		}
	}
}
function showCart(orderId)
{
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null)
	{
		alert (ajaxErrMsg);
		return;
	}
	document.getElementById('dvSatusLoaderOrderCart').style.display = '';
	document.getElementById('dvOrderCart').innerHTML = '';
	var url = 'account_Orders.php?orderId='+orderId+'&purpose=showCart&'+Math.random();
	xmlHttp.onreadystatechange = stateChanged_showCart;
	xmlHttp.open('GET', url, true);
	xmlHttp.send(null);
}
function stateChanged_showCart()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{
		if (xmlHttp.responseText.indexOf('E~X~P~I~R~E~D') != -1)
			window.location = 'login.php?m=2';
		else
		{
			document.getElementById('dvSatusLoaderOrderCart').style.display = 'none';
			document.getElementById('dvOrderCart').innerHTML = xmlHttp.responseText;
		}
	}
}

function closeOrderDetail()
{
	document.getElementById('orderDataArea').innerHTML = '';
}
function closeOrderCart()
{
	document.getElementById('dvOrderCart').innerHTML = '';
}
