function YesAjaxTab(filename,defaulttab,formname,page_getparams){
	this.filename = filename;
	this.formname = formname;
	this.defaulttab = defaulttab;
	this.page_getparams = page_getparams;
	this.ajax_load_tab = AjaxLoadTab;
	this.show_tab = ShowTab;

	function AjaxLoadTab(tab){
		params = this.page_getparams + '&tab='+tab;
		  var myAjax = new Ajax.Request(
		    this.filename,
		    { 
		    	method: 'get', 
			parameters: params,
		    	onComplete: this.show_tab 
		    }
		  );
		  tabs = $('maintab').childNodes;

		  for(i=0;i<tabs.length;i++){
			if(tabs[i].id == tab)
				tabs[i].className = 'selected';
			else if(tabs[i].id != 'undefined')
				tabs[i].className = '';
		  }
	}

	function ShowTab( originalRequest ) {
	   $('ajaxcontentarea').innerHTML = originalRequest.responseText;
	}
}
// special onload func
// Instanz von YesAjaxTab muss bereits existieren (YAT)
function ajax_onload_tab(){
	YAT.ajax_load_tab(YAT.defaulttab);
}

