// Sprite
$(document).ready(function(){						   
    $('#nav li a').append('<span class="hover"></span>')		   
	$('#nav li a').hover(function() {
	// Stuff that happens when you hover on + the stop()
	$('.hover', this).stop().animate({
		'opacity': 1
		}, 700,'easeOutSine')
	
	},function() {	
	// Stuff that happens when you unhover + the stop()
	$('.hover', this).stop().animate({
		'opacity': 0
		}, 1200, 'easeOutQuad')
	})
});
	
	






// Fade In-Out Sprite Image
// From Soh Tanaka (http://www.sohtanaka.com/web-design/greyscale-hover-effect-w-css-jquery/)
$(document).ready(function(){
	$("ul.feidfx li").hover(function() { //On hover...
		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("a.fadeinfadeout").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
		//Animate the image to 0 opacity (fade it out)
		$(this).find("span").stop().fadeTo('slow', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("span").stop().fadeTo('slow', 1).show();
	});
});








// jQuery Like Flash Animation
$(document).ready(function() {
	$('#fade').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '478px'
	});


	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();

	$("ul.tabs li").click(function()
       {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});


});



$(document).ready(function() {
	$('#fade2').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '400px'
	});


	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();

	$("ul.tabs li").click(function()
       {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});


});




$(document).ready(function() {
	$('#fade3').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '382px'
	});


	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();

	$("ul.tabs li").click(function()
       {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});


});












// jQuery SmoothScroll | Version 09-11-02  - Source: http://blog.medianotions.de/en/articles/2009/smoothscroll-for-jquery
$(document).ready(function(){
$('a[href*=#]').click(function() {

   // duration in ms
   var duration=1000;

   // easing values: swing | linear
   var easing='swing';

   // get / set parameters
   var newHash=this.hash;
   var target=$(this.hash).offset().top;
   var oldLocation=window.location.href.replace(window.location.hash, '');
   var newLocation=this;

   // make sure it's the same location      
   if(oldLocation+newHash==newLocation)
   {
      // animate to target and set the hash to the window.location after the animation
      $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {

         // add new hash to the browser location
         window.location.href=newLocation;
      });

      // cancel default click action
      return false;
   }

});
});




// Expand / Collapse

$(document).ready(function(){
	
	$(".toggle_container").hide();

	$("h3.expand_heading").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$("h3.expand_heading").click(function(){
		$(this).next(".toggle_container").slideToggle("slow,");
	});
	

});






//EOF
