  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-2445926-3']);
  _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);
  })();

// hover for project preview
$(document).ready(function(){  
    $('.cover').css({opacity:'0',top:'154px'});
    $(".cover").click(function(){ window.location=$(this).find("a").attr("href");return false;});
    $('.boxgrid').hover(function(){  
        $(".cover", this).stop().animate({top:'104px',opacity: '0.8'},{queue:false,duration:300});  
    }, function() {  
        $(".cover", this).stop().animate({top:'154px',opacity: '0'  },{queue:false,duration:300});  
    });  
});

// fixing portfolio and menu
$(document).ready(function(){
    var $el=$('#fixit');
	var topmost_point = $el.offset().top;
	var the_window = $(window);
   the_window.scroll(function(){
    if (the_window.scrollTop() > topmost_point ) {
          if ($.browser.msie && $.browser.version == "6.0") {
			  return false;
          } else  if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){ 
			  return false;
	  } else  if ( $el.css('position') != 'fixed'){
		      $el.css({position: 'fixed', top:'0px'}); }
    } else if (the_window.scrollTop() <= topmost_point && $el.css('position') != 'absolute') {
        $el.css({position: 'absolute', top: topmost_point });
    }
   });
});


// scrolling local
jQuery(function( $ ){
	// Scroll initially if there's a hash (#something) in the url 
	$.localScroll.hash({
		queue:true,
		duration:700
	});
	$.localScroll({
		queue:true,
		duration:700,
		hash:true
	});
});
