<HTML>
<HEAD>
	<TITLE>Obtener</TITLE><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="estiloi.css">
<script language="javascript">

function nuevoAjax(){
	var xmlhttp=false;
 	try {
  		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 		} 
	catch (e) {
  		try {
   			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  			} 
		catch (E) {
   			xmlhttp = false;
  			}
 		}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
			xmlhttp = new XMLHttpRequest();
		}
	return xmlhttp;
	}
	
	function obtener(){
	Validacion();
	//alert("obtener");
	//vari=vari;
	
	var contenedor;
	contenedor = document.getElementById('contenedor');
	
	clavecct=document.getElementById('clavecct').value;
	turno=document.getElementById('turno').value;
	depnormtva=document.getElementById('depnormtva').value;
			
	ajax=nuevoAjax();
	ajax.open("POST", "funcion_pwd.php", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	ajax.send("&clavecct="+clavecct+"&turno="+turno+"&depnormtva="+depnormtva);		

	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {contenedor.innerHTML = ajax.responseText}
		}
	}	


function Validacion()
{
	//alert("Validacion");
	clavecct=document.getElementById('clavecct').value;
	turno=document.getElementById('turno').value;
	depnormtva=document.getElementById('depnormtva').value;
	if (clavecct=="" || turno=="" || depnormtva=="" )
	{
		alert("Favor de ingresar todos los datos");
		return false;
	}
}

</script>
	<style type="text/css">
		<!--
		
		body,td,th {
			color: #000000;
			font-family: Verdana, Arial, Helvetica, sans-serif;
		}
		body {
			background-color: #FEFEFE;
		}td img {display: block;}

.style2 {font-weight: bold; font-size: 24px; font-family: Arial, Helvetica, sans-serif; color: #FFFFFF;}

		-->
    </style>
	</HEAD>
	
	
<BODY>

	  <p>
		<?php
	
			$link = mysql_connect('127.0.0.1', 'sesponda', '060189se');
			//$link = mysql_connect('127.0.0.1', 'root', 'toor');
			if (!$link) 
			{
				die('Could not connect: ' . mysql_error());
			}
			$db_selected = mysql_select_db('Bib', $link);
			if (!$db_selected) 
			{
				die ('Can\'t use Bib: ' . mysql_error());
			}
		?>
	  </p>

<center>	
	
	<FORM NAME="form1" METHOD="post" onSubmit="return Validacion(this)" 
			ACTION="funcion_pwd.php">
			<table width="452">
				<TR>
				<TD width="466" bgcolor="#3E5D72">
	  <table width="446" border="0" align="center">
						<tr>			  
						<td width="459" bordercolor="#3E5D72" bgcolor="#3E5D72">
			  <table width="400" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#3E5D72">
								<tr>
								<td class="Estilo2"><img src="dis/spacer.gif" width="201" height="1" border="0" alt="" /></td>
								<td class="Estilo2"><img src="dis/spacer.gif" width="199" height="1" border="0" alt="" /></td>
								<td class="Estilo2"><img src="dis/spacer.gif" width="1" height="1" border="0" alt="" /></td>
								</tr>
								
								<tr>
								<td colspan="2" >
                                  <p align="center"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">RECUPERAR CONTRASE&Ntilde;A</font></p></td>
								<td class="Estilo2"><img src="dis/spacer.gif" width="1" height="66" border="0" alt="" /></td>
								</tr>
								
								<tr bgcolor="#E9EFFE">
								<td colspan="2" class="Estilo2">
					
                    			<table width="299" border="0" align="center" bordercolor="#3E5D72">		  
									<tr>
									<td width="144"><font face="Arial, Helvetica, sans-serif" color="#000000">Clave CT.:</font></td> <td title="Anote la clave de centro de trabajo"width="145">
									<input type="text" name="clavecct" maxlength="10" id="clavecct" size="10"></td>
									</tr>
										  
									<tr>
									<td><font face="Arial, Helvetica, sans-serif" color="#000000">Clave Turno:</font></td>
									<td title="Anote la clave del turno"><input type="text" name="turno" maxlength="1" id="turno" 
									size="3"></td>
									</tr>
									  
									<tr>
									<td><font face="Arial, Helvetica, sans-serif" color="#000000">Clave Dep. Norm.:</font></td>
									<td title="Anote la clave de dependencia normativa">
									<input type="text" name="depnormtva" maxlength="2" id="depnormtva" size="3"></td>
									</tr>
							    </table>                  
							    </td>
                                
								<td class="Estilo2"><img src="dis/spacer.gif" width="1" height="183" border="0" alt="" /></td>
								</tr>
				
								<tr>
								<td height="51" class="Estilo2">&nbsp;</td>
								<td align="right" title= "Si ingreso los datos correctos aparecera la CONTRASE&Ntilde;A"  class="Estilo2"><input type="button" onClick="obtener();" value="Obtener">
								</td>
								<td class="Estilo2"><img src="dis/spacer.gif" width="1" height="51" border="0" alt="" />
								</td>
								</tr>
						    </table>
                            
						<div align="center" class="Estilo2">
						</div>
					    </td>
			    	</tr>
			     </table>		
                </TD>
			  </TR></table>
                
	</FORM>			


<div id="contenedor">
    <? ?>
    <!-- <div id="contenedor">
	  -->
	<? ?>
	<!--</div>-->
</div>
  
</center>
</BODY>
</HTML>
