var xmlhttp2;
var iddiv
function listCars(divid,page,type,f,sortfield,sortorder,cmd,id)
{
	if(id=="newlist")
	{
		window.location = "http://www.tradingpaints.com/user/newlist";
	}
	else
	{
		iddiv=divid;
		if(cmd=="createzip")
			document.getElementById(iddiv).innerHTML="<center><h2>Creating your ZIP. This can take some time depending on how many files you selected. Please wait until it is finished before leaving this page.</h2><br><img src=\"http://www.tradingpaints.com/templates/default/image/help-loading.gif\" alt=\"Loading\" title=\"Loading\"></center>";
		else
			document.getElementById(iddiv).innerHTML="<center><img src=\"http://www.tradingpaints.com/templates/default/image/help-loading.gif\" alt=\"Loading\" title=\"Loading\"></center>";
		xmlhttp2=GetXmlHttpObject2();
		if (xmlhttp2==null)
		{
			alert ("Browser does not support HTTP Request");
			return;
		}
		var url="http://www.tradingpaints.com/scripts/viewcars/viewCars.php?divid="+divid+"&page="+page+"&type="+type+"&f="+f+"&sortfield="+sortfield+"&sortorder="+sortorder+"&cmd="+cmd+"&id="+id;
		xmlhttp2.onreadystatechange=stateChanged2;
		xmlhttp2.open("GET",url,true);
		xmlhttp2.send(null);
	}
}

function stateChanged2()
{
if (xmlhttp2.readyState==4)
{
document.getElementById(iddiv).innerHTML=xmlhttp2.responseText;
}
}

function GetXmlHttpObject2()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

