window.onload = function() {
	document.form1.w.focus();
	fillRatesList();
}
function doCalc() {
	AJAX('ebay_calc.php?w='+document.form1.w.value+'&c='+document.form1.c.value);
}
function fillRatesList() {
	AJAX('ebay_calc.php');
}

var ajax = {
	request : '',
	params : '',
	http : Object,
	req : function(request) {
		this.request = request;
		this.createRequestObject();
		this.sendRequest();
	},
	createRequestObject : function() {
		if ( navigator.appName == "Microsoft Internet Explorer" ) {
			this.http = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			this.http = new XMLHttpRequest();
		}
	},
	sendRequest : function() {
		this.http.open('GET', this.request,true);
		this.http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		this.http.onreadystatechange = ajax.getResponse;
		this.http.send(null);
	},
	getResponse : function() {
		if ( ajax.http.readyState == 4 ) {
			eval(ajax.http.responseText);
			ajax.http = null;
		}
	}
}
function AJAX(request) {
	ajax.req(request);
}


