/* Google Analytics */
function addGoogleStats() {
		var GAID = 'UA-5724771-2';
		var head = document.getElementsByTagName('head')[0];
		var scr = document.createElement('script');
		scr.type = 'text/javascript';
		scr.src = (location.protocol == 'http:' ? 'http://www.' : 'https://ssl.') + 'google-analytics.com/'+'ga.js';
		var once = 0;

				function runMe() { 
						if (scr.readyState == 'loading' || _gat == undefined || once) { return; }
						clearInterval(timer);
						once++;

						var pageTracker = _gat._getTracker(GAID);
						pageTracker._initData();
						pageTracker._trackPageview();
				}

		var timer = setInterval(runMe, 2000);
		scr['onload'] = runMe;
		scr['onreadystatechange'] = runMe;
		head.appendChild(scr); 
}
addGoogleStats();


$(document).ready(function(){
	/* light hover efect */
	$('#menu li').hover(function(){
		$(this).css('background-position', '0');
		$(this).append('<div class="hoverEffect"></div>');
		$('#menu li div.hoverEffect').fadeIn(300);
	},
	function(){
		$('#menu li div.hoverEffect').fadeOut(300, function(){
			$(this).remove();
		});
	});


	/* inserting e-mail address in a link */
	var email = $('#email strong:first').text() + '@' + $('#email strong:last').text();
	$('#email a').attr('href', 'mailto:' + email);
});