// JavaScript Document
$(document).ready(function() { 

mueveReloj();

/*$('#t1').animate({height: '+=30px'}, 2000, 'easeOutBounce');

$( "#t2" ).effect( "drop",{}, 500).fadeIn(1000);



 $('#t3').animate({right:'100px'},500,'easeOutCirc').animate({right: '15px'},2500, 'easeOutBounce').effect( 'drop', {}, 500).fadeIn(3000);*/

/*
options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5
*/

var miScript = {
	inicio: function inicio(){
	$('#cajaSlogan')
	.fadeOut()
	.slideDown(1500,"easeOutBounce")
	.fadeIn();
	/*$('#logotipo').effect( 'slide', {direction:'left', easing:"easeOutBounce"}, 2000);*/
/*	$('#logotipo').effect( 'shake', {times:1}, 100).fadeIn();
	$('#logotipo').effect( 'pulsate', {times:3}, 100).fadeIn();
	$('#bannerSeccion').effect( 'slide', {direction:'up', easing:"easeOutBounce"}, 1000);*/
	},
/*	inicio()*/
	mueveCaja: function mueveCaja(){
	$( '#logotipo' ).hover(function(){
	$( this )
	.stop( true )
	.fadeOut('fast').fadeIn().effect( 'pulsate', {times:2}, 100);
	},function(){
		$( this )
			.stop( true )
			.effect( 'pulsate', {times:1}, 100).fadeIn();
			}
		)
	},
	anima: function anima(){
	$('#cajaSlogan')
	.fadeOut()
	//.hide()
	//.fadeIn()
	//.delay(1000)
 	.slideDown(1500,"easeOutBounce")
	.delay(1000)
	.fadeOut()
	.fadeIn()
	.slideUp(1500,"easeInBounce")
	.delay(1000)
	.fadeIn();
	$('#logotipo').effect( 'pulsate', {times:3}, 100).fadeIn();
	}
}

miScript.inicio();
miScript.mueveCaja();

function esta(){
	miScript.anima();
	}

setInterval(esta, 10000);


/*MENU PRINCIPAL*/
    $('#navMenu li').hover(
        function() {
             $(this)
			 .stop(true)
            .animate({paddingLeft: '4px', marginRight: '51px'}, 
			{duration:100, easing:'linear'}
			);
        }, 
         function() {
             $(this)
			 .stop(true)
			.animate({paddingLeft: '0px', marginRight: '55px' },  
			{duration:500, easing:'easeOutBounce'}
			);    
    })
/*    $('#navMenu li a').hover(
        function() {
             $(this)
			 .stop(true)
            .animate({paddingLeft: '10px', marginRight: '51px'}, 
			{duration:100, easing:'linear'}
			);
        }, 
         function() {
             $(this)
			 .stop(true)
			.animate({paddingLeft: '13px', marginRight: '55px'},  
			{duration:100, easing:'linear'}
			);    
    })*/
	
	
/*$('#t2').animate({ 
padding: '20px', 
borderBottom: '3px solid #8f8f8f', 
borderRight: '3px solid #bfbfbf' 
}, 2000);*/

/*FIN MENU PRINCIPAL*/

});
function mueveReloj(){ 

var cajaFecha = $('#fecha');
var fecha=new Date();
var diames=fecha.getDate();
var diasemana=fecha.getDay();
var mes=fecha.getMonth() +1 ;
var ano=fecha.getFullYear();

var textosemana = new Array (7); 
  textosemana[0]="Domingo";
  textosemana[1]="Lunes";
  textosemana[2]="Martes";
  textosemana[3]="Miércoles";
  textosemana[4]="Jueves";
  textosemana[5]="Viernes";
  textosemana[6]="Sábado";

var textomes = new Array (12);
  textomes[1]="Enero";
  textomes[2]="Febrero";
  textomes[3]="Marzo";
  textomes[4]="Abril";
  textomes[5]="Mayo";
  textomes[6]="Junio";
  textomes[7]="Julio";
  textomes[8]="Agosto";
  textomes[9]="Septiembre";
  textomes[10]="Octubre";
  textomes[11]="Noviembre";
  textomes[12]="Diciembre";

var msg = textosemana[diasemana] + " " + diames + " de " + textomes[mes];
var	hora = fecha.getHours() 
var minuto = fecha.getMinutes() 
var segundo = fecha.getSeconds() 

   	str_segundo = new String (segundo) 
   	if (str_segundo.length == 1) 
      	 segundo = "0" + segundo 

   	str_minuto = new String (minuto) 
   	if (str_minuto.length == 1) 
      	 minuto = "0" + minuto 

   	str_hora = new String (hora) 
   	if (str_hora.length == 1) 
      	 hora = "0" + hora 

   	horaImprimible = hora + ": " + minuto + ": " + segundo + " hrs";
	$('#fecha').text(msg + " "+ horaImprimible);
   	setTimeout("mueveReloj()",1000) 
} 



