/*
function mostrar() { 
   $("#ultimo").fadeIn('slow'); 
} 

function mostrar2() { 
   $("#proximo").fadeIn('slow'); 
} 
*/

$(document).ready(function() {

   	//Función para el load que nose si funciona

	$(window).bind("load",function() {

		$("#cargador").fadeOut(500,function() {
			$(window).unbind("load");
		});
	});

   	//Función para cambiar 

	/*$("#proximo").hide();
   	$("#ultimo").click(function (){
     		$(this).fadeOut('slow'); 
      		setTimeout("mostrar2()",1500); 
   	});

   	$("#proximo").click(function (){
      		$(this).fadeOut('slow'); 
      		setTimeout("mostrar()",1500); 
   	});*/

   	//El menu horizontal 

	$(" #navequipos ul ").css({display: "none"}); // Opera Fix
	$(" #navequipos li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
   
   	//Lo de la Primera Plantilla

	$('#ekipo table a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #subcontenido';
		$('#subcontenido').hide('fast');
		$('#load').remove();
		$('#global').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		$('#subcontenido').load(toLoad,'',showNewContent);
		function showNewContent() {
			$('#subcontenido').show('normal',hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
		
	});

   	//Para cambiar la jornada en los resultados

	$('#elegir').submit(function(){

		$.post(
			
			$(this).attr('action'),
			$(this).serialize(),
			function(toLoad){
				
				$('#mostrar').html(toLoad);

			}

    		);

		return false;
	});

   	//Para mostrar u ocultar la imagen

	var x=$("#mostrar");
	//$("#Imagen").hide();
	
	$("a.efecto").toggle( 

    		function() { 
			$("#Imagen").slideUp();
			x.text("Ver foto");
		},    		
		function() { 
			$("#Imagen").slideDown();
			x.text("Ocultar foto");
		}
	);

   	//Para los enlaces de las cronicas

	$("#reportajefotos").hide();
	$("#fichatecnica").hide();
        $("a.vercronica").click(function(){$("#reportajefotos").hide("slow");$("#fichatecnica").hide("slow");$("#cronicapartido").show("slow");	return false;});
        $("a.verfotos").click(function(){$("#cronicapartido").hide("slow");$("#fichatecnica").hide("slow");$("#reportajefotos").show("slow");	return false;});
        $("a.verficha").click(function(){$("#reportajefotos").hide("slow");$("#cronicapartido").hide("slow");$("#fichatecnica").show("slow");	return false;});

   	//Para la publicidad

/*
	var confObject = {
		iconMinSide : 70, iconMaxSide : 140,
		distAttDock : 100, coefAttDock : 3,	
		veloOutDock : 500, valign: 'middle'
	}
	
	jQuery(function() {
 		jQuery("#publicidad").addDockEffect(confObject);
	});

*/	
});