<?
session_start();

include("stilos/config.inc.php");
include("../clases/BDConexion.php");
  include("../clases/clsUsuario.php");
  include("Funciones.php");
  
  $objMenug=new clsUsuario;
  $objMenug1=new clsUsuario;
?>
<?php
$url="cvp_cerrar_session2.php";
$url2="cvp_principal.php";
?>
<html>
<script language="JavaScript"> 
function cierrame() {
var con;
con=event.returnValue = "";
	if (confirm("desea cerrar la session")){	
	window.location="<? echo  $url ?>";
	//con=event.returnValue = ""; 	
	}else{	
	window.location="<? echo  $url2 ?>";
	//con=event.returnValue = ""; 
	}

} 
</script>

<SCRIPT language=Javascript>
//*************************** FUNCION BANNER 1 DE LA BARRA DE ESTADO *************************//

var speed = 70
var pause = 400
var timerID = null
var bannerRunning = false
var ar = new Array()
ar[0] = "Bienvenido Sr: <? echo $_SESSION['usuarioNombre']?>"
var currentMessage = 0
var offset = 0
function stopBanner() {
if (bannerRunning)
clearTimeout(timerID)
bannerRunning = false
}
function startBanner() {
stopBanner()
showBanner()
}
function showBanner() {
var text = ar[currentMessage]
if (offset < text.length) {
if (text.charAt(offset) == " ")
offset++
var partialMessage = text.substring(0, offset + 1)
window.status = partialMessage
offset++ 
timerID = setTimeout("showBanner()", speed)
bannerRunning = true
}
}
startBanner();
//*************************** Fin *************************//
</SCRIPT>
<script language="JavaScript">
<!--
var MenuPrincipal = [
	<? 
	$resultado=$objMenug->getMenuGrupo($_SESSION['usuarioId']);
    while($filas=$objMenug->NextRow($resultado))
	{
	//$nfilas=$objMenug->totalrows($resultado);
	$idmenugrupo=$filas['idmenugrupo'];
	?>	
	[null,"<? echo "|".$filas['nommenugrupo']."|";?>",null,null,"<? echo $filas['nommenugrupo']?>",
		<? 
		$resultados=$objMenug1->getMenuItems($idmenugrupo,$_SESSION['usuarioId']);
        while($filass=$objMenug1->NextRow($resultados))
	    {
		$nommenu1=$filass['nommenu'];
		$marca=$filass['marca'];
			if($marca=='x'){
		?>		
				[null, "<? echo $filass['nommenu']?>","<? echo $filass['archivo']?>",'principal', "<? echo $filass['nommenu']?>"],
		<?
			}else if($marca=='y'){
		?>
				[null, "<? echo $filass['nommenu']?>",null,null, "<? echo $filass['nommenu']?>",
		<?
		//********  
					$resultadosi=$objMenug1->getMenuSubItems($nommenu1,$_SESSION['usuarioId']);
					while($filassi=$objMenug1->NextRow2($resultadosi))
					{			
		//***************		
		?>
						[null, "<? echo $filassi['nomitem']?>","<? echo $filassi['archivoitem']?>",'principal', "<? echo $filassi['nomitem']?>"],
		<?
					}
						$objMenug1->Liberar2($resultadosi);
		?>
				],
		<?
			}
		?>
		<?		   
		}
	   $objMenug1->Liberar1($resultados);
		?>		
	],
	<? 
	}
	$objMenug->Liberar($resultado);
	?>	
];
--></script>
<script> 
function centrar() { 
    iz=(screen.width-document.body.clientWidth) / 2; 
    de=(screen.height-document.body.clientHeight) / 2-50; 
    moveTo(iz,de); 
}     
</script> 
<head>
<title>.:: Modulo de Transportes ::.</title>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -->
<link href="style.css" rel="stylesheet" type="text/css">
<link href="Estilos.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="menu/JSCookMenu.js"></script>
<link rel="stylesheet" href="menu/theme.css" type="text/css">
 <script language="JavaScript" src="menu/theme.js"></script>
 <SCRIPT LANGUAGE="JavaScript"> 
<!-- 
function runClock() { 
theTime = window.setTimeout("runClock()", 1000); 
var today = new Date(); 
var display= today.toLocaleString(); 
status=display; 
} 
// --> 
</SCRIPT>
</head>
<? if($id_v==1){?>
<body bgcolor="<?=$c_fondo['fondo']?>" onLoad="centrar()" onBeforeUnload="cierrame()"><!--   --><!--  -->
<? }elseif($id_v==2){?>
<body bgcolor="<?=$c_fondo['fondo']?>" onload="javascript:window.close()">
<? }?>
<table width="1030" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
  <tr bgcolor="#ECE9D8" class="lblForm">
  <td width="100" bgcolor="#ECE9D8" class="lblForm"><div align="center"><a href="cvp_cerrar_sesion_back.php"><img src="../imagenes/cerrarsesion.gif" width="80" height="15" border="0"></a>
    <? //$id_v?>
  </div></td>
    <td width="804" valign="top" bgcolor="#ffffff">	
      <div align="left">
        <table width="888" height="20" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="585"><div align="left">
              <table width="100"   border="0" align="left" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" >
                <!-- background="../imagenes/fondo.jpg" -->
                <tr valign="bottom">
                  <td width="896" class="normal"><div align="left"><span class="clinica">
                      <div id="MenuAplicacion"></div>
                      <script language="JavaScript">
			
				cmDraw ('MenuAplicacion', MenuPrincipal, 'hbr', cmThemeOffice, 'ThemeOffice');
			
			  </script>
                  </span> </div></td>
                </tr>
              </table>
            </div></td>
            <td width="217" class="lblCampo"><div align="right">
              <div align="right">Bienvenido Sr: <? echo $_SESSION['usuarioNombre']?></div>
              
            </div></td>
          </tr>
        </table>
      </div></td>    
  </tr>
  
  <tr>
  	<td colspan="2" valign="top" class="normal"><div align="left">
	</div>
	  <iframe name="principal" height="600" width="1020" src="fondo.php" marginheight="0" marginwidth="0" scrolling="auto" frameborder="0"></iframe>	</td>
  </tr>
</table>
</body>
</html>
