/**
 * @author dietsch
 */
tx_scmauthors = function() {
	
	var self = this;
	
	var pageId = 0;
	var typeNum = 0;
	
	this.getAuthorsByLetter = function(letterVar) {
		
		self.handleStart();
		
		$.ajax({			
			type: 'POST',
			dataType: 'json',
			url: '/?'+this.pageId+'&type='+this.typeNum,
			data: 'tx_scmauthors_pi1[action]=json_list&tx_scmauthors_pi1[letter]='+letterVar,
			complete: function(data, textStatus) {
				self.handleComplete(data, textStatus);
			},
			success: function(data, textStatus) {
				self.handleSuccess(data, textStatus);
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				self.handleError(XMLHttpRequest, textStatus, errorThrown)
			}
		});
		
	}
	
	this.handleStart = function () {
		if(typeof console == 'object') {
			console.log('handleStart is not set');
		}
	}
	
	this.handleComplete = function(data, textStatus) {
		if(typeof console == 'object') {
			console.log('handleComplete is not set');
			console.log(textStatus);
			console.log(data);
		}
	}
	
	this.handleSuccess = function(data, textStatus) {
		if(typeof console == 'object') {
			console.log('handleSuccess is not set');
			console.log(textStatus);
			console.log(data);
		}
	}
	
	this.handleError = function(XMLHttpRequest, textStatus, errorThrown) {
		if(typeof console == 'object') {
			console.log('handleError is not set');
			console.log(textStatus);
			console.log(errorThrown);
		}
	}
} 