var ToolingSpecs = new function(){
	this.loadingString = '<div class="loading"><img src="images/loading.gif" width="16" height="16" align="absmiddle" /> Loading...</div>';
	this.httpRequest = new HttpRequest();
	this.httpRequest.setCallee(this);
	this.httpRequest.setTimeout(5000);
	this.httpRequest.setRetryStatus(HttpRequest.RETRY_TIMEOUT);
	this.httpRequest.setCaching(true);

	this.filterBy = function(pid){
		var obj = document.getElementById('ProductSpecs');

		this.httpRequest.get('relatedElementsSpecs.php', 'pid=' + pid);

		if(obj) {
			obj.innerHTML = this.loadingString;
			obj = null;
		}
	}

	this.onHttpRequestResponse = function(resp, status, statusText){
		var obj = document.getElementById('ProductSpecs');

		if(obj) {
			obj.innerHTML = resp;
			obj = null;
		}
	}

	this.onHttpRequestError = function(resp, status, statusText){
		var obj = document.getElementById('ProductSpecs');

		if(obj) {
			obj.innerHTML = '';
			obj = null;
		}

		alert('Failed AJAX Request: ' + statusText);
	}
}
