/* 	*****************************************
	*	Javascript functions page for resumesalt.com
	*	Resume Salt, Dawn McKenna Professional Resume Writer	 	
	*	Copyright  2011 Ananke IT Solutions	
	*   http://www.ananke.com 
	*	shawn.boyle@ananke.com	
	***************************************** */ 


	
$(document).ready(function() {
	$("#coin-slider").coinslider({delay: 15000, width: 550, height: 380, links: false, effect: "straight",  hoverPause: true});
	
	// this validates the contact form information
	$("#contactform").validate();

	// this fades in the navigation and main content
	$("#content").fadeIn(5000);
	
	$("#flashmessage").delay(6000).slideUp("slow", function() {
		$("flashmessage").fadeOut(1000);
	});
	
	// this makes the navigation slide out new center div 
	$("#content").cycle({
		prev: "#leftArrow",
		next: "#rightArrow",
		fx:        "cover",
		activePagerClass: "activeSlide",
		direction: "right", // one of up|down|left|right  default=left
		timeout: 0,
		pager:  "#nav ul",
		pagerAnchorBuilder: function(idx, slide) {
			// return sel string for existing anchor
			return "#nav li:eq(" + (idx) + ") a";
		}
	});

	// This is for the tabbed content
	$(function() {	
		//Default Action
		$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content
		
		//On Click Event
		$("ul.tabs li").click(function() {
			$("ul.tabs li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content
			var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active content
			return false;
		});
	}); 
	
	// This is for the tabbed content on about
	$(function() {	
		//Default Action
		$(".bio_content").hide(); //Hide all content
		$("ul.bio li:first").addClass("active").show(); //Activate first tab
		$(".bio_content:first").show(); //Show first tab content
		
		//On Click Event
		$("ul.bio li").click(function() {
			$("ul.bio li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".bio_content").hide(); //Hide all tab content
			var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active content
			return false;
		});
	});
	
	// This is for the tabbed content on sustainability
	$(function() {	
		//Default Action
		$(".sustain_content").hide(); //Hide all content
		$("ul.sustain li:first").addClass("active").show(); //Activate first tab
		$(".sustain_content:first").show(); //Show first tab content
		
		//On Click Event
		$("ul.sustain li").click(function() {
			$("ul.sustain li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".sustain_content").hide(); //Hide all tab content
			var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active content
			return false;
		});
	});
	
	// prints the current year in the footer
	var currentYear = (new Date).getFullYear();
    $("#year").text( (new Date).getFullYear() );
});
