$(function() {
	$("table[border=1]").addClass("border1").attr("border", "0");
	
	$("#content img[align='left']").attr("align", "").addClass("align-left");
	$("#content img[align='right']").attr("align", "").addClass("align-right");
	
	$("div#sections > a").click(function() {
		$("div#sections > a[class=active]").removeClass("active");
		$("div[id^=tabs_block_]").hide();
		var tab_id = $(this).attr("id").split("tabs_tab_")[1];
		$("div#sections > a#tabs_tab_" + tab_id).addClass("active");
		$("div#tabs_block_" + tab_id).show();

		return false;
	});

	$("#menu_top_2 a:last").css("whiteSpace","nowrap");
	
	$(".colorbox").colorbox();
});

// {{{ number_format
function number_format(number, decimals, dec_point, thousands_sep) {
    // Format a number with grouped thousands
    //
    // +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/
    // +       version: 804.1712
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     bugfix by: Michael White (http://crestidg.com)
    // +     bugfix by: Benjamin Lupton
    // +     bugfix by: Allan Jensen (http://www.winternet.no)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // *     example 1: number_format(1234.5678, 2, '.', '')
    // *     returns 1: 1234.57

    var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals
    var d = dec_point == undefined ? "," : dec_point
    var t = thousands_sep == undefined ? "." : thousands_sep, s = n < 0 ? "-" : ""
    var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0

    return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "")
}// }}}

function get_html_cost(cost) {
	return number_format(cost, 0, ".", " ");
}


