/**
 * prototype.js を使った Ajax.
 * MQカスタマイズ.
 *
 * @author TAKEMURA mitsuo<takemura@ark-web.jp>
 */
function Sender() {}


/**
 * リクエストを送信する.
 *
 * @param  Closure        コールバック関数
 * @param  String         検索方向
 * @param  String         検索式
 * @param  String         共起語
 * @param  Number         ベース時間
 * @return None
 */
Sender.prototype.sendRequest = function(cCallback, sSearchDirection, sKw, sCw, iBaseTime) {

	var sQueryString = 'dir=' + sSearchDirection;
	sQueryString += '&num=' + KIZASI_MQ_KWIC_LIST_MAX;
    if (sKw)        { sQueryString += '&kw=' + encodeURL(sKw); }
    if (sCw)        { sQueryString += '&cw=' + encodeURL(sCw); }
    if (iBaseTime)  { sQueryString += '&tm=' + iBaseTime; }
	var myAjax = new Ajax.Request(
		KIZASI_MQ_KWIC_ACCESSURL, 
		{
			method: 'get', 
			parameters: sQueryString, 
			onComplete: cCallback
		});
}

