// INNERFADE
$(document).ready(
	function(){
		$(window).load(function() {
			$('#slider').nivoSlider({
				effect:'slideInLeft', //Specify sets like: 'fold,fade,sliceDown'
				animSpeed:500, //Slide transition speed
				pauseTime:3200,
				directionNav:true, //Next & Prev
				directionNavHide:true, //Only show on hover
				controlNav: false, //1,2,3...
				controlNavThumbs:false, //Use thumbnails for Control Nav
				controlNavThumbsFromRel:false, //Use image rel for thumbs
				keyboardNav:false, //Use left & right arrows
				pauseOnHover:true, //Stop animation while hovering
				manualAdvance:false, //Force manual transitions
				beforeChange: function(){},
				afterChange: function(){},
				slideshowEnd: function(){}, //Triggers after all slides have been shown
				lastSlide: function(){}, //Triggers when last slide is shown
				afterLoad: function(){} //Triggers when slider has loaded
			});
			
			$('#header').nivoSlider({
				effect:'fold', //Specify sets like: 'fold,fade,sliceDown'
				slices:12,
				animSpeed:200, //Slide transition speed
				pauseTime:3400,
				directionNav:false, //Next & Prev
				directionNavHide:false, //Only show on hover
				controlNav: false, //1,2,3...
				controlNavThumbs:false, //Use thumbnails for Control Nav
				controlNavThumbsFromRel:false, //Use image rel for thumbs	
			});
		});

		// MENU 
	
		$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
		$("#topnav li").each(function() { //For each list item...
			var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
			$(this).find("span").show().html(linkText); //Add the text in the <span> tag
		}); 
	
		$("#topnav li").hover(function() {	//On hover...
			$(this).find("span").stop().animate({
				marginTop: "-40" //Find the <span> tag and move it up 40 pixels
			}, 250);
		} , function() { //On hover out...
			$(this).find("span").stop().animate({
				marginTop: "0"  //Move the <span> back to its original state (0px)
			}, 250);
		});	
	}
);


	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-6164148-2']);
	_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);
	})();
