<script  type="text/javascript">
v  = new Date();
p  = 0;
g  = {b_hangar_id_plus};
s  = 0;
hs = 0;
of = 1;
c  = new Array({c}'');
b  = new Array({b}'');
a  = new Array({a}'');
aa = '{completed}';

function t() {
	if ( hs == 0 ) {
		xd();
		hs = 1;
	}
	n = new Date();
	s = c[p] - g - Math.round((n.getTime() - v.getTime()) / 1000.);
	s = Math.round(s);
	m = 0;
	h = 0;
	if ( s < 0 ) {
		a[p]--;
		xd();
		if ( a[p] <= 0 ) {
			p++;
			xd();
		}
		g = 0;
		v = new Date();
		s = 0;
	}
	if ( s > 59 ) {
		m = Math.floor(s / 60);
		s = s - m * 60;
	}
	if ( m > 59 ) {
		h = Math.floor(m / 60);
		m = m - h * 60;
	}
	if ( s < 10 ) {
		s = "0" + s;
    }
    if (m < 10) {
      m = "0" + m;
	}
	if ( p > b.length - 2 ) {
		document.getElementById("bx").innerHTML=aa ;
    } else {
		document.getElementById("bx").innerHTML=b[p]+" "+h+":"+m+":"+s;
    }
	window.setTimeout("t();", 200);
}

function xd() {
	while (document.Atr.auftr.length > 0) {
		document.Atr.auftr.options[document.Atr.auftr.length-1] = null;
	}
	if ( p > b.length - 2 ) {
		document.Atr.auftr.options[document.Atr.auftr.length] = new Option(aa);
	}
	for ( iv = p; iv <= b.length - 2; iv++ ) {
		if ( a[iv] < 2 ) {
			ae = " ";
		} else {
			ae = " ";
		}
		if ( iv == p ) {
			act = " ({in_working})";
		} else {
			act = "";
		}
		document.Atr.auftr.options[document.Atr.auftr.length] = new Option( a[iv] + ae + " \"" + b[iv] + "\"" + act, iv + of );
	}
}

window.onload = t;
</script>
	<form name="Atr" method="get" action="buildings.php">
		<input type="hidden" name="mode" value="fleet">
		<table width="650">
			<tr>
				<td class="c" >{work_todo}</td>
			</tr>
			<tr>
				<th algin="center">¡¾{bu_now_build}£º<span id=bx class=z></span>¡¿&nbsp;&nbsp; ¡¾{total_left_time}£º{pretty_time_b_hangar}¡¿</th>
			</tr>
			<tr>
				<th ><select name="auftr" size="10"></select></th>
			</tr>
			<tr>
				<td class="c" >&nbsp;</td>
			</tr>
		</table>
	</form>
</center>