// JavaScript Document

$(document).ready(function(){
	crearLinks();
}) ;

function crearLinks(){
	var opciones = $("#menuPpal img");
	
	opciones.click(function(){
		mostrarSeccion(this.id);
		asteriscos(this.id);
	});	
};

function mostrarSeccion(nombre){
	$("#cargando").show();
	$.ajax({ url: "secciones/" + nombre + ".html",
			cache:true,
			success: function(respuesta){
				$("#columnaInfo").html(respuesta);
				$("#cargando").hide();
			}
	});
	var seleccion = "#" + nombre + "Asterisco";
	var opcion1 = "#desarrolloAsterisco";
	var opcion2 = "#disenoAsterisco";
	var opcion3 = "#webSocialAsterisco";
	if(seleccion==opcion1){
		$(seleccion).show();
		$(opcion2).hide();
		$(opcion3).hide();
	} else if(seleccion==opcion2){
		$(seleccion).show();
		$(opcion1).hide();
		$(opcion3).hide();
	} else if(seleccion==opcion3){
		$(seleccion).show();
		$(opcion1).hide();
		$(opcion2).hide();
	}

};

function asteriscos(nombre){
	var seleccion = "#" + nombre + "Asterisco";
	
}


//tooltip



$(document).ready(function() {

	$('a[rel=tooltip]').mouseover(function(e) {
		
		var tip = $(this).attr('title');	
		
		$(this).attr('title','');
		
		$(this).append('<div id="tooltip"><div class="tipHeader"></div><div class="tipBody">' + tip + '</div><div class="tipFooter"></div></div>');		
				
		$('#tooltip').fadeIn('500');
		$('#tooltip').fadeTo('10',0.9);
		
	}).mousemove(function(e) {
	
		$('#tooltip').css('top', e.pageY  -10 );
		$('#tooltip').css('left', e.pageX + 10 );
		
	}).mouseout(function() {
	
		$(this).attr('title',$('.tipBody').html());
	
		$(this).children('div#tooltip').remove();
		
	});

});

