//=============================================================================
// Ajax Controll Lib								Powerd by Axdd system div.
// Version 1.0.0
// Created by Akira.Kusama
//=============================================================================

//------------------------------------
// 更新履歴
//------------------------------------
/*

2006/11/14 v1.0.0 リリース

*/

//===================================
// ::used module::
// use prototype.js	->	"1.4.0以上"
// use Common.js
// ===================================

/* ************************************************************************** */
// Ajax

// コンストラクタ
function AjaxCtrl() {
}

/* -------------------------------------------------------------------------- */
// Method
/* -------------------------------------------------------------------------- */
// Ajax Get Product
AjaxCtrl.prototype.send = function(url, complete, method) {
	var utl;
	var u;
	var c;
	var m;
	
	try {
		utl = new utility();
		
		u = utl.ufc(url);
		c = utl.ufc(complete);
		m = utl.ufc(method);
		
		if (m == '') {
			m = 'post';
		}
		
		// asynchronous: 'false', -> 同期モード
		// asynchronous: 'true',  -> 非同期モード(default)
		
		if (u != '' && c != '') {
			var myAjax = new Ajax.Request(
				u,
				{
					method: m,
					onComplete: c,
					onFailure: utl.showFail
				}
			);
		}
	} catch(e) {
		alert("AjaxCtrl\nfunc:send\n" + e);
	}
}

