
function OFetcher() {
	var that = this;

	this.getWebArtikelDetails = function(artCodes) {
		var arrx = JSON.stringify(artCodes);
		$.ajax({ 
			url: "http://ows.orgazmik.net/ojps/OrgazmikJSONPService.asmx/GetWebArtikelDetails",
			data: { artikelcodes: arrx },
			dataType: "jsonp",
			success: function(response) {
				var artList = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
				setTimeout(function(){ that.onResult(artList) }, 0);
			},
			error: function() {
			}
		});
		return this;
		//
		this.onResult = function(artikelDetails) {
		}
	}

	this.getLZTrailers = function(lstArtikelcodes) {
		var arrx = JSON.stringify(lstArtikelcodes);
		$.ajax({ 
			url: "http://ows.orgazmik.net/ojps/OrgazmikJSONPService.asmx/GetLZTrailers",
			data: { artikelcodes: arrx },
			dataType: "jsonp",
			success: function(response) {
				var artList = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
				setTimeout(function(){ that.onResult(artList) }, 0);
			},
			error: function() {
			}
		});
		return this;
		//
		this.onResult = function(trailers) {
		}
	}

	this.setLZTrailer = function(artikelcode, trailercode, owner) {
		$.ajax({ 
			url: "http://ows.orgazmik.net/ojps/OrgazmikJSONPService.asmx/SetLZTrailer",
			data: { artikelcode: JSON.stringify(artikelcode), trailercode: JSON.stringify(trailercode), owner: JSON.stringify(owner) },
			dataType: "jsonp",
			success: function(response) {
				setTimeout(function(){ that.onResult(response.d) }, 0);
			},
			error: function() {
				setTimeout(function(){ that.onResult("ERROR") }, 0);
			}
		});
		return this;
		//
		this.onResult = function(result) {
		}
	}
	
	this.updateLZTrailer = function(artikelcode, trailercode) {
		$.ajax({ 
			url: "http://ows.orgazmik.net/ojps/OrgazmikJSONPService.asmx/UpdateLZTrailer",
			data: { artikelcode: JSON.stringify(artikelcode), trailercode: JSON.stringify(trailercode) },
			dataType: "jsonp",
			success: function(response) {
				setTimeout(function(){ that.onResult(response.d) }, 0);
			},
			error: function() {
				setTimeout(function(){ that.onResult("ERROR") }, 0);
			}
		});
		return this;
		//
		this.onResult = function(result) {
		}
	}

	//********************************************************************************************
	
	this.getORGScreennames = function(lstKNr) {
		var arrx = JSON.stringify(lstKNr);
		$.ajax({ 
			url: "http://ows.orgazmik.net/ojps/OrgazmikJSONPService.asmx/GetORGScreennames",
			data: { KNrList: arrx },
			dataType: "jsonp",
			success: function(response) {
				var knrList = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
				setTimeout(function(){ that.onResult(knrList) }, 0);
			},
			error: function() {
			}
		});
		return this;
		//
		this.onResult = function(trailers) {
		}
	}

}
