//Pauls usps ups package tracker for justbare.com
//3/20/2008
var time_variable;

function getXMLObject(){
var a=false;
try{a=new ActiveXObject("Msxml2.XMLHTTP")
} catch(e){
try{a=new ActiveXObject("Microsoft.XMLHTTP")
} catch(e2){
a=false}
}
if(!a&&typeof XMLHttpRequest!='undefined'){
a=new XMLHttpRequest()
}
return a
}
var xmlhttp=new getXMLObject();

function ajaxFunction(psloader){
document.getElementById("log").innerHTML = psloader;


var a=new Date();
	if(xmlhttp){
	var b=document.getElementById("query");
	xmlhttp.open("POST","http://justbare.com/shop/page_tracking.php",true);
	xmlhttp.onreadystatechange=handleServerResponse;
	xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlhttp.send("query="+b.value)
	}
}

function handleServerResponse(){
	if(xmlhttp.readyState==4){
		if(xmlhttp.status==200){
		document.getElementById("log").innerHTML=xmlhttp.responseText;
		} else {
		alert("Error during AJAX call. Please try again")
		}
	}
}