﻿$(document).ready(function () {

    externalLinks();

    //Move redes sociais
    $('#sociais ul li').hover(function () {
        $(this).stop(true).animate({
            marginTop: '-2px'
        }, 200);

    }, function () {
        $(this).animate({
            marginTop: 0
        }, 200);
    });

    //foco no textarea de contato
    $('.formulario textarea').focus(function () {
        $(this).animate({
            height: 200,
            maxHeight: 200
        }, 200);
    });

    $('.formulario textarea').blur(function () {
        if ($(this).val() == '') {
            $(this).animate({
                height: 18
            }, 50);
        }
    });

    $('.facebook').live('click', function () {
		var existe_ga = typeof _gaq;
		if (existe_ga != 'undefined') {
			_gaq.push(['_trackPageView','/facebook']);
			console.log('Registrado Facebook');
		}
    });
    $('.twitter').live('click', function () {
		var existe_ga = typeof _gaq;
		if (existe_ga != 'undefined') {
			_gaq.push(['_trackPageView', '/twitter']);
			console.log('Registrado Twitter');
		}
    });
    $('.linkedin').live('click', function () {
		var existe_ga = typeof _gaq;
		if (existe_ga != 'undefined') {
			_gaq.push(['_trackPageView', '/linkedin']);
			console.log('Registrado LinkedIn');
		}
    });

});

//insere _blank em links com rel=externo
var externalLinks = function () {
    $('a[rel=externo]').attr('target', '_blank');
}
