jQuery(function( $ ){

	// Margenes
	margin = 0;
	$('.wrap').each(function(index) {
		$(this).css({'margin-left' : margin+'px', 'position' : 'absolute'});
		margin = (margin + $(this).width());
	});
	
	$('#menu a').click(function(){
		$("#menu li").removeClass("sel");
			$(this).parent().addClass("sel");
			$("body").scrollTo( this.hash, 500, { easing: 'easeOutBack' });
	});

	// Efectos de opacidad en imágenes
	$(".hl").children().hover(function() {
		$(".hl").children().stop();
		$(this).siblings().fadeTo("fast", 0.2);
		$(this).fadeTo("fast", 1.0);
	},function(){
		$(".hl").children().stop();
		$(".hl").children().fadeTo("fast", 1.0);
	});

	// Logos de clientes
	$("#clientes ul li").hover(function() {

		var thumbOver = $(this).find("img").attr("src");

		$(this).css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide()
		});
	} , function() {
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});


});

// Contact Form
function contactform() {
	$('#contact-form input, #contact-form textarea').attr('disabled', true).fadeTo("fast", 0.2);
	$('#contact-container').load('/wp-content/themes/default/contact-form.php', {
		nombre: $("#nombre").val(), 
		email: $("#email").val(), 
		texto: $("#texto").val()
	});
	return false;
}
