

function Table(objectName,tableContainer) {

this.id 			= objectName; // Nazwa obiektu robi za id na stronie
this.tableData 		= new Array(); // Tablica z rekordami
this.headerIndex 	= 0; // Ilosc kolumn
this.headers 		= new Array(); // Tablica z naglowkami
this.rowsPerPage 	= 20; // Ilosc wierszy na strone
this.recordsNumber 	= 0;
this.pageNumber 	= 1; // Ilosc stron
this.selectRange 	= 4; // Zasieg selektora wyboru podstron (w lewo i prawo od aktualnej strony)
this.page 			= 1; // # aktualnej strony

this.IE = document.all?true:false; // Mialem nadzieje ze to nie bedzie potrzebne :/
this.firstLoad = true;

this.tableContainer = document.getElementById(tableContainer); // Uchwyt "pojemnika" tabeli

this.showHeaders 		= true; // Czy pokazywac naglowki kolumn
this.showPageSelect 	= true; // Czy pokazywac wybor podstrony
this.showTopPageSelect 	= true; // Czy pokazywac gorny wybor
this.showBottomPageSelect = true; // Czy pokazywac dolny wybor
this.showPerPageCombo 	= true; // Czy pokazywac combo z wyborem rekordow na stronie
this.usePageLoader 		= false; // Czy pokazywac loader strony na klikniecie

this.orderBy 	= 0; // Kolumna po ktorej bedzie sortowanie, od 1 w gore
this.sortDir 	= 1; // Kierunek sortowania 1-rosnaco, 0-malejaco
this.sortAsc 	= 1;
this.sortDesc 	= 0;

this.startSort 	= false; // Sortowanie jest odpalane tylko kiedy ustawiona na 'false'

this.timer 			 = false; // Uchwyt setInterval()
this.delay 			 = 1000; // Opoznienie generowania tabeli w milisekundach
this.rowsStartLoader = 0; // Liczba rekordow od ktorej bedzie pokazywal sie loader tabeli (nie dotyczy opcji loadera strony)

this.pageClass 			= 'jsTableLink'; // Klasa CSS linkow wyboru strony
this.pageClassSelected 	= 'jsTableLinkSelected'; // Klasa CSS linka wybranej strony

this.perPageComboValues = [5,10,15,20,25,30,40,50,65,80,100,120,150,200]; // Wybor ilosci rekordow na strone
this.formActions 		= new Array();

//======= Znaczniki =========
this.tableBgClass 	= 'tableJsBackground';
this.tableId 		= this.id;
this.tableClass 	= 'table';
this.tableStyle 	= new Array();
this.tableOther 	= '';

this.thStyle = new Array();
this.tdStyle = new Array();

this.tableLoaderId 		= 'tableLoader';
this.tableLoaderClass 	= 'jsTableLoader';
this.loaderStyle 		= new Array();
//===========================


// ==================== Szablony =====================
this.tableHeader 	= '<div{tableBgClass}><table{tableId}{tableClass}{tableStyle}{tableOther} cellspacing="0">\n';

this.thHeader 		= '\t<tr>\n';
this.thCell 		= '\t\t<th align="center"{thStyle}>\n{content}\n\t\t</th>\n';
this.thFooter 		= '\t</tr>\n';

this.tdHeader 		= '\t<tr class="tr_out" onmouseover="this.className=\'tr_over\'" onmouseout="this.className=\'tr_out\'">\n';
this.tdCell 		= '\t\t<td align="center" class="td_class"{tdStyle}>\n\t\t\t{content}\n\t\t</td>\n';
this.tdFooter 		= '\t</tr>\n';

this.noRecords 		= '\t\t<td align="center" class="td_class"{colspan}>\n\t\t\t{content}\n\t\t</td>\n';

this.tableFooter 	= '</table></div>\n';

this.perPageCombo 	= '<table class="jsFooterContainer"><tr><td id="{tableId}perPageCombo" class="jsTablePerPageCombo" align="left"></td>\n';
this.pageSelector 	= '<td id="{tableId}pageSelector" class="jsTablePageSelector" align="right"></td></tr></table>\n';

this.tableLoader 	= '\t<tr>\n\t\t<td{tableLoaderId}{tableLoaderClass}{loaderStyle} align="center" class="td_class"{colspan}>\n\t\t\t{content}\n\t\t</td>\n\t</tr>\n';

this.checkbox 		= '<input type="checkbox" name="id[]" value="{value}" style="border:none; background:none; vertical-align:middle" />';
// ===================================================


//============== Zmienne jezykowe ==================
this.langNoRecordsMessage 		= 'No records to display';
this.langNoHeadersMessage 		= 'Table has no headers!';
this.langTableIsLoading 		= 'Please wait...';
this.langNoTableContainer 		= 'No table container';
this.langSelectRecordsPerPage 	= 'Select rows per page ';
this.langPage 					= 'Page';
this.langPageFrom 				= 'from';
this.langRecords 				= 'Records';
this.langSelectJsTableFormAll 	= 'Select all';
this.langSelectJsTableFormNone 	= 'Select none';
this.langSubmitJsTableForm 		= 'Submit';
//==================================================


//================ Metody klasy ====================
this.addHeader 			= addHeader;

this.parseTable 		= parseTable;
this.parseHeaders 		= parseHeaders;
this.parseThCell 		= parseThCell;
this.parseTdCell 		= parseTdCell;
this.parseNoRecords		= parseNoRecords;
this.parseTableLoader 	= parseTableLoader;

this.parseStyle 	= parseStyle;
this.pregReplace 	= pregReplace;
this.arrayReplace 	= arrayReplace;

this.write 			= write;

this.createPerPageComboIE 		= createPerPageComboIE;
this.createPerPageComboGecko 	= createPerPageComboGecko;
this.createPageSelector 		= createPageSelector;

this.getPage		= getPage;
this.setOrderBy		= setOrderBy;
this.setSortDir		= setSortDir;
this.setRowsPerPage	= setRowsPerPage;

this.compare 				= compare;
this.compare.compareRows 	= compare.compareRows;
this.convert 				= convert;
this.sortTableData 			= sortTableData;

this.getHeight 		= getHeight;
this.maintainHeight = maintainHeight;

this.showPageLoader  = showPageLoader;
this.hidePageLoader  = hidePageLoader;

this.setCheckbox 	 = setCheckbox;

this.showTableLoader = showTableLoader;
this.createTable 	 = createTable;
this.sortTable 		 = sortTable;

this.startTimer		= startTimer;
this.clearTimer		= clearTimer;

this.show  			= show;
//==================================================


// Dodaje naglowki/definiuje kolumny
function addHeader(headerTitle,sort,type) {
	this.headerIndex++;
	this.headers[this.headerIndex] = new Array();
	this.headers[this.headerIndex][0] = sort;
	this.headers[this.headerIndex][1] = headerTitle;
	this.headers[this.headerIndex][2] = type;
}


//
function parseTable() {
	
	var _tableBgClass = this.tableBgClass!=''?' class="'+this.tableBgClass+'"':'';
	var _id    = this.tableId!=''?' id="'+this.tableId+'"':'';
	var _class = this.tableClass!=''?' class="'+this.tableClass+'"':'';
	var _style = this.parseStyle(this.tableStyle);
	var _other = this.tableOther!=''?' '+this.tableOther+'"':'';
	
	var data = new Array();
	data[0] = new Array();
	data[0][0] = 'tableBgClass';
	data[0][1] = _tableBgClass;
	data[1] = new Array();
	data[1][0] = 'tableId';
	data[1][1] = _id;
	data[2] = new Array();
	data[2][0] = 'tableClass';
	data[2][1] = _class;
	data[3] = new Array();
	data[3][0] = 'tableStyle';
	data[3][1] = _style;
	data[4] = new Array();
	data[4][0] = 'tableOther';
	data[4][1] = _other;
	
	var text = this.arrayReplace(data,this.tableHeader);
	
return text;
}


//
function parseHeaders() {
	
	var headers = this.thHeader;
	
	for(i=1;i<=this.headerIndex;i++) {	
		var sort = this.headers[i][0];
		var text = this.headers[i][1];
		var type = this.headers[i][2];
		
		var sortOrder = this.sortDir==this.sortAsc?this.sortDesc:this.sortAsc;
		sortOrder = this.orderBy==i?sortOrder:this.sortDir;
		var thisSort = this.sortDir==this.sortDesc?'&#8593;':'&#8595;';
		thisSort = this.orderBy==i?thisSort:'&nbsp;';
		text = text!=''?text:'&nbsp;';
		var text = sort===true && this.recordsNumber>0?'<a href="javascript:void(0)\" onclick=\"'+this.id+'.sortTable('+this.page+','+i+','+sortOrder+',\''+type+'\')" onfocus="blur()">'+text+'</a>'+thisSort:text;
		headers += this.parseThCell(i).replace('{content}',text);
	}
	
	headers += this.thFooter;
	
return headers;
}


//
function parseThCell(colId) {
	var thId = colId-1;
	var _style = colId && this.thStyle[thId]?this.parseStyle(this.thStyle[thId]):'';
	
	var data = new Array();
	data[0] = new Array();
	data[0][0] = 'thStyle';
	data[0][1] = _style;
	
	var text = this.arrayReplace(data,this.thCell);
	
return text;
}


//
function parseTdCell(colId) {
	var tdId = colId-1;
	var _style = colId && this.tdStyle[tdId]?this.parseStyle(this.tdStyle[tdId]):'';
	
	var data = new Array();
	data[0] = new Array();
	data[0][0] = 'tdStyle';
	data[0][1] = _style;
	
	var text = this.arrayReplace(data,this.tdCell);
	
return text;
}


//
function parseNoRecords() {
	
	var data = new Array();
	data[0] = new Array();
	data[0][0] = 'colspan';
	data[0][1] = ' colspan="'+this.headerIndex+'"';
	data[1] = new Array();
	data[1][0] = 'content';
	data[1][1] = this.langNoRecordsMessage;
	
	var text = this.arrayReplace(data,this.noRecords);
	
return text;
}


//
function parseTableLoader(text) {
	
	var text = text && text!=''?text:this.tableLoader;
	
	var _style = this.loaderStyle?this.parseStyle(this.loaderStyle):'';
	
	var data = new Array();
	data[0] = new Array();
	data[0][0] = 'colspan';
	data[0][1] = ' colspan="'+this.headerIndex+'"';
	data[1] = new Array();
	data[1][0] = 'content';
	data[1][1] = this.langTableIsLoading;
	data[2] = new Array();
	data[2][0] = 'tableLoaderId';
	data[2][1] = ' id="'+this.id+this.tableLoaderId+'"';
	data[3] = new Array();
	data[3][0] = 'tableLoaderClass';
	data[3][1] = ' class="'+this.tableLoaderClass+'"';
	data[4] = new Array();
	data[4][0] = 'loaderStyle';
	data[4][1] = _style;
	
	var text = this.arrayReplace(data,text);
	
return text;
}


//
function parseStyle(styleArray) {
	if (styleArray.length<=0) return '';
	
	var styleSting = new String();
	var styleTags = new Array();
	
	for(sKey=0;sKey<styleArray.length;sKey++) {
		if (!styleArray[sKey]) continue;
		styleTags[sKey] = styleArray[sKey][0]+':'+styleArray[sKey][1];
	}
	if (styleTags.length>0)
		styleString = ' style="'+styleTags.join('; ')+'"';
		
return styleString;	
}


//
function createPerPageComboIE(id) {
	if (!this.perPageComboValues || this.perPageComboValues.length<=0) return '';
	
	var id = id && id>0?id:2;
	var comboDiv = document.getElementById(this.id+id+'perPageCombo');
	if (!comboDiv) return;
	
	var combo = this.langSelectRecordsPerPage;
	combo += '<select onchange="'+this.id+'.setRowsPerPage(this.value); '+this.id+'.createTable('+this.page+')">\n';
	for(i=0;i<this.perPageComboValues.length;i++) {
		var sel = this.perPageComboValues[i]==this.rowsPerPage?' selected="selected"':'';
		combo += '<option'+sel+' value="'+this.perPageComboValues[i]+'">'+this.perPageComboValues[i]+'</option>\n';
	}
	combo += '</select>\n';
	
	comboDiv.innerHTML = combo;
}


//
function createPerPageComboGecko(id) {
	if (!this.perPageComboValues || this.perPageComboValues.length<=0) return '';
	
	var id = id && id>0?id:2;
	var comboDiv = document.getElementById(this.id+id+'perPageCombo');
	if (!comboDiv) return;
	
	var combo = document.createElement('select');
	combo.setAttribute('onchange',this.id+'.setRowsPerPage(this.value); '+this.id+'.createTable('+this.page+')');
	
	for(i=0;i<this.perPageComboValues.length;i++) {
		var option = document.createElement('option');
		option.appendChild(document.createTextNode(this.perPageComboValues[i]));
		option.setAttribute('value',this.perPageComboValues[i]);
		
		if (this.perPageComboValues[i]==this.rowsPerPage)
			option.setAttribute('selected','selected');
		
		combo.appendChild(option);
	}
	var description = document.createTextNode(this.langSelectRecordsPerPage);
	
	comboDiv.appendChild(description);
	comboDiv.appendChild(combo);
}


//
function createPageSelector(id) {
	
	var id = id && id>0?id:2;
	var selector = new String();
	var selectLinks = new String();
	var selectorDiv = document.getElementById(this.id+id+'pageSelector');
	var sString = new String();
	var pageSelect = new Array();
	
	if (!selectorDiv) return;
	
	sString = this.langPageStart+' '+this.page+' '+this.langPageFrom+' '+this.pageNumber+' | ';
	sString += this.langRecords+' '+this.recordsStart+'-'+this.recordsStop+' '+this.langPageFrom+' '+this.recordsNumber;
	
	if (this.page>1) {
		pageSelect.push("<a class=\"jsTableLink\" href=\"javascript:void(0)\" onclick=\""+this.id+".createTable(1)\" onfocus=\"blur()\">&lt;&lt;</a>&nbsp;");
		pageSelect.push("<a class=\"jsTableLink\" href=\"javascript:void(0)\" onclick=\""+this.id+".createTable("+(this.page-1)+")\" onfocus=\"blur()\">&lt;</a>&nbsp;");
	}
	for(i=(this.page-this.selectRange);i<=(this.page+this.selectRange);i++) {
		if (i<1 || i>this.pageNumber) continue;
		selected = i==this.page?this.pageClassSelected:this.pageClass;
		pageSelect.push("<a class=\""+selected+"\" href=\"javascript:void(0)\" onclick=\""+this.id+".createTable("+i+")\" onfocus=\"blur()\">"+i+"</a>");
	}	
	if (this.page<this.pageNumber) {
		pageSelect.push("<a class=\"jsTableLink\" href=\"javascript:void(0)\" onclick=\""+this.id+".createTable("+(this.page+1)+")\" onfocus=\"blur()\">&gt;</a>&nbsp;");
		pageSelect.push("<a class=\"jsTableLink\" href=\"javascript:void(0)\" onclick=\""+this.id+".createTable("+this.pageNumber+")\" onfocus=\"blur()\">&gt;&gt;</a>&nbsp;");
	}
	
	selectLinks = id==1?pageSelect.join("&nbsp;")+'<br />'+sString:sString+'<br />'+pageSelect.join("&nbsp;");
	selector = pageSelect.length>0?selectLinks:'';
	
	selectorDiv.innerHTML = selector;
}


//
function pregReplace(from,to,text) {
	if (from=='' || text=='') return text;
	
	var tag = '{'+from+'}';
	var arr = new Array();
	arr = text.split(tag);
	var tagCount = arr.length-1;
	//alert(from+' / '+tagCount);
	for(i=0;i<tagCount;i++)
		text = text.replace(tag,to);
	
return text;
}


//
function arrayReplace(data,text) {
	if (data.length<=0 || text=='') return text;
	
	for(key=0;key<data.length;key++) {
		if (!data[key]) continue;
		text = text.replace('{'+data[key][0]+'}',data[key][1]);
	}
return text;
}


// cos z nia nie tak, wiesza przegladarke (zapetlenie jakies pewnie)
function arrayReplaceProt(data,text) {
	if (data.length<=0 || text=='') return text;
	
	for(key=0;key<data.length;key++) {
		if (!data[key]) continue;
	
		var tag = '{'+data[key][0]+'}';
		var arr = new Array();
		arr = text.split(tag);
		var tagCount = arr.length-1;
		
		for(i=0;i<tagCount;i++)
			text = text.replace(tag,data[key][1]);
	}
return text;
}


//
function write(text) {
	document.write(text);
}


//
function getPage(){
	return this.page;
}


//
function setOrderBy(order){
	this.orderBy = order<1 || isNaN(order)?this.orderBy:parseInt(order);
}


//
function setSortDir(dir){
	this.sortDir = dir<0 || dir>1 || isNaN(dir)?this.sortAsc:parseInt(dir);
}


//
function setRowsPerPage(rows){
	this.rowsPerPage = rows<=0 || isNaN(rows)?this.rowsPerPage:parseInt(rows);
}


//
function setCheckbox(value) {
	var form = new Object();
	eval('form=document.form_'+this.id+';');
	for (var i=0;i<form.elements.length;i++) {
		if (form.elements[i].type=="checkbox") {
			form.elements[i].checked=value;
		}
	}
}


//
function convert(value,dataType) {
	switch(dataType) {
		case 'int':
			return parseInt(value);
		case 'float':
			return parseFloat(value);
		case 'date':
			return new Date(Date.parse(value));
		default:
			return value.toString();
	}
}


//
function compare(dataType) {
	var orderBy = this.orderBy;
	
	return function compareRows(row1,row2) {
				
				var col = orderBy-1;
				var val1 = convert(row1[col][0],dataType);
				var val2 = convert(row2[col][0],dataType);
				
				if (dataType=='string') {
					return val1.localeCompare(val2);
				} else {
					if (val1<val2) {
						return -1;
					} if (val1>val2) {
						return 1;
					} else {
						return 0;
					}
				}
			}
}


//
function sortTableData() {
	if (!this.headers[this.orderBy]) return;
	
	var dataType = this.headers[this.orderBy][2];
	this.recordsNumber = this.tableData.length;
	this.tableData.sort(this.compare(dataType));
	
	if (this.sortDir==this.sortDesc)
		this.tableData.reverse();
}


//
function getHeight() {
	var table = document.getElementById(this.id);
	if (!table) return;
	return table.offsetHeight;
}


//
function maintainHeight(height) {
	var loader = document.getElementById(this.id+this.tableLoaderId);
	if (loader) loader.style.height = height+'px';
}


//
function showPageLoader() {
	var el = document.getElementById('page_loader_background');
	if (!el) return;
	
	formCombosVisibility(0);
	showBlock('page_loader_background');
	showPageLoader();
}


//
function hidePageLoader() {
	var el = document.getElementById('page_loader_background');
	if (!el) return;
	
	formCombosVisibility(1);
	hidePageLoader();
	hideBlock('page_loader_background');
}


//
function showTableLoader() {
	
	if (!this.tableContainer)
		this.write('<center>'+this.langNoTableContainer+'</center>');
	
	var height = this.getHeight();
	var loaderTable = this.pregReplace('loaderStyle',' style="height:'+height+'px"',this.tableLoader);
	
	var temp = this.parseTable();
	
	if (this.showHeaders==true)
		temp += this.parseHeaders();
		
	temp += this.pregReplace('content',this.langTableIsLoading,this.parseTableLoader(loaderTable));
	temp += this.tableFooter;
	
	this.tableContainer.innerHTML = temp;
	//this.maintainHeight(height);
}


//
function createTable(page,colId,sortDir) {
	
	// Pokazywanie loadera strony jesli wlaczony
	if (this.usePageLoader===true) {
		this.showPageLoader();
	} else if (this.rowsStartLoader>=0) {
		this.showTableLoader();
	}
	
	this.startTimer(page,colId,sortDir);
}


//
function sortTable(page,colId,sortDir) {
	
	// Pokazywanie loadera strony jesli wlaczony
	if (this.usePageLoader===true) {
		this.showPageLoader();
	} else if (this.rowsStartLoader>=0) {
		this.showTableLoader();
	}
	
	this.startSort = true;
	this.startTimer(page,colId,sortDir);
}


//
function startTimer(page,colId,sortDir) {
	this.timer = setInterval(this.id+".clearTimer("+page+","+colId+","+sortDir+")",this.delay);
}


//
function clearTimer(page,colId,sortDir) {
	
	clearInterval(this.timer);
	
	this.setOrderBy(colId);
	this.setSortDir(sortDir);
	this.show(page);
	this.startSort = false;
	loadCloudAndTips();
}


//
function show(page) {
	
	if (!this.tableContainer) {
		this.write(this.langNoTableContainer);
		return;
	}
		
	// Jesli nie ma zdefiniowanych kolumn/naglowkow
	if (this.headerIndex==0) {
		this.tableContainer.innerHTML = '<center>'+this.langNoHeadersMessage+'</center>';
		return;		
	}
	
	// Sortowanie tablicy
	if (this.startSort===true || (this.orderBy>0 && this.firstLoad===true)) {
		this.sortTableData();
		this.startSort = false;
		this.firstLoad = false;
	}

this.recordsNumber = parseInt(this.tableData.length); // Ilosc rekordow

// Ilosc stron
if (this.rowsPerPage>0)
	this.pageNumber = parseInt(Math.ceil(this.recordsNumber/this.rowsPerPage));

this.page = parseInt(page); // # strony
this.page = this.page>this.pageNumber?this.pageNumber:this.page;

this.recordsStart = (this.page*this.rowsPerPage)-this.rowsPerPage+1;
this.recordsStop = this.recordsStart+this.rowsPerPage-1;
this.recordsStop = this.recordsStop>this.recordsNumber?this.recordsNumber:this.recordsStop;

// Wiersz w tablicy od ktorego zaczac wyswietlanie strony tabeli
var index = parseInt(this.page-1)*this.rowsPerPage;
index = index>0?index:0;


this.table = new String();


// Pojemnik na combo wyboru rekordow na podstrone
this.table += this.pregReplace('tableId',this.id+'1',this.perPageCombo);

// Pojemnik na combo wyboru rekordow na podstrone
this.table += this.pregReplace('tableId',this.id+'1',this.pageSelector);


if (this.formActions.length>0)
	this.table += "<form name=\"form_"+this.id+"\" action=\"\" method=\"post\">\n";

// Naglowek tabeli
this.table += this.parseTable();

// Naglowki kolumn
if (this.showHeaders==true)
	this.table += this.parseHeaders();

// Wiersze tabeli
if (this.recordsNumber>0) {
	
	for(r=1;r<=this.rowsPerPage;r++) {
		if (!this.tableData[index]) continue;
		
		var row = this.tableData[index];
		
		for(c=0;c<this.headerIndex;c++) {
			this.table += c==0?this.tdHeader:"";
				
			var colIndex = c+1;
			
			if (row[c] && row[c][1]) {
				var content = this.formActions.length>0 && c==0?this.pregReplace('value',row[c][1],this.checkbox):row[c][1];
				var cell = this.parseTdCell(colIndex).replace('{content}',content);
				cell = this.pregReplace('JS_PAGE',this.page,cell);
				this.table += cell;
			} else {
				this.table += this.parseTdCell(colIndex).replace('{content}','&nbsp;');
			}
			
			this.table += c==this.headerIndex-1?this.tdFooter:"";
		}
		index++;
	}
		
} else {
	// Jesli nie ma rekordow
	this.table += this.tdHeader;
	this.table += this.parseNoRecords();
	this.table += this.tdFooter;
}

// Stopka tabeli	
this.table += this.tableFooter;


// Pojemnik na combo wyboru rekordow na podstrone
this.table += this.pregReplace('tableId',this.id+'2',this.perPageCombo);

// Pojemnik na combo wyboru rekordow na podstrone
this.table += this.pregReplace('tableId',this.id+'2',this.pageSelector);

if (this.formActions.length>0)
	this.table += "</form>\n";

// Wstawianie tabeli w "pojemnik"
//this.table = this.table.replace('<','&lt;');
//this.table = this.table.replace('>','&gt;');
//document.getElementById('qwe').value = this.table;
this.tableContainer.innerHTML = this.table;

	// Wstawia liste do wyboru podstrony
	if (this.pageNumber>1 && this.showPageSelect==true) {
		if (this.showTopPageSelect==true)
			this.createPageSelector(1); // Nad tabela
		if (this.showBottomPageSelect==true)
			this.createPageSelector(2); // Ponizej tabeli
	}
	
	// Wstawia combo do wyboru ilosci recordow na strone
	if (this.pageNumber>0 && this.showPerPageCombo===true) {
		if (this.IE) {
			//this.createPerPageComboIE(1);
			this.createPerPageComboIE(2);
		} else {
			//this.createPerPageComboGecko(1);
			this.createPerPageComboGecko(2);
		}
	}
	
	if (this.formActions.length>0) {
		var comboDiv = document.getElementById(this.id+'2perPageCombo');
		comboInner = comboDiv.innerHTML;
		var select = '<a href="javascript:void(0)" onclick="'+this.id+'.setCheckbox(true)" onfocus="blur()">'+this.langSelectJsTableFormAll+'</a>';
		select += '&nbsp;-&nbsp;';
		select += '<a href="javascript:void(0)" onclick="'+this.id+'.setCheckbox(false)" onfocus="blur()">'+this.langSelectJsTableFormNone+'</a>';
		select += '&nbsp;<select name="action">';
		for(i=0;i<this.formActions.length;i++)
			select += '<option value="'+this.formActions[i][0]+'">'+this.formActions[i][1]+'</option>';
			
		select += '</select>';
		select += '&nbsp;<input type="submit" class="button" value="'+this.langSubmitJsTableForm+'" />';
		comboDiv.innerHTML=comboInner!=''?select+'<br />'+comboInner:select;
	}
	
	if (this.usePageLoader===true)
		this.hidePageLoader();
}

}