$(document).ready(function(){
	$('.foliogrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'275px'},{queue:false,duration:200});
	}, function() {
		$(".cover", this).stop().animate({top:'310px'},{queue:false,duration:500});
	});
});

/* Copyright (c) 2008 Kean Loong Tan http://www.gimiti.com/kltan
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * jFlow
 * Version: 1.1 (May 22, 2008)
 * Requires: jQuery 1.2+
 */
(function(A){A.fn.jFlow=function(D){var E=A.extend({},A.fn.jFlow.defaults,D);var F=0;var B=A(".jFlowControl").length;A(this).find(".jFlowControl").each(function(G){A(this).click(function(){A(".jFlowControl").removeClass("jFlowSelected");A(this).addClass("jFlowSelected");var H=Math.abs(F-G);A(E.slides).animate({marginLeft:"-"+(G*A(E.slides).find(":first-child").width()+"px")},E.duration*(H));F=G})});A(E.slides).before('<div id="jFlowSlide"></div>').appendTo("#jFlowSlide");A(E.slides).find("div").each(function(){A(this).before('<div class="jFlowSlideContainer"></div>').appendTo(A(this).prev())});A(".jFlowControl").eq(F).addClass("jFlowSelected");var C=function(G){A("#jFlowSlide").css({position:"relative",width:E.width,height:E.height,overflow:"hidden"});A(E.slides).css({position:"relative",width:A("#jFlowSlide").width()*A(".jFlowControl").length+"px",height:A("#jFlowSlide").height()+"px",overflow:"hidden"});A(E.slides).children().css({position:"relative",width:A("#jFlowSlide").width()+"px",height:A("#jFlowSlide").height()+"px","float":"left"});A(E.slides).css({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")})};C();A(window).resize(function(){C()});A(".jFlowPrev").click(function(){if(F>0){F--}else{F=B-1}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected")});A(".jFlowNext").click(function(){if(F<B-1){F++}else{F=0}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*A(E.slides).find(":first-child").width()+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected")})};A.fn.jFlow.defaults={easing:"swing",duration:400,width:"100%"}})(jQuery);

$(document).ready(function(){  
 
     //Caption Sliding (Partially Hidden to Visible)  
     $('.boxgrid.caption').hover(function(){  
         $(".cover", this).stop().animate({top:'54px'},{queue:false,duration:160});  
     }, function() {  
         $(".cover", this).stop().animate({top:'100px'},{queue:false,duration:160});  
     });  
 });

$(function () {
  
  $('.bottom-content')
    
    // within the context of the bottom-content element, find the a.button elements
    .find('a.button')
    
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" />').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
        
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(500, 1);
      }, function () {
        // off hover
        
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(500, 0);
      });
    });
});

$(function () {
  
  $('#button-left, #button-right')
    
    // within the context of the bottom-content element, find the a.button elements
    .find('span.fade')
    
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" />').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
        
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(500, 1);
      }, function () {
        // off hover
        
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(500, 0);
      });
    });
});

$(function () {
  
  $('#nav')
    
    // within the context of the bottom-content element, find the a.button elements
    .find('span.span-text')
    
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" />').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
        
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(500, 1);
      }, function () {
        // off hover
        
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(500, 0);
      });
    });

	$("span.span-text").click(function(){
			
			$("span.active").addClass("span-text");
			$("span.active").removeClass("active");
			
			$(this).addClass("active");
			$(this).removeClass("span-text");
	});
	
	$("a.second").click(function(){
			
			$("span.active").addClass("span-text");
			$("span.active").removeClass("active");
			
			var switcher = $(this).attr("title");
			
			$("."+switcher).addClass("active");
			$("."+switcher).removeClass("span-text");
	});

});

$(document).ready(function(){

	$("span.active").removeClass("span-text");

	$("#myController").jFlow({
		slides: "#slides",
		width: "520px",
		height: "310px",
		duration: 400
	});
});

$(document).ready(function()
{
	//fade("#sliding-navigation", 25, 15, 150, .8);
	// When a link is clicked
		$("a.tab").click(function () {
			
			// slide all content up
			$("div.content").fadeOut(1000);
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn(1000);
		  
		});
	
});