// JavaScript Document

//Slideshow
$(document).ready(function() {
	$('#slideshow')
	.after('<div id="slideshownav"></div><div id="slideshownav-end">')
	.cycle({ 
		fx:     'fade', 
		speed:  1000, 
		timeout: 6500,
		pager:  '#slideshownav',
		next:   '#next', 
		prev:   '#prev',
		pause:   1
	});
});


//Drop down menu effect
$(document).ready(function(){  
	$("#main-nav li").hover(function() {  
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideToggle(200);
		},function() {  
		$(this).find('ul:first').fadeOut(100);
	});  
});  


//Sub nav background effects
$(document).ready(function(){  
	$("#sub-nav li a").hover(function() {  
		$(this).stop().animate({ backgroundColor: "#7a7266"}, 200);  
		},function() {  
		$(this).stop().animate({ backgroundColor: "#f5f2e8" }, 500);  
	});  
});



/// FAQs
$(document).ready(function(){
	$( "#faqs" ).accordion({
		collapsible: true,
		autoHeight: false 
	});
});

$(document).ready(function(){ 
	$("#faqs h4 a").hover(function() { 
		$(this).stop().animate({ backgroundColor: "#7a7266"}, 200);  
		},function() {  
		$(this).stop().animate({ backgroundColor: "#8C9E2D" }, 500);  
	});
});


/// Glossary
$(document).ready(function(){
	$( "#glossary" ).accordion({
		active: 'none',
		collapsible: true,
		autoHeight: false 
	});
});

$(document).ready(function(){ 
	$("#glossary h4 a").hover(function() { 
		$(this).stop().animate({ backgroundColor: "#7a7266"}, 200);  
		},function() {  
		$(this).stop().animate({ backgroundColor: "#8C9E2D" }, 500);  
	});
});



/// Sample projects bg

/*$(document).ready(function() {
  $('.opacity-bg').css({opacity: ".6"});					   
  $('.sample-projects-content').hover(function() {
        $('.opacity-bg').stop().animate({ opacity: ".92"}, 200);  
		},function() {  
		$('.opacity-bg').stop().animate({ opacity: "0.6"}, 500);
	});
  
});*/


/// corporate carbon capture bg
$(document).ready(function() {
  $('.wide-container').hover(function() {
        $(this).css({color: "#fff"}).stop().animate({backgroundColor: "#8C9E2D"}, 300);
		$(this).find('h3').css({'border-bottom':'1px dotted #fff', 'color':'#fff'}); 
		},function() {  
		$(this).css({color: "#6D6755"}).stop().animate({backgroundColor: "#f5f2e8;"}, 500);
		$(this).find('h3').css({'border-bottom':'1px dotted #8c9e2d', 'color':'#5c5235'});
	});
  
});

/// Clickable href divs
$(document).ready(function() {
    $("div[href]").click(function () {
        window.location = $(this).attr("href");
    });
});



/// Species we plant bg
$(document).ready(function() {
  $('.tree-container, .shop-details').hover(function() {
        $(this).stop().animate({backgroundColor: "#ece9e0"}, 300); 
		},function() {  
		$(this).stop().animate({backgroundColor: "#f5f2e8;"}, 500);
	});
  
});

// Species we plant - Zoom on image
$(document).ready(function() {
	$(".tree-container img").hover(function() {
		$(this).css({'z-index' : '5000'}); 
		$(this).animate({top: '-30px', left: '-30px', width: '200px', height: '200px'}, 300);
		} , function() {
		$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
		$(this).animate({top: '10', left: '10', width: '120px', height: '120px'}, 300);
	});
});

/// shop
$(document).ready(function() {
  $('.category-wrapper').hover(function() {
        $(this).css({color: "#fff"}).stop().animate({backgroundColor: "#8C9E2D"}, 300);
		$(this).find('.title a').css({'color':'#fff'});
		},function() {  
		$(this).css({color: "#6D6755"}).stop().animate({backgroundColor: "#f5f2e8;"}, 500);
		$(this).find('.title a').css({'color':'#5C5235'});
	});
  
});

/// Shop-details
$(document).ready(function() {
  $('.shop-details').hover(function() {
        $(this).stop().animate({backgroundColor: "#ece9e0"}, 300);
		$(this).find('.title, .price').css({'color':'#5C5235'});
		},function() {  
		$(this).stop().animate({backgroundColor: "#f5f2e8;"}, 500);
		$(this).find('.title, .price').css({'color':'#5C5235'});
	});
  
});





