var xmlHttp;

function getConsole(cID) {
	var companyID;
	var url;
	var cName;
	
	if (cID == "1"){
		companyID = "1";
	}
	else if (cID == "2") {
		companyID = "2";
	}
	
		xmlHttp = GetXmlHttpObject();
			if (xmlHttp==null) {
				return; //don't bother the client, untrackable.
			}
	
	if (companyID == "2") {
		url = "invaluable-console.htm";
		cName = "invaluable";
	///////////////////////////////////
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange = stateChanged2;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	else {
		url = "artfact-console.htm";
		cName = "artfact";
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange = stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
	
}

function stateChanged() {
	//Artfact One 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		ifrm = document.createElement("IFRAME");
		var aurl= "artfact-console.htm?" + Math.random();
		ifrm.setAttribute("src", aurl);
		ifrm.style.width = 10+"px";
		ifrm.style.height = 10+"px";
		ifrm.style.display = "none";
		document.body.appendChild(ifrm);
	}
}

function stateChanged2() {
	//Invaluable One 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		ifrm = document.createElement("IFRAME");
		var aurl= "invaluable-console.htm?" + Math.random();
		ifrm.setAttribute("src", aurl);
		ifrm.style.width = 10+"px";
		ifrm.style.height = 10+"px";
		ifrm.style.display = "none";
		document.body.appendChild(ifrm);
	}
}

function GetXmlHttpObject() {
	var xmlHttp=null;
		try {
			xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
		}
		catch (e) {
 			//Internet Explorer
 			try {
  				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  			}
 			catch (e) {
  				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
 		}
	return xmlHttp;
}