<?php 

if (strstr($PATH_INFO, "/")) {
	$p = substr($PATH_INFO, 1);
	$e_path = explode("/", $p);
	$i = 0;
	while ($i < count($e_path)) {
		$name = $e_path[$i];
		$val = $e_path[$i+1];
		$$name = $val;
		$i = $i+2;
	}
}

if (strstr($REQUEST_URI, "/espanol/")) {
	$lang = "es";
	$dir = "espanol";
	$lenguaid = "1";
} 
if (strstr($REQUEST_URI, "/francais/")) {
	$lang = "fr";
	$dir = "francais";
	$lenguaid = "2";
} 
if (strstr($REQUEST_URI, "/english/")) {
	$lang = "en";
	$dir = "english";
	$lenguaid = "3";
} 
if (strstr($REQUEST_URI, "/texto/")) {
	$dir = "texto/".$dir;
}

// descripcion por idioma

if ($lang == "es") {
	$label_seccion = "LA INSTITUCIÓN";
	$label_titulo = "Estatutos e informaciones presupuestarias";
	$label_estatutos = "Estatutos";
	$label_presup = "Informaciones presupuestarias";
	$label_estatutos_rd = "Rep&uacute;blica Dominicana";
	$label_estatutos_fr = "Francia";
	$label_estatutos_ve = "Venezuela";
	$label_presup_prov = "Datos provisionales, 1996";
	$label_presup_persp = "Perspectivas financieras, 1996";

	$label_campo_lengua = "Lengua original";
	$label_campo_fechadecreacion = "Fecha de creaci&oacute;n";
	$label_campo_fechamod = "Fecha de modificaci&oacute;n de HTML";
} else if ($lang == "fr") {
	$label_seccion = "L'INSTITUTION";
	$label_titulo = "Statuts et informations budgétaires";
	$label_estatutos = "Statuts";
	$label_presup = "Informations budgétaires";
	$label_estatutos_rd = "R&eacute;publique Dominicaine";
	$label_estatutos_fr = "France";
	$label_estatutos_ve = "Venezuela";
	$label_presup_prov = "Donn&eacute;es provisoires, 1996";
	$label_presup_persp = "Perspectives financi&egrave;res, 1996";

	$label_campo_lengua = "Langue Originelle";
	$label_campo_fechadecreacion = "Date de publication";
	$label_campo_fechamod = "Date d'actualization du HTML";
} else if ($lang == "en") {
	$label_seccion = "OUR INSTITUTION";
	$label_titulo = "Articles of Incorporation and Budget Information";
	$label_estatutos = "Articles of Incorporation";
	$label_presup = "Budget Information";
	$label_estatutos_rd = "Dominican Republic";
	$label_estatutos_fr = "France";
	$label_estatutos_ve = "Venezuela";
	$label_presup_prov = "Provisional Data, 1996";
	$label_presup_persp = "Financial Perspectives, 1996";

	$label_campo_lengua = "Original Language";
	$label_campo_fechadecreacion = "Date of Publication";
	$label_campo_fechamod = "Date of HTML Modification";
}

if (!$docid) {
	$titulo = $label_titulo;
}

// termina descripcion por idioma

echo "<font face=\"verdana, arial, helvetica\" size=-1>";
$conn = pg_pconnect("dbname=sif user=mike");

include("../header.php3");	
	include("institucion_mapa.inc");
?>
	<table width=100% border=0 cellpadding=0 cellspacing=0>
		<tr>
			<td width=175 valign=top>
				<table width=100% cellpadding=3 cellspacing=0 bgcolor="<?php echo $bg_menu ?>" border=0><tr><td>
				<table width=100% cellpadding=3 cellspacing=0>
					<tr>
						<td bgcolor="<?php echo $bg_menu ?>"><font face="<?php echo $font1 ?>" color="<?php echo $font_menu_title ?>" size=-1>
							<center><b><?php echo $label_seccion ?></b></center>
						</td>
					</tr>
					<tr>
						<td bgcolor="<?php echo $bg_menu_body ?>"><font face="<?php echo $font1 ?>" color="<?php echo $font_menu_body ?>" size=-2>
<?php 
							$i = 1;
							while ($i <= $total) {
								$temp = "label_$i";
								$label = "label_".$$temp;
								$url = "url_".$$temp;
								if ($REQUEST_URI != $$url) {
									echo "<a href=\"".$$url."\">".$$label."</a>\n<p>\n";
								}
								$i++;
							}
?>
							<br></br>
						</td>
					</tr>
				</table>
				</td></tr></table>
			</td>
			<td valign=top>

				<table width=100% cellpadding=3 cellspacing=0 border=0>
					<tr>
						<td valign=top>
<?php


$querypresup = pg_exec($conn, "SELECT docid, titulo_$lang FROM principal WHERE tipo=14 ORDER BY fechadecreacion DESC");

echo "<font size=-2 face=\"$font1\"><a href=\"/\">FUNREDES</a> <b>:</b> <a href=\"/$dir/institucion/\">$label_seccion</a> <b>: $titulo</b><p>";
echo "<center><font face=\"$font1\" size=+2>$titulo</font><font size=-1></center>";
echo "<font size=-1 color=black><p>";
echo "<blockquote>\n";
?>
	<b><?php echo $label_estatutos ?>:</b><p>
	
	<a href="institucion.php3/docid/282"><?php echo $label_estatutos_rd ?></a><br>
	<a href="institucion.php3/docid/283"><?php echo $label_estatutos_fr ?></a><br>
	<a href="institucion.php3/docid/456"><?php echo $label_estatutos_ve ?></a><p>

	<b><?php echo $label_presup ?>:</b><p>

<?php 
	if (pg_numrows($querypresup) != 0) {
		$j = 0;
		while ($j < pg_numrows($querypresup)) {
			$getpresup = pg_fetch_row($querypresup, $j);
			echo "<a href=\"institucion.php3/docid/$getpresup[0]\">$getpresup[1]</a><br>\n";
			$j++;
		}
	}

?>
							</blockquote>
						</td>
					</tr>
				</table>
			</td></tr></table>
<?php


// empieza informacion basica




include("../footer.php3");
?>
