﻿// Google Analytics page tracking code.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17053752-1']);
_gaq.push(['_setDomainName', '.fealabs.com']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
 
(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);
})();

// Do anything that requires DOM ready state here.
$(document).ready(function() {

	// Add Google Analytics event tracking for external links.
	$('a.external_link').click(function(){
		_gaq.push(['_trackEvent', 'External Links', 'Click', $(this).attr('href')]);
	});
	
	// Add some sdvanced visual styles to IE.
	if($.browser.msie && $.browser.version < 9){
		// All IE versions prior to 9.
		$('.contentBlock').addClass('ieBoxShadow');
		//$('h1').addClass('ieTextShadow');
		
		// IE 6 specific stuff.
		if ($.browser.version < 7) {
			// Fix the gap in the header.
			$('#logo').css('margin-bottom', '-5px');
			// Fix issue with animation flowing outside of div container.
			$('#page_content').css('zoom', '1');
			// Fix the right padding issue (-2px in IE6).
			$('#page_content').css('padding-right', '8px');
			// Fix the navigation height issue.
			$('#top_nav a').css('line-height', '20px');
			var pageId = $('html').attr('id');
			if (pageId != undefined && pageId != '')
			{
				var pageName = pageId.split('_')[0];
				var pageSelector = '#' + pageId + ' #top_nav a#' + pageName;
				$(pageSelector ).css('line-height', '28px');

			}
			// Fix margin issue caused by specs table.
			$('#SpecsTable').css('width', '99%');
			// Fix the image max-width issue.
			$('#productGallery img').maxWidthFix();
		}
	}
});
