// JavaScript Document
$(document).ready(function() {
						   
	if( $("#map").length > 0 )
	{
			try
			{
				ini(html, x, yy);
			}
			catch(e)
			{
				alert(e.name+ " " + e.message);
			}
	}
	
	$(".lightbox").fancybox({ 
		'hideOnContentClick': true,
		'overlayShow': true
	});
	
	$(".frame").fancybox({
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'ocuVid'            : false, 
		'onClosed'		: function() {
	    								$("#mitxt").attr('value', $('#ficheros').val());
									}
	});
	
	$("a.frame2").click(function() {
		$.fancybox({
				'ocuVid'        : false,
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: { 'wmode':'transparent', 'allowfullscreen':'true' }
		});
	});
	
	$(".ldirectotitulo, .ldirectodesc").each( 
											 function(index){
												 $(this).hover( 
															  	function(){
																	var id = $(this).attr("id").split("_")[1];
																	
																	$("#directo_"+id).attr("class","logo_directo_rojo");
																}, 
																function(){
																	var id = $(this).attr("id").split("_")[1];
																	
																	$("#directo_"+id).attr("class","logo_directo");
																});
													   });
	$(".logos").each(
					 function(index){
						 $(this).hover(
									   function(){
										   var srcorig  = $(this).attr("src");
										   var srcnuevo = srcorig.replace("img/", "img/b_");
										   
										   $(this).attr("src", srcnuevo);
									   }, 
									   function(){
										   var srcorig  = $(this).attr("src");
										   var srcnuevo = srcorig.replace("img/b_", "img/");
										   
										   $(this).attr("src", srcnuevo);
									   });
					 });	
});
