var Magazin4Players = Class.create();
Magazin4Players.prototype = {
	rootPath:			'',
	
	initialize: function(rootpath)
	{
		this.rootPath = rootpath;
	},
	
	callAjaxFunction: function(func, params, callfunc)
	{
		var url = this.rootPath + "ajax/" + func + ".ajax.php";
		new Ajax.Request(url, {
						 method: 'post',
						 parameters: params,
						 evalJSON: false,
					  	 onSuccess: function(transport) {	
					   		callfunc(transport.responseText);
					   	}
		});			 	
	},	
	
	loadAjaxContent: function(container,func, params, callfunc)
	{
		var url = this.rootPath + "/ajax/" + func + ".html.php";
		new Ajax.Updater(container,
						 url, {
						 method: 'post',
						 asynchronous:true,
						 evalScripts: true,						 
						 parameters: params,
						 onComplete: function(){
						 	if (callfunc)
						 	{
						 		callfunc();
						 	}
						 }
					   	});
	}
}