document.write("<script type='text/javascript' src='menu.js'></script>");
document.write("<script type='text/javascript' src='jquery.js'></script>");

//Validar Busquedas de Google
function ValidarBuscar(){
	//Validar Buscar
	nom=document.f.q.value 
	if(nom==null || nom.length==0){
		alert('Ingrese el texto a Buscar')
		document.f.q.focus()
		return false 			
	}
}

//Mostrar Fecha
function fecha()
{
        today = new Date()
        day = today.getDay()
        if ( day == 0 ) { 
        document.write("Domingo, ");
        }
        if ( day == 1 ) { 
        document.write("Lunes, ");
        }
        if ( day == 2 ) { 
        document.write("Martes, ");
        }
        if ( day == 3 ) { 
        document.write("Mi&eacute;rcoles, ");
        }
        if ( day == 4 ) { 
        document.write("Jueves, ");
        }
        if ( day == 5 ) { 
        document.write("Viernes, ");
        }
        if ( day == 6 ) { 
        document.write("S&aacute;bado, ");
        }
   
          today = new Date()
          hours = today.getHours()
          minutes = today.getMinutes()
          year = parseInt(today.getYear(),10)

          zerom = ''
          zeroh = ''
          if ( minutes < 10 ) { zerom = 0 }
          if ( hours < 10 ) { zeroh = 0 }
 
        if ( today.getMonth() == 0 ) { month = "Enero" }
        if ( today.getMonth() == 1 ) { month = "Febrero" }
        if ( today.getMonth() == 2 ) { month = "Marzo" }
        if ( today.getMonth() == 3 ) { month = "Abril" }
        if ( today.getMonth() == 4 ) { month = "Mayo" }
        if ( today.getMonth() == 5 ) { month = "Junio" }
        if ( today.getMonth() == 6 ) { month = "Julio" }
        if ( today.getMonth() == 7 ) { month = "Agosto" }
        if ( today.getMonth() == 8 ) { month = "Septiembre" }
        if ( today.getMonth() == 9 ) { month = "Octubre" }
        if ( today.getMonth() == 10 ) { month = "Noviembre" }
        if ( today.getMonth() == 11 ) { month = "Diciembre" }
        if ( today.getYear() == 99 ) { year = "1999" }
	if ( today.getYear() == 0 || today.getYear() == 100 || today.getYear() == 2000) { year = "2000" }

              document.write( today.getDate()," de ",month," del ",year );
}

//Combos Menu
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

//POP Recomensar
function popUp(url){
	window.open(url,"pop","width=450,height=440,toolbars=0,scrollbars=0,status=0,menubar=0,location=0,directories=0")
}

//Subir en Forma Progresiva
function subir(){

if( document.documentElement.scrollTop < 10 ){

window.scrollTo(0,0);

}else{

window.scrollBy(0,-10);

setTimeout("subir()",10);

}

}

//Carrusel de Imagenes
$(document).ready(function() {

	//Set Default State of each portfolio piece
	$(".paginar").show();
	$(".paginar a:first").addClass("active");
		
	//Get size of images, how many there are, then determin the size of the image reel.
	var imageWidth = $(".ventana").width();
	var imageSum = $(".imgcarrusel img").size();
	var imageReelWidth = imageWidth * imageSum;
	
	//Adjust the image reel to its new size
	$(".imgcarrusel").css({'width' : imageReelWidth});
	
	//Paging + Slider Function
	rotate = function(){	
		var triggerID = $active.attr("rel") - 1; //Get number of times to slide
		var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

		$(".paginar a").removeClass('active'); //Remove all active class
		$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
		//Slider Animation
		$(".imgcarrusel").animate({ 
			left: -image_reelPosition
		}, 500 );
		
	}; 
	
	//Rotation + Timing Event
	rotateSwitch = function(){		
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			$active = $('.paginar a.active').next();
			if ( $active.length === 0) { //If paging reaches the end...
				$active = $('.paginar a:first'); //go back to first
			}
			rotate(); //Trigger the paging and slider function
		}, 7000); //Timer speed in milliseconds (3 seconds)
	};
	
	rotateSwitch(); //Run function on launch
	
	//On Hover
	$(".imgcarrusel a").hover(function() {
		clearInterval(play); //Stop the rotation
	}, function() {
		rotateSwitch(); //Resume rotation
	});	
	
	//On Click
	$(".paginar a").click(function() {	
		$active = $(this); //Activate the clicked paging
		//Reset Timer
		clearInterval(play); //Stop the rotation
		rotate(); //Trigger rotation immediately
		rotateSwitch(); // Resume rotation
		return false; //Prevent browser jump to link anchor
	});	
	
});

 
 
