MTGCardTable = function(xid, xcontainer, xnoCardsComment, xdeleteEnabled, xlogin) {
	var obj = {
	
			id: 			'',
			container: 		'',
			noCardsComment: '',
			deleteEnabled:	false,
			rows: 			[],
			sortBy: 		'name',
			sortOrder: 		'asc',
			sorted: 		true,
			login:			'',
			isCart:			false,
			hasFooter:		false,
			defaultCartNum:	14,
			loadStr:		'',
			paged:			false,
			perPage:		50,
			currentPage:	0,
			totalPages:		0,
			ajaxParams:		'',
			history:		false,
			
			availableCols:	['name', 'rarity', 'illustr', 'edition', 'type', 'manaCost', 
								'storeQty', 'price', 'cartQty', 'laterQty', 'totalPrice'],
								
			sortableCols:	[true, true, true, true, true, true,
								false, true, false, false, true],

			hidableCols:	[false, true, true, false, true, true,
								false, true, true, true, true],
								
			colHeaders:		['Nazwa', 'Rarity', 'Ilustrator', 'E/D', 'Typ', 'Mana', 
								'Stan', 'Cena', 'Koszyk', 'Na&nbsp;później', 'Suma', 'Info'],
								
			visibleCols: 	['name', 'rarity', 'illustr', 'edition', 'type', 'manaCost', 
								'storeQty', 'price', 'cartQty', 'laterQty', 'totalPrice'],
	
		init: function(id, container, noCardsComment, deleteEnabled, login) {
			this.id = id;
			this.container = container;
			this.noCardsComment = noCardsComment;
			this.deleteEnabled = deleteEnabled;
			this.login = login;
		},
		loadData: function () {
			this.currentPage = 0;
			var ownParams = 
				'&page=0'+
				'&perPage='+this.perPage+
				'&sortBy='+this.sortBy+
				'&sortOrder='+this.sortOrder;
			ax_getAjaxDoc(this.loadStr, this.ajaxParams+ownParams);	
		},
		sortPaged: function () {
			var ownParams = 
				'&page='+this.currentPage+
				'&perPage='+this.perPage+
				'&sortBy='+this.sortBy+
				'&sortOrder='+this.sortOrder;
			ax_getAjaxDoc(this.loadStr, this.ajaxParams+ownParams);	
		},
		addRowsUnsorted: function(rows) {
			for (var i=0; i<rows.length; i++) {
				if (rows[i]!=undefined) this.addUnsorted (rows[i]);
			}
		},
		addUnsorted: function (row) {
			if (!this.containsCard(row)) {
				if (row[13]=='0') row[16] = '0.00';
				this.rows.push(row);
				this.sorted = false;
			}
		},
		containsCard: function (row) {
			for (var i=0; i<this.rows.length; i++) {
				if (this.rows[i]==undefined) continue;
				if (this.rows[i][1]==row[1] &&					// edition
					this.rows[i][2]==row[2] &&					// seq
					this.rows[i][10]==row[10] &&				// lang
					this.rows[i][11]==row[11] &&				// cond
					this.rows[i][12]==row[12]) return true;		// foiled
			}
			return false;
		},
		sort: function () {
			if (this.paged) {
				this.sortPaged();
				return;
			}
			var sortF = this.sortString;
			var colNum = 0;
			switch (this.sortBy) {
				case 'name': 
					colNum = 0;
					sortF = this.sortString;
					break;
				case 'edition': 
					colNum = 1;
					sortF = this.sortString;
					break;
				case 'rarity': 
					colNum = 3;
					sortF = this.sortString;
					break;
				case 'illustr': 
					colNum = 4;
					sortF = this.sortString;
					break;
				case 'type':
					colNum = 5;
					sortF = this.sortString;
					break;
				case 'manaCost':
					colNum = 7;
					sortF = this.sortString;
					break;
				case 'price':
					colNum = 16;
					sortF = this.sortNumber;
					break;
				case 'cartQty':
					colNum = 14;
					sortF = this.sortNumber;
					break;
				case 'laterQty':
					colNum = 15;
					sortF = this.sortNumber;
					break;
				case 'totalPrice':
					colNum = 14;
					sortF = this.sortTotalPrice;
					break;
			}
			for (var i=1; i<this.rows.length; i++) {
				for (var j=0; j<this.rows.length-i; j++) {
					if (sortF(this.rows[j][colNum], this.rows[j+1][colNum], j, this)
							==(this.sortOrder=='asc')) {
						row = this.rows[j];
						this.rows[j] = this.rows[j+1];
						this.rows[j+1] = row;
					}
				}
			}
			this.display();
		},
		sortTotalPrice: function (s1, s2, rowNum, tab) {
			var s1, s2;
			if (this.history) {
				s1 = ((tab.rows[rowNum][13]-0)*(tab.rows[rowNum][16]-0));
				s2 = ((tab.rows[rowNum+1][13]-0)*(tab.rows[rowNum+1][16]-0));
			} else {
				s1 = ((tab.rows[rowNum][14]-0)*(tab.rows[rowNum][16]-0));
				s2 = ((tab.rows[rowNum+1][14]-0)*(tab.rows[rowNum+1][16]-0));
			}
			return s1>s2;
		},
		sortString: function (s1, s2, rowNum, tab) {
			return s1>s2;
		},
		sortNumber: function (p1, p2, rowNum, tab) {
			return parseFloat(p1)>parseFloat(p2);
		},
		display: function () {
			if (this.paged) {
				ind = this.getAvailableColumnIndex('totalPrice');
				this.sortableCols[ind] = false;
			}
			var cont = '<table class="normal" cellspacing="0" cellpadding="0">';
			if (this.paged) cont += this.innerPageHeader();
			cont += this.innerTopHeader();
			cont += this.innerHeader();
			if (this.rows!=undefined && this.rows.length>0) {
				for (var i=0; i<this.rows.length; i++) {
					if (this.rows[i]==undefined) continue;
					cont += this.innerRow (i);
				}
			} else {
				cont += '<tr><td class="first" style="text-align: center;" colspan="'+
					((this.deleteEnabled) ? this.visibleCols.length+1 : this.visibleCols.length+1)+
					'"><p class="headError">'+this.noCardsComment+'</p></td></tr>';
			}
			if (this.hasFooter) cont += this.innerFooter();
			$(this.container).innerHTML = cont;
		},
		innerPageHeader: function () {
			if (this.totalPages<2) return '';
			var inn = '<tr class="header" style="text-align: center;">';
			var span = this.visibleCols.length+((this.deleteEnabled)?1:0);
			inn += '<td class="header first" colspan="'+span+'">';
			if (this.currentPage>1) {
				inn += '<a class="pagerLink" href="javascript:'+this.id+'.changePage(1);">'+
					'&nbsp;&nbsp;1&nbsp;&nbsp;</a>&nbsp;&middot;&nbsp;';
			}
			lstr = Math.min(4, this.currentPage-2);
			for (var i=this.currentPage-lstr; i<this.currentPage; i++) {
				inn += '<a class="pagerLink" href="javascript:'+this.id+'.changePage('+i+');">'+
					'&nbsp;&nbsp;'+i+'&nbsp;&nbsp;</a>&nbsp;&middot;&nbsp;';
			}
			inn += '<a class="pagerLink" style="font-size: 16px;" href="javascript:void(null);">'+
				'&nbsp;&nbsp;'+this.currentPage+'&nbsp;&nbsp;</a>';
			lstr = Math.min(4, this.totalPages-this.currentPage-1);
			for (var i=this.currentPage+1; i<this.currentPage+lstr+1; i++) {
				inn += '&nbsp;&middot;&nbsp;<a class="pagerLink" href="javascript:'+this.id+'.changePage('+i+');">'+
					'&nbsp;&nbsp;'+i+'&nbsp;&nbsp;</a>';
			}
			if (this.currentPage<this.totalPages) {
				inn += '&nbsp;&middot;&nbsp;<a class="pagerLink" href="javascript:'+this.id+'.changePage('+
					this.totalPages+');">'+
					'&nbsp;&nbsp;'+this.totalPages+'&nbsp;&nbsp;</a>';
			}
			inn += '</td>';
			inn += '</tr>';
			return inn;
		},
		changePage: function (newPage) {
			this.currentPage = newPage;
			this.sortPaged();
		},
		getFooterSum: function (name) {
			sum = 0;
			colNum = (this.history) ? 13 : 14;
			for (var j=0; j<this.rows.length; j++) {
				sum += (name=='cartQty' || name=='storeQty')
					? this.rows[j][colNum]-0
					: ((this.rows[j][colNum]-0)*(this.rows[j][16]-0));
			}
			sumx = (name=='cartQty' || name=='storeQty')
				? sum : sum.toFixed(2);
			return sumx;
		},
		innerFooter: function () {
			var inn = '<tr class="footer">';
			for (var i=0; i<this.visibleCols.length; i++) {
				inn += '<td class="footer';
				if (i==0) {
					inn += ' first';
				}
				if (this.visibleCols[i]=='storeQty' && this.history)
					inn += '" align="center" id="'+this.id+'_footer_storeQty';
				if (this.visibleCols[i]=='cartQty')
					inn += '" align="center" id="'+this.id+'_footer_cartQty';
				if (this.visibleCols[i]=='totalPrice')
					inn += '" align="right" id="'+this.id+'_footer_totalPrice';
				inn += '">';
				if (this.visibleCols[i]=='cartQty' || this.visibleCols[i]=='totalPrice' ||
					(this.visibleCols[i]=='storeQty' && this.history)) {
					inn += this.getFooterSum(this.visibleCols[i])+'</td>';
				} else {
					inn += '&nbsp;</td>';
				}
			}
			if (this.deleteEnabled) {
				inn += '<td class="footer">&nbsp;</td>';
			}
			inn += '</tr>';
			return inn;		
		},
		innerRow: function (rowNum) {
			var inn = '<tr';
			if (rowNum % 2 == 1) {
				inn += ' class="even"';
			}
			inn += ' onmouseover="rowHighlight(this);" onmouseout="removeRowHighlight(this);">';
			for (var i=0; i<this.visibleCols.length; i++) {
				var xclass = '';
				if (i==0) xclass = 'first';
				if (rowNum % 2 == 1) xclass += (xclass=='') ? 'even' : ' even';
				inn += '<td id="'+this.id+'_'+this.visibleCols[i]+'_'+rowNum+'"';
				if (this.visibleCols[i]=='totalPrice') inn += ' align="right"';
				if (xclass!='') inn += ' class="'+xclass+'"';
				if (this.visibleCols[i]!='cartQty' && this.visibleCols[i]!='laterQty' 
					&& this.visibleCols[i]!='info') {
					inn += ' onclick="cards.showCardExt(event, \''+this.rows[rowNum][1]+'\', \''+
					this.rows[rowNum][2]+'\', '+
					'\''+this.rows[rowNum][10]+'\', '+
					'\''+this.rows[rowNum][12]+'\', '+
					'\''+this.rows[rowNum][11]+'\');"';
				}
				if (this.visibleCols[i]=='info') {
					inn += ' style="text-align: center;" ';
				}
				inn += '>';
				switch (this.visibleCols[i]) {
					case 'name':
						inn += this.rows[rowNum][0];
						if (this.rows[rowNum][10]!='ENG') inn += ' ['+this.rows[rowNum][10]+']';
						if (this.rows[rowNum][12]!='') inn += ' <i>foil</i>';
						break;
					case 'edition':
						inn += this.rows[rowNum][1];
						break;
					case 'rarity':
						inn += this.rows[rowNum][3];
						break;
					case 'illustr':
						inn += this.rows[rowNum][4];
						inn += '&nbsp';
						break;
					case 'type':
						inn += this.rows[rowNum][5];
						if (this.rows[rowNum][9]!='') inn += ' ['+this.rows[rowNum][9]+']';
						inn += '&nbsp';
						break;
					case 'manaCost':
						inn += this.rows[rowNum][6];
						inn += '&nbsp';
						break;
					case 'storeQty':
						inn += this.rows[rowNum][13]+"&nbsp;"+this.rows[rowNum][11];
						inn += '&nbsp';
						break;
					case 'price':
						inn += (this.rows[rowNum][13]=='0') ? '' : this.rows[rowNum][16];
						inn += '&nbsp';
						break;
					case 'cartQty':
						inn += this.showCartOptions(rowNum, 0, 14);
						break;
					case 'laterQty':
						inn += this.showCartOptions(rowNum, 1, 15);
						break;
					case 'info':
						inn += this.showInfoCheckbox(rowNum, 1, 15);
						break;
					case 'totalPrice':
						if (this.history) {
							inn += ((this.rows[rowNum][13]-0)*(this.rows[rowNum][16]-0)).toFixed(2);
						} else {
							inn += ((this.rows[rowNum][14]-0)*(this.rows[rowNum][16]-0)).toFixed(2);
						}
						break;
				}	
				inn += '</td>';
			}
			if (this.deleteEnabled) {
				inn += '<td id="'+this.id+'_close_'+rowNum+'">'+
				'<div class="dotClose" id="'+this.id+'_dotClose_'+rowNum+'" ';
				if (this.isCart) {
					if (this.rows[rowNum][this.defaultCartNum]-0==0)
						inn += 'style="display: block;"';
					else
						inn += 'style="display: none;"';
				}
				inn += ' onclick="javascript:'+
				this.id+'.deleteRow('+rowNum+');" onmousemove="return '+
				'hoverlib(this, event, \'Usuń wiersz\', 140);" onmouseout="return nd();"></div>';
				if (this.isCart && this.rows[rowNum][this.defaultCartNum]-0!=0 
					&& (browser.isIE && !browser.isOpera))
					inn += '&nbsp;';
				inn += '</td>';
			}
			inn += '</tr>';
			return inn;
		},
		showInfoCheckbox: function (rowNum, cartNum, col) {
			var inn = '<input type="checkbox" id="'+this.id+'_infoFix_'+rowNum+'" '+
				((this.rows[rowNum][17]=='1') ? 'checked="checked" ' : '') +
				'onclick="'+this.id+'.changeFix('+rowNum+');" onmousemove="return '+
				'hoverlib(this, event, \'Zaznacz to pole, jeżeli chcesz zostać poinformowany o zmianie dostępności tej karty w MTGNet.pl.\', 220);" onmouseout="return nd();" />';
			return inn;
		}, 
		changeFix: function (rowNum) {
			loadStr = 'ajax_addOrRemoveFromCart.php';
			params = 'fix='+(($(this.id+'_infoFix_'+rowNum).checked) ? '1' : '0')+
				'&edition='+this.rows[rowNum][1]+
				'&seq='+this.rows[rowNum][2]+
				'&lang='+this.rows[rowNum][10]+
				'&cond='+this.rows[rowNum][11]+
				'&foiled='+this.rows[rowNum][12]+
				'&cartNum=1'+
				'&qty='+(this.rows[rowNum][15]-0);
			ax_getAjaxDoc(loadStr, params);	
		},
		showCartOptions: function (rowNum, cartNum, col) {
			var inn = '';
			if (this.login!='') {
				if (this.rows[rowNum][col]=='') this.rows[rowNum][col] = '0';
				inn += '<div class="cartTDMain">';
				inn += '<div class="dotMinus cartTDLeft" onclick="'+this.id+'.removeFromCart('+
					cartNum+', '+rowNum+');"></div>';
				inn += '<div class="cartTDCenter" id="'+this.id+'_cartQty_'+rowNum+'_'+cartNum+
					'">'+this.rows[rowNum][col]+'</div>';
				inn += '<div class="dotPlus cartTDRight" onclick="'+this.id+'.addToCart('+
					cartNum+', '+rowNum+');"></div>';
				inn += '<div style="clear: both;"></div>';
				inn += '</div>'
			} else {
				if (cartNum==0) 
					inn += '<div class="dotCaution" style="margin-left: 24px;" '+
						'onmousemove="return hoverlib(this, event, \'Aby móc dodawać karty do koszyka '+
						'musisz się zalogować.\', 180);" onmouseout="nd();" '+
						'onclick="actionLogin();"></div>';
				else
					inn += '<div class="dotCaution" style="margin-left: 24px;" '+
						'onmousemove="return hoverlib(this, event, \'Aby móc odkładać karty na później '+
						'musisz się zalogować.\', 180);" onmouseout="nd();" '+
						'onclick="actionLogin();"></div>';
			}
			return inn;
		},
		deleteRow: function (rowNum) {
			this.rows.splice (rowNum, 1);
			nd();
			this.display();
		},
		deleteAll: function () {
			this.rows = [];
			nd();
			this.display();
		},
		addOrRemoveFromCart: function (cartNum, rowNum, add) {
			loadStr = 'ajax_addOrRemoveFromCart.php';
			params = 'cartNum='+cartNum+
				'&edition='+this.rows[rowNum][1]+
				'&seq='+this.rows[rowNum][2]+
				'&lang='+this.rows[rowNum][10]+
				'&cond='+this.rows[rowNum][11]+
				'&foiled='+this.rows[rowNum][12]+
				'&qty='+((this.rows[rowNum][14+cartNum]-0)+add);
			ax_getAjaxDoc(loadStr, params);	
		},
		addToCart: function (cartNum, rowNum) {
			if (cartNum==0 && this.rows[rowNum][14]-0==this.rows[rowNum][13]-0) return;
			this.addOrRemoveFromCart (cartNum, rowNum, 1);
			if (cartNum==1 && this.rows[rowNum][15]-0==0) {
				this.changeFix(rowNum);
			}
		},
		removeFromCart: function (cartNum, rowNum) {
			if (cartNum==0 && this.rows[rowNum][14]-0<1) return;
			this.addOrRemoveFromCart (cartNum, rowNum, -1);
		},
		updateCartQty: function (cartNum, edition, seq, lang, cond, foiled, qty) {
			if (this.isCart && cartNum!=this.defaultCartNum-14) return;
			for (var i=0; i<this.rows.length; i++) {
				if (this.rows[i]==undefined) continue;
				if (this.rows[i][1]==edition &&
					this.rows[i][2]==seq &&
					this.rows[i][10]==lang &&
					this.rows[i][11]==cond &&
					this.rows[i][12]==foiled) {
						this.rows[i][14+cartNum] = qty;
						$(this.id+'_cartQty_'+i+'_'+cartNum).innerHTML = qty;
						if (this.isCart) {
							if (this.rows[i][this.defaultCartNum]-0==0) {
								$(this.id+'_dotClose_'+i).style.display = 'block';
								if (browser.isIE && !browser.isOpera) {
									a = $(this.id+'_close_'+i).innerHTML;
									a = this.slayNBSP(a);
									$(this.id+'_close_'+i).innerHTML = a;
								}
							}
							else {
								$(this.id+'_dotClose_'+i).style.display = 'none';
								if (browser.isIE && !browser.isOpera) {
									a = $(this.id+'_close_'+i).innerHTML;
									a = this.slayNBSP(a);
									$(this.id+'_close_'+i).innerHTML = a + '&nbsp;';
								}
							}
						}
						if ($(this.id+'_totalPrice_'+i)!=undefined)
							$(this.id+'_totalPrice_'+i).innerHTML = 
								((this.rows[i][14]-0)*(this.rows[i][16]-0)).toFixed(2);
						if (this.hasFooter) {
							$(this.id+'_footer_cartQty').innerHTML = this.getFooterSum('cartQty');
							$(this.id+'_footer_totalPrice').innerHTML = 
								this.getFooterSum('totalPrice');
						}
				}
			}
		},
		slayNBSP: function (str) {
			var ax;
			while ((ax = str.substring (str.length-6, str.length))=='&nbsp;') {
				str = str.substring (0, str.length-6);
			}
			return str;
		},
		innerTopHeader: function () {
			var inn = '<tr class="topheader">';
			for (var i=0; i<this.visibleCols.length; i++) {
				var ai = this.getAvailableColumnIndex(this.visibleCols[i]);
				inn += '<td class="topheader';
				if (i==0) inn+= ' first';
				inn += '">';
				if (this.hidableCols[ai]) {
					inn += '<img class="dotHideCol" src="img/spacer.gif" onclick="javascript:'+this.id+'.hideCol(\''+
						this.visibleCols[i]+'\');" '+
						'onmousemove="return hoverlib(this, event, \'Ukryj kolumnę <b>'+
						this.colHeaders[ai]+'</b>\', 160);" onmouseout="return nd();" width="10" height="10" />&nbsp;';
				}
				if (i<this.visibleCols.length) {
					var a2 = (i<this.visibleCols.length) ? 
						this.getAvailableColumnIndex(this.visibleCols[i+1]) :
						this.availableColumns.length-1;
					for (var j=ai+1; j<a2; j++) {
						inn += '<img class="dotShowCol" src="img/spacer.gif" onclick="javascript:'+this.id+'.showCol(\''+
						this.availableCols[j]+'\');" '+
						'onmousemove="return hoverlib(this, event, \'Pokaż kolumnę <b>'+
						this.colHeaders[j]+'</b>\', 160);" onmouseout="return nd();" width="10" height="10" />';
					}
				}
				if (this.visibleCols[i]=='cartQty' || this.visibleCols[i]=='laterQty') {
					inn += '<br/><img src="img/spacer.gif" width="65" height="1" />';
				} else {
					inn += '<br/><img src="img/spacer.gif" width="1" height="1" />';
				}
			}
			if (this.deleteEnabled) {
				inn += '<td class="topheader">&nbsp;</td>';
			}
			inn += '</tr>';
			return inn;
		},
		hideCol: function (name) {
			this.preHideCol (name);
			nd();
			this.display();
		},
		preHideCol: function (name) {
			for (var i=0; i<this.visibleCols.length; i++) {
				if (this.visibleCols[i]==undefined) continue;
				if (this.visibleCols[i]==name) break;
			}
			if (i==this.visibleCols.length) return;
			this.visibleCols.splice (i, 1);
		},
		deleteAvailableRow: function (name) {
			for (var i=0; i<this.availableCols.length; i++) {
				if (this.availableCols[i]==undefined) continue;
				if (this.availableCols[i]==name) break;
			}
			if (i<this.availableCols.length) {
				this.availableCols.splice (i, 1);
				this.sortableCols.splice (i, 1);
				this.hidableCols.splice (i, 1);
				this.colHeaders.splice (i, 1);
			}
			for (var i=0; i<this.visibleCols.length; i++) {
				if (this.visibleCols[i]==undefined) continue;
				if (this.visibleCols[i]==name) break;
			}
			if (i==this.visibleCols.length) return;
			this.visibleCols.splice (i, 1);
		},
		addAvailableCol: function (name) {
			this.availableCols.push(name);
			this.visibleCols.push(name);
		},
		showCol: function (name) {
			var ai = this.getAvailableColumnIndex(name);
			for (var i=0; i<this.visibleCols.length; i++) {
				if (this.visibleCols[i]==undefined) continue;
				var a0 = this.getAvailableColumnIndex(this.visibleCols[i]);
				if (a0<ai && i==this.visibleCols.length-1) break;
				var a1 = this.getAvailableColumnIndex(this.visibleCols[i+1]);
				if (a0<ai && a1>ai) break;
			}
			this.visibleCols.splice (i+1, 0, name);
			nd();
			this.display();
		},
		innerHeader: function () {
			var inn = '<tr class="header">';
			for (var i=0; i<this.visibleCols.length; i++) {
				var ai = this.getAvailableColumnIndex(this.visibleCols[i]);
				inn += '<td class="header';
				if (i==0) inn+= ' first';
				if (this.sortableCols[ai]) {
					inn += '" style="cursor: pointer;" onclick="'+
					this.id+'.changeSort(\''+this.visibleCols[i]+'\');'
				}
				inn += '">';
				inn += this.colHeaders[ai];
				if (this.sortableCols[ai] && this.sortBy==this.visibleCols[i]) {
					inn += '&nbsp;&nbsp;<img src="img/spacer.gif" width="10" height="10" class="';
					inn += (this.sortOrder=='asc') ? 'dotAsc' : "dotDesc";
					inn += '" />';
				}
				inn += "</td>";
			}
			if (this.deleteEnabled) {
				if (this.isCart) {
					inn += '<td class="header">&nbsp;</td>';
				} else {
					inn += '<td class="header" id="'+this.id+'_closeAll">'+
						'<div class="dotClose" id="'+this.id+'_dotCloseAll" ';
						inn += ' onclick="javascript:'+
						this.id+'.deleteAll();" onmousemove="return '+
						'hoverlib(this, event, \'Usuń wszystkie wiersze\', 110);" '+
						'onmouseout="return nd();"></div>';
						inn += '</td>';				
				}
			}
			inn += '</tr>';
			return inn;
		},
		getAvailableColumnIndex: function (name) {
			for (var i=0; i<this.availableCols.length; i++) {
				if (this.availableCols[i]==name) return i;
			}
			return i;
		},
		changeSort: function (name) {
			var ai = this.getAvailableColumnIndex(name);
			if (!this.sortableCols[ai]) return;
			if (this.sortBy==name) {
				this.sortOrder = (this.sortOrder=='asc') ? 'desc' : 'asc';
			} else {
				this.sortBy = name;
				this.sortOrder = 'asc';
			}
			this.sort();
		}
	}
	obj.init(xid, xcontainer, xnoCardsComment, xdeleteEnabled, xlogin);
	allCardTables.push(obj);
	return obj;
}


