function print_table_header() {
	var sTableStyle, sTRStyle, sTDStylePrice, sTDStyle, sCSSTable, sCSSTR, sCSSTD, sBorder;
	sBorder = gb_BorderSize + ' ' + gb_BorderStyle + ' ' + gb_BorderColor + ';';
	
	if (gb_use_other == 'y') {
		sTRStyle = ' style="background-color:' + gb_HeaderBackgroundColor + '";';
		
		sTDStyle = ' style="font-family:' + gb_FontFamily + '; font-weight:bold; font-size:' + gb_FontSize + '; color:' + gb_HeaderTextColor + ';';
		if (gb_BorderType == 'all') {
			sTDStyle += ' border-left:' + sBorder;
		}
		sTDStyle += '"';

		sTDStylePrice = ' style="font-family:' + gb_FontFamily + '; font-weight:bold; font-size:' + gb_FontSize + '; color:' + gb_HeaderTextColor + ';"';
	} else {
		sTRStyle = '';
		sTDStyle = '';
	}

	if (gb_use_css == 'y') {
		sCSSTable = ' class="' + gb_table_class + '"';
		sCSSTR = ' class="' + gb_header_tr_class + '"';
		sCSSTD = ' class="' + gb_header_td_class + '"';
	} else {
		sCSSTable = '';
		sCSSTR = '';
		sCSSTD = '';
	}

	sTableStyle = '';
	if (gb_BorderType == 'all') {
		sTableStyle += ' style="border:' + sBorder + '"';
	} else if (gb_BorderType == 'edge') {
		sTableStyle += ' style="border:' + sBorder + '"';
	}

	document.write('<table' + sCSSTable + sTableStyle + ' width=' + gb_TableWidth + ' cellspacing="0">');
	document.write('	<tr' + sCSSTR + sTRStyle + '">');
	document.write('		<td' + sCSSTD + sTDStylePrice + '>Price</td>');
	document.write('		<td' + sCSSTD + sTDStyle + '>Station</td>');
	
	document.write('		<td' + sCSSTD);
	if (gb_TableStyle == '4') {
		document.write(' style="display:none;"');
	} else if (gb_TableStyle == '5') {
		document.write(sTDStyle);
	}
	document.write('>Address</td>');
	
	document.write('		<td' + sCSSTD + sTDStyle + ';">City</td>');
	document.write('		<td' + sCSSTD + sTDStyle + ';">Time</td>');
	document.write('	</tr>');
}


function print_table_footer() {
	document.write('</table>');
}

function print_prices_table(x) {
	var sTRStyle, sTDStylePrice, sTDStyle, sCSSTR, sCSSTD, sBorder;
	
	if (gb_use_other == 'y') {
		sBorder = gb_BorderSize + ' ' + gb_BorderStyle + ' ' + gb_BorderColor + ';';
		sTRStyle = ' style="background-color:' + gb_TableBodyBackgroundColor + '";';
		
		sTDStyle = ' style="font-family:' + gb_FontFamily + '; font-size:' + gb_FontSize + '; color:' + gb_TableBodyTextColor + ';';
		if (gb_BorderType == 'all') {
			sTDStyle += ' border-left:' + sBorder + ' border-top:' + sBorder;
		} else if (gb_BorderType == 'rows') {
			sTDStyle += ' border-bottom:' + sBorder;
		} else if (gb_BorderType == 'cols') {
			sTDStyle += ' border-left:' + sBorder;
		}
		sTDStyle += '"';
		
		sTDStylePrice = ' style="font-family:' + gb_FontFamily + '; font-size:' + gb_FontSize + '; color:' + gb_TableBodyTextColor + ';';
		if (gb_BorderType == 'all') {
			sTDStylePrice += ' border-top:' + sBorder;
		} else if (gb_BorderType == 'rows') {
			sTDStylePrice += ' border-bottom:' + sBorder;
		}
		sTDStylePrice += '"';
	} else {
		sTRStyle = '';
		sTDStyle = '';
	}

	if (gb_use_css == 'y') {
		sCSSTR = ' class="' + gb_body_tr_class + '"';
		sCSSTD = ' class="' + gb_body_td_class + '"';
	} else {
		sCSSTR = '';
		sCSSTD = '';
	}

	document.write('	<tr' + sCSSTR + sTRStyle + '>');
	document.write('		<td' + sCSSTD + sTDStylePrice + '><span id="spnGBPrice' + x + '">&nbsp;</span></td>');

	document.write('		<td' + sCSSTD + sTDStyle + '><b><span id="spnGBStationNm' + x + '">&nbsp;</span></b><br><span id="spnGBAddress' + x + '"');
	if (gb_TableStyle == '5') {
		document.write(' style="display:none;"');
	}
	document.write('>&nbsp;</span></td>');
	
	document.write('		<td' + sCSSTD);
	if (gb_TableStyle == '4') {
		document.write(' style="display:none;"');
	} else if (gb_TableStyle == '5') {
		document.write(sTDStyle);
	}
	document.write('><span id="spnGBAddress2_' + x + '">&nbsp;</span></td>');
	
	document.write('		<td' + sCSSTD + sTDStyle + '><span id="spnGBArea' + x + '">&nbsp;</span></td>');
	document.write('		<td' + sCSSTD + sTDStyle + '><span id="spnGBTme' + x + '">&nbsp;</span></td>');
	document.write('	</tr>');
}

function main() {
	var i;
	document.write('<div id="divGBPriceTable" style="visibility:hidden;">');

	print_table_header();
	for (i = 0; i < 10; ++ i) {
	   print_prices_table(i);
	}
	print_table_footer();

	document.write('</div>');
}

main();
