var strHash;
var $elmtHeader;	 

$(document).ready(function(){


	// THE NAVIGATION
		
	$(".a-nav-off").hover(
		function () {
			//.stop( [ clearQueue ], [ jumpToEnd ] )
			// clearQueue - remove qued animations
			// jumpToEnd - complete currently running animation immediately
			$(this).css( { color:"#FFFFFF"} );
			$(this).stop(false,true).animate({backgroundPosition:"(50% -60px)"}, {queue:false, duration:300});
		},
		function () {
			$(this).stop(false,true).animate({backgroundPosition:"(50% -90px)"},{queue:false, duration:300});
		}
	);

	$(".a-nav-off").click(
		function () {
			$(this).css( {backgroundPosition: "50% -30px", color:"#000000"} );
			$(this).stop(false,true).animate({backgroundPosition:"(50% 0)"}, {queue:false, duration:200});
		}
	);
	
	
  // EYES-TO
  strHash = window.location.hash.substring(1);
  if (strHash.length > 0) {
		// slide the header to the right to make room for the bullet
		$elmtHeader = $("a[name='" + strHash + "'] + h3");
		$elmtHeader.stop(false,true).animate({ color:'#FFFFFF'},{queue:false, duration:500});
  }
	
  $(".a_zoom").click(function(event) {
    if ($elmtHeader != null) {
		  //undo the previous selection
  		$elmtHeader.stop(false,true).animate({ color:'#000000'},{queue:false, duration:200});
		}
		
		// slide the header to the right to make room for the bullet
    strHash = this.hash.substring(1);
		$elmtHeader = $("a[name='" + strHash + "'] + h3");
		
		$elmtHeader.stop(false,true).animate({ color:'#FFFFFF'},{queue:false, duration:500});
  });

	
  Scroller={speed:10,gy:function(A){gy=A.offsetTop;if(A.offsetParent){while(A=A.offsetParent){gy+=A.offsetTop}}return gy},scrollTop:function(){body=document.body;d=document.documentElement;if(body&&body.scrollTop){return body.scrollTop}if(d&&d.scrollTop){return d.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0},add:function(B,A,C){if(B.addEventListener){return B.addEventListener(A,C,false)}if(B.attachEvent){return B.attachEvent("on"+A,C)}},end:function(A){if(window.event){window.event.cancelBubble=true;window.event.returnValue=false;return }if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}},scroll:function(A){i=window.innerHeight||document.documentElement.clientHeight;h=document.body.scrollHeight;a=Scroller.scrollTop();if(A>a){if(h-A>i){a+=Math.ceil((A-a)/Scroller.speed)}else{a+=Math.ceil((A-a-(h-A))/Scroller.speed)}}else{a=a+(A-a)/Scroller.speed}window.scrollTo(0,a);if(a==A||Scroller.offsetTop==a){clearInterval(Scroller.interval)}Scroller.offsetTop=a},init:function(){Scroller.add(window,"load",Scroller.render)},render:function(){a=document.getElementsByTagName("a");Scroller.end(this);window.onscroll;for(i=0;i<a.length;i++){l=a[i];if(l.href&&l.href.indexOf("#")!=-1&&((l.pathname==location.pathname)||("/"+l.pathname==location.pathname))){Scroller.add(l,"click",Scroller.end);l.onclick=function(){Scroller.end(this);l=this.hash.substr(1);a=document.getElementsByTagName("a");for(i=0;i<a.length;i++){if(a[i].name==l){clearInterval(Scroller.interval);Scroller.interval=setInterval("Scroller.scroll("+Scroller.gy(a[i])+")",10)}}}}}}};Scroller.init();	
	
});

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8433077-35']);
_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);
})();


