var SearchHistory = function(){
	this._obj = null;
	if (window.ActiveXObject) {
		this._obj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) {
		this._obj = new XMLHttpRequest();
	}
};

SearchHistory.prototype.isReady = function(){
	return null != this._obj && 'undefined' != typeof(this._obj);
};

SearchHistory.prototype.get = function(query){
	if (this.isReady()) {
		this._obj.open('GET', '/common/shop_history_async.php?' + query, true);
		var http = this._obj;
		this._obj.onreadystatechange = function(){
			if (4 == http.readyState && 200 == http.status) {
				if (document.getElementById) {
					var div = document.getElementById('serHisRes');
					if (div) {
						div.innerHTML = http.responseText;
					}
				}
			}
		};
		this._obj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		this._obj.send('');
	}
	else {
		if (document.getElementById) {
			var div = document.getElementById('serHisRes');
			if (div) {
				div.innerHTML = '<ul><li>ご利用中のブラウザでは、表示できません</li></ul>';
			}
		}
	}
};

SearchHistory.prototype.get2 = function(query){
	var ranNum = Math.floor( Math.random() * 100000) + 1; 
	query = query + "&" + ranNum;

	var searchHis = new SearchHistory();
	searchHis.get(query);
};
