// JavaScript Document


//ROLL OVER DE IMAGENES CON JQUERY TODO LO QUE TENGA LA CLASE "ROLL" SERA AFECTADO 
//LA IMAGEN DE SUSTITUCION SE DEBE LLAMAR IGUAL PERO CON "_hover" AL FINAL DEL NOMBRE DEL ARCHIVO
$(document).ready( function() {   
   peps.rollover.init();   
});   
peps = {};   
peps.rollover = {   
   init: function() {   
      this.preload();   
      $(".roll").hover(   
         function () { $(this).attr( 'src', peps.rollover.newimage($(this).attr('src')) ); },   
         function () { $(this).attr( 'src', peps.rollover.oldimage($(this).attr('src')) ); }   
      );   
   },   
preload: function(){   
      $(window).bind('load', function() {   
         $('.roll').each( function( key, elm ) { $('<IMG loaded="true" jQuery1295890868144="4">').attr( 'src', peps.rollover.newimage( $(this).attr('src') ) ); });   
      });   
   },   
   newimage: function( src ) {   
      return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_hover' + src.match(/(\.[a-z]+)$/)[0];   
   },   
   oldimage: function( src ){   
      return src.replace(/_hover\./, '.');   
   }   
};   


$(document).ready(function() {
	var capas = Array("grado_superior", "grado_medio", "prueba_acceso", "postgrado", "hnd", "hnd2", "topup", "prof", "player");
	$('.Slide').click(function(event) { 
			event.preventDefault();	
			for(var i=0; i<=capas.length; i++)
			{
				$("#"+capas[i]).hide();
			}
			var elemento = $(this).attr('href');
			$("#"+elemento+"").animate({             
					width: "show"            
					/*             
					width: "show"             
					width: "hide"             
					*/      
			},300); 
			
			flowplayer("player", "../../flowplayer/flowplayer-3.2.5.swf");
	})
})
 /*
$(document).ready(function() {
	if($('#a-publi'))
	{
		//$('#a-publi').attr({'': ''});
		//$('#img-publi').attr({'': ''});
		$('#a-publi').attr({'title': 'Master Profesional en creacion y e investigacion en Videojuegos'});
		$('#a-publi').attr({'target': '_blank'});
		$('#a-publi').attr({'href': 'http://www.cev.com/landing/master-videojuegos-home/landing-videojuegos.html'});
		$('#img-publi').attr({'alt': 'Master Profesional en creacion y e investigacion en Videojuegos'});
		$('#img-publi').attr({'src': 'img/publi-home/master-videojuegos.png'});
		//$('#img-publi').attr({'': ''});
//master-videojuegos.png
//disenno-grafico.jpg
//disenno-web.jpg
	}
})
*/

$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'random', //Specify sets like: 'fold,fade,sliceDown'
        slices:15,
        animSpeed:500, //Slide transition speed
        pauseTime:5000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:false, //Next & Prev
        directionNavHide:true, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        //controlNavThumbsSearch: '.jpg', //Replace this with...
        //controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:false, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
});


function linkVideo(video)
{
	//var URL = "http://87.216.50.30/trabajos/";
	//alert(video);
	var URL = "flv/";
	//alert(document.getElementById('player').href);
	document.getElementById('player').href = "flv/spot_cev.flv";
	flowplayer("player", "../../flowplayer/flowplayer-3.2.5.swf");
	alert(document.getElementById('player').href);
}

function Radio()
{
	window.open("reproductor/player.html","repro","width=350,height=36,status=no,toolbar=no,resizable=no,scrollbars=no,menubar=no");
}
