/*
	Aragón 4.0
	Marzo 2010
*/
$(document).ready(function() {
	$("#priv").click(function(event){
		 //Esto hace que el enlace no vaya a la url indicada
		 event.preventDefault();
		//Esto es un ejemplo de cómo asignamos estilos
		$("#top_der").addClass("visible"); 
		$("#top_der").show("slow");

	 });
});

$(function(){
    // menu despegable        
    var ddmenuitem = null;
    
    $('#nivel_1 > li').mouseover(function() {
        //console.log($(this).find('ul').children().length);
        if ($(this).find('ul').children().length) 
        { 
            ddmenuitem = $(this).find('ul').css({'visibility':'visible'});
        }
    });
    
    $('#nivel_1 > li').mouseout(function() {
        if (ddmenuitem) ddmenuitem.css({'visibility':'hidden'});
    });
    
    $('#telefonica_mini').click(function(){
         window.open("http://www.telefonica.es");
         return false;
    });
});

$(function(){
    $('.video-thumb-izq > a').click(function(){
        video = $(this).attr('href');
        ytplayer = document.getElementById("myytplayer");
        ytplayer.loadVideoById(video);
		
		document.location="#v";

        return false;
    });
    
    $('.video-thumb > a').click(function(){
        video = $(this).attr('href');
        
        ytplayer = document.getElementById("myytplayer");
        ytplayer.loadVideoById(video);
		
		document.location="#v";
	
        return false;
    });    
});

