$(window).load(function() {
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	var aPage = "." + sPage.substring( 0, sPage.lastIndexOf( "." ) ) + " a";
	if (aPage != ". a")
	{	$(aPage).removeClass("transition").addClass("active").animate({"color": "#111"}, 500);}
});


$(function()	{
	$("#content").css({opacity:0});
});
$(window).load(function() {
    $("#content").animate({opacity: 1.0}, "fast", function () {
        if (!$.support.opacity) {
            this.style.removeAttribute('filter');
        }
    });
	$("a.transition").click(function(event){
		event.preventDefault();
		linkLocation = this.href;
		$("#content").animate({opacity: 0}, "fast", redirectPage);
	});
	function redirectPage() {
		window.location = linkLocation;
	};
});


$(document).ready(function() {
    $('.zoom').mouseenter(function(e) {
        $(this).animate({ height: '22', top: '-1', width: '22'}, 100);
    }).mouseleave(function(e) {
        $(this).animate({ height: '20', top: '0', width: '20'}, 100);
    });
});


$(window).load(function() {
$("#menu a").not(".active").hover(function () {
$(this).stop().animate({
'color': "#111"}, 200);
$("#menu a").not(this).stop().animate({
'color': "#CCC"}, 200);},
function () {
$("#menu a").not(".active").stop().animate({
'color': "#777"}, 200);
$(".active").stop().animate({
'color': "#111"}, 200);
});
});

$(window).load(function() {
	$('#main').removeClass('loading');
});


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4213417-4']);
  _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);
  })();
