<div id="accoes_bg">
	<div id="titulo_accao"><nobr><?php echo translateAdmin('Tradu&ccedil;&otilde;es');?></nobr></div>
</div>

<div id="conteudo_translater">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td nowrap="nowrap" >
				<div style="padding:2px 0px 2px 25px; background-color:#ffffdd;">
					<form action="" id="langs_visiveis">
						<?php echo translateAdmin('Linguas vis&iacute;veis para tradu&ccedil;&atilde;o');?>: &nbsp;&nbsp;
						<?php 	foreach ($langs as $lang => $lang_titulo): ?>
							<input type="checkbox" name="trans_lang" value="<?php echo $lang?>" onclick="javascript: actualiza_table_traducoes()">&nbsp;<?php echo $lang_titulo?>&nbsp;&nbsp;&nbsp;&nbsp;
						<?php	endforeach;?>
					</form>
				</div>
			</td>
		</tr>
		<form action="" method="POST">
		<tr>
			<td align="center" valign="top" id="manutencaodisplay" width="100%">
				<div class="acessibilidade">
                	<span>
					<?php if (isset($links['delete_link'])) : ?>
						<input type="button" id="delete_link" name="delete_link" value="<?php echo translateAdmin('Remover');?>" class="form_delete" onClick="if (confirm('<?php echo translateAdmin('Tem a certeza que deseja remover o item seleccionado');?>?')) { location='<?php echo $this->link($delete_link); ?>'; } "/>
					<?php endif; ?>
					<?php if (isset($links['save'])) : ?>
						<input type="submit" name="save_link" value="<?php echo translateAdmin('Guardar');?>" class="form_submit" style="width:85px;"/>
					<?php endif; ?>
                    </span>
				</div>
			</td>
		</tr>
		<tr>
			<td align="center">
				<div id="rte">
					<table id="table_traducoes" border="0" cellpadding="0" cellspacing="0">
						<?php foreach ($traducoes as $traducao_id => $traducao) :?>
							<tr>
								<td style="padding:0px 10px 10px 10px;" align="left">
									<div>
									<table class="item" cellpadding="0" cellspacing="0" border="0" width="98%">
										<tr>
											<td width="100%" colspan="2" style=" padding-bottom:5px;"><b><?php echo $traducao['texto']?></b></td>
										</tr>
										<?php foreach ($langs as $lang => $lang_titulo):?>
											<tr class="linha_<?php echo $lang?>" style="display: none;">
												<td width="5%" style="padding-top:10px;" align="center"><img src="/admin/media/images/flag-<?php echo strtoupper($lang)?>.gif" border="0" height="11" width="16"></td>
												<td width="95%" style="padding-top:10px;">
													<textarea name="texto_<?php echo $traducao_id?>_<?php echo $lang?>" rows="1"  onchange="document.getElementById('texto_<?php echo $traducao_id?>_<?php echo $lang?>_change').value = 'true';" style="width:100%"><?php echo $traducao[$lang]?></textarea><input type="hidden" id="texto_<?php echo $traducao_id?>_<?php echo $lang?>_change" name="texto_<?php echo $traducao_id?>_<?php echo $lang?>_change" value="false"/>
												</td>
											</tr>
										<?php endforeach; ?>
									</table>
									</div>
								</td>
							</tr>
						<?php endforeach;?>
					</table>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="acessibilidade">
                	<span>
					<?php if (isset($delete_link)) : ?>
						<input type="button" id="delete_link" name="delete_link" value="<?php echo translateAdmin('Remover');?>" class="form_delete" onClick="if (confirm('<?php echo translateAdmin('Tem a certeza que deseja remover o item seleccionado');?>?')) { location='<?php echo $this->link($delete_link); ?>'; } "/>
					<?php endif; ?>
					<?php if (isset($links['save'])) : ?>
						<input type="submit" name="save_link" value="<?php echo translateAdmin('Guardar');?>" class="form_submit" style="width:85px;"/>
					<?php endif; ?>
                    </span>
				</div>
				<div class="paginator"><?php echo $paginator_output; ?></div>
			</td>
		</tr>
		</form>
	</table>
</div>
<script type="text/javascript">
	function actualiza_table_traducoes() {
		var formulario = document.getElementById("langs_visiveis");
		var tbl  = document.getElementById('table_traducoes');
		var num_langs = 1;
		if(formulario.trans_lang.length > 0){
			for(var i = 0; i < formulario.trans_lang.length; i++){
				if (formulario.trans_lang[i].checked == true) stl = ''
	   			else         stl = 'none';
				var rows = tbl.getElementsByTagName('tr');
				for (var row=0; row < rows.length;row++) {
	      			if(rows[row].className == 'linha_' + formulario.trans_lang[i].value) rows[row].style.display=stl;
	    		}
			}
		}
		else {
			if (formulario.trans_lang.checked == true) stl = ''
	   		else         stl = 'none';
			var rows = tbl.getElementsByTagName('tr');
			for (var row=0; row < rows.length;row++) {
	      		if(rows[row].className == 'linha_' + formulario.trans_lang.value) rows[row].style.display=stl;
	    	}
		}		
	}
</script>
<?php //Goweb::dump($traducoes2);?>
<?php //Goweb::dump($traducoes3);?>