
/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.X
 *	LICENSE: FL0M2SG681CQ - http://www.flynax.com/license-agreement.html
 *	PRODUCT: Pets Classifieds
 *	DOMAIN: pupsnshop.com
 *	FILE: LIB.JS
 *
 *	The software is a commercial product delivered under single, non-exclusive, 
 *	non-transferable license for one domain or IP address. Therefore distribution, 
 *	sale or transfer of the file in whole or in part without permission of Flynax 
 *	respective owners is considered to be illegal and breach of Flynax License End 
 *	User Agreement. 
 *
 *	You are not allowed to remove this information from the file without permission
 *	of Flynax respective owners.
 *
 *	Flynax Classifieds Software 2014 |  All copyrights reserved. 
 *
 *	http://www.flynax.com/
 *
 ******************************************************************************/

var importCategoriesClass = function() {
	var self = this;
	var window = false;
	var request;

	this.import = function(start) {
		// show window 
		if ( start == 0 ) {
			if ( !window ) {
				window = Ext.MessageBox.show({
					msg: 'Saving your data, please wait...',
					progressText: 'Saving...',
					width:300,
					wait:true,
					waitConfig: {interval:200}
				});
			}
			window.show();
		}

		$.ajax({
			url: rlPlugins +'importExportCategories/admin/import.php?start='+ start,
			success: function(data, textStatus, jqXHR) {
				self.import(0);
			}
		});
	}

	this.stop = function(){
		request.abort();
		Ext.MessageBox.hide();
	}

	this.start = function(){
		self.import(0);
	}
}

var importCategories = new importCategoriesClass();