

//GLOBALES RELOJ
var timerID = null;
var timerRunning = false;

// MENU GENERAL DE OPCCIONES

	function OculMost(t, op,obj2)
	{ 
		image = 'img'+t;
		obj=document.getElementById(t); 
		if (op == 0)
			obj2=document.getElementById(image); 
		if (obj.style.display == 'none') {
			x = 1;
			//if (op == 0)
				obj2.src = "imagenes/menos.gif";
		}
		else {
			x = 0;
			//if (op == 0)
				obj2.src = "imagenes/mas.gif";
		}
		obj.style.display = (x%2==0) ? 'none' : 'block';
		x++;
	} 


//******************************** CONTROL FECHA ********************************
//FUNCION PARA FECHA ACTUAL
function FechaActual()
{
var dias_semana = new Array ('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado');
var nombres_mes = new Array ('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto', 'Septiembre','Octubre','Noviembre','Diciembre');

 var fecha = new Date (); 
 var dia = fecha.getDay (); 
 dia = dias_semana[dia]; 
 var dia_mes = fecha.getDate(); 
 var mes = fecha.getMonth (); 
 mes = nombres_mes[mes]; 
 var anio = fecha.getYear(); 
 document.write (dia + ' ' + dia_mes + ' de ' + mes + ' de ' + anio); 
 }
 
//MUESTRA EL DIA DE LA SEMANA EN EL QUE ESTAMOS
function diaSemana()
{
var dias_semana = new Array ('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado');

 var fecha = new Date (); 
 var dia = fecha.getDay (); 
 dia = dias_semana[dia]; 
 
document.write(dia);
}
 
//TERMINA DE COMPLETAR EL RESTO DE LA FECHA
function restoFecha()
{
var nombres_mes = new Array ('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto', 'Septiembre','Octubre','Noviembre','Diciembre');

 var fecha = new Date (); 
 var mes = fecha.getMonth (); 
 var dia_mes = fecha.getDate(); 
 var anio = fecha.getYear(); 
 mes = nombres_mes[mes]; 

 document.write(dia_mes + ' de ' + mes + ' de ' + anio);
}
//******************************** FIN CONTROL FECHA ********************************


//******************************** RELOJ ********************************

//PARA EL RELOJ 
function stopclock (){

        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}

//MUESTRA EL MOVIMIENTO DEL RELOJ CADA SEGUNDO
function showtime () {

        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds()

        var timeValue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

        //document.clock.face.value = timeValue;
		document.all.face.value = timeValue;

        timerID = setTimeout("showtime()",1000);
        timerRunning = true;

}

// INICIO DE RELOJ
function startclock () {

        stopclock();
        showtime();
}
//******************************** FIN RELOJ ********************************

//******************************** BARRA DE ESTADO **********************



//******************************** FIN BARRA DE ESTADO **********************

//******************************** PINTA LISTA  **********************
function entrar(src,color_entrada) {
if (src.bgColor != "FF0000")
	src.bgColor=color_entrada;
//src.style.cursor="hand";
}

function sortir(src,color_default) {
if (src.bgColor != "FF0000")
	src.bgColor=color_default;
//src.style.cursor="default";
}

function eliminar(src,color_eliminar) {
src.bgColor="FF0000";
}
//******************************** FIN PINTA LISTA **********************

//******************************** BUSCADOR *****************************
function validarBusqueda(formu) {

if (formu.txt.value=="")
	alert("Debes Introducir un Criterio de Busqueda");
else if (formu.opBusqueda.value == "0")
	alert("Debes Seleccionar una Opcion de la Lista");
else
	formu.submit();
}
//******************************** FIN BUSCADOR **************************

//******************************* COLOREAR OBJETO ************************
function Colorear(Objeto, Color)
{
	Objeto.style.background = Color;
}
//***************************** FIN COLOREAR OBJETO **********************
