  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17452693-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


$(document).ready(function() {

	// make the cursor over li element to be a pointer instead of default
    $('li.clickable').css('cursor', 'pointer')
    // iterate through all li elements with CSS class = "clickable"
    // and bind onclick event to each of them
    .click(function() {
        // when user clicks this li element, redirect it to the page
        // to where the fist child a element points
        window.location = $('a', this).attr('href');
    });

    // Substitución @ para los mails visibles.
    // ofuscateMail();
	
	$("ul.sf-menu").superfish({ 
            minWidth:    9,   // minimum width of sub-menus in em units 
            maxWidth:    30,  // maximum width of sub-menus in em units 
            extraWidth:  1    // extra width can ensure lines don't sometimes turn over 
                              // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 

    $('input[type="text"],textarea,input[type="password"]').focus(function() {
		if (this.id != 'clave') {
			$(this).addClass("focusFields");
		}
    }).blur(function() {
    	$(this).removeClass("focusFields");
    });
	equalHeight($(".equalHeight_ul li"));
    equalHeight($(".equalHeight_div"));
	
	$("a.fancy_box").fancybox();
	
	$('.iframeLink').fancybox({
		'width':455,
		'height':700,
		'type':'iframe',
		'autoScale':'false'
	});
	
	$(".youtube").click(function() {
	$.fancybox({
			'padding'			: 0,
			'autoScale'			: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'title'				: this.title,
			'width'				: 680,
			'height'			: 495,
			'href'				: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'				: 'swf',
			'swf'				: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});

	return false;
	});
});
function equalHeight(group) {
    var tallest = 0;
    group.each(function() {
        var thisHeight = $(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}


