/**
 * @author: Anatolij Rau
 * @copyright: Anatolij Rau
 * @access: 2009-10-10
 * @version: 0.9.0
 **/

function ajaxPopupClass() {
	// Cofig vars for iBox
	this.iBoxConf = new Object();
	this.iBoxConf['maxWidth'] = null;
	this.iBoxConf['placement_x'] = 'center'; // left | center | right
	this.iBoxConf['placement_y'] = 'top'; // top | middle | botom

	if (typeof ajaxObj != 'object') {
		alert('ajaxPopupClass::init() ajaxObj required!');
		return false;
	}
	if (typeof iBoxObj != 'object') {
		alert('ajaxPopupClass::init() iBoxObj required!');
		return false;
	}
	
	this.open = function(url, title, class_sufix) {
		ajaxObj.load(url, 
			(function(text) {
				for (var i in ajaxPopupObj.iBoxConf) if (ajaxPopupObj.iBoxConf[i] != null) {
					iBoxObj[i] = ajaxPopupObj.iBoxConf[i];
				}
				iBoxObj.display(text, title, class_sufix);
			})
		);
	};
}

var ajaxPopupObj = new ajaxPopupClass();