/*
Theme Name: NaviTheme 2011
Theme URI: http://www.navltd.com/
Description: Navigator Ltd.'s Corporate Website Theme. Widgetized. Templated. Beautiful. Designed and developed by Mike Kormendy.
Version: v2.0
Author: Navigator Ltd.
Author URI: http://www.navltd.com/

This file is part of the Navigator Ltd. Blog Theme for WordPress
Copyright (c) 2011 Navigator Ltd. All rights reserved.
*/

/* ticker animation */
var tickerfirst = null;
function removeFirst() {
	tickerfirst = $('#right-col ul li:first').html();
	new_height = $('#right-col ul li:first').height();
	$('#right-col ul li:first').animate({opacity: 0}, 700).slideUp('slow', function() {
		$(this).remove();
		addLast(tickerfirst);
	});
	
}
function addLast(tickerfirst){
	last = '<li style="display:none;height:1px">'+tickerfirst+'</li>';
	$('#right-col ul').append(last);
	$('#right-col ul li:last').animate({height: new_height}, 700);
}

/* dom ready trigger */

$(document).ready(function() {
	// hover transition for css3 home icon
	if (!$('li.current_page_item > a > div.icon-home').length) {
		$(".icon-home").hover(
			function(/*in*/) {
				$(".icon-home-triangle").css({
					'border':'8px solid #00afd2', /* navi-teal */
					'border-left-color':'transparent',
					'border-right-color':'transparent',
					'border-top-color':'transparent'
				});
				$(".icon-home-rectangle").css({'background-color':'#00afd2'});
				$(".icon-home-line").css({'background-color':'#00afd2'});		
			},
			function(/*out*/) {
				$(".icon-home-triangle").css({
					'border':'8px solid #1b415a', /* navi-blue */
					'border-left-color':'transparent',
					'border-right-color':'transparent',
					'border-top-color':'transparent'
				});
				$(".icon-home-rectangle").css({'background-color':'#1b415a'});
				$(".icon-home-line").css({'background-color':'#1b415a'});
			}
		);
	}
	else {
		$(".icon-home").hover(
			function(/*in*/) {
				$(".icon-home-triangle").css({
					'border':'8px solid #78B900', /* navi-green */
					'border-left-color':'transparent',
					'border-right-color':'transparent',
					'border-top-color':'transparent'
				});
				$(".icon-home-rectangle").css({'background-color':'#78B900'});
				$(".icon-home-line").css({'background-color':'#78B900'});		
			},
			function(/*out*/) {
				$(".icon-home-triangle").css({
					'border':'8px solid #00afd2', /* navi-teal */
					'border-left-color':'transparent',
					'border-right-color':'transparent',
					'border-top-color':'transparent'
				});
				$(".icon-home-rectangle").css({'background-color':'#00afd2'});
				$(".icon-home-line").css({'background-color':'#00afd2'});
			}
		);
	}

	/* scaffold scroll up hide intro splash movie
	$('#nav a').toggle(
		function () {
        	$('#scaffold').animate({top: "80px"},1500,'easeInOutSine');
			$('#content').animate({height:"+=525"},1500,'easeInOutSine');
		},
		function () {
        	$('#scaffold').animate({top: "570px"},1500,'easeInOutSine');
			$('#content').animate({height:"-=525"},1500,'easeInOutSine');
      	}
    );
	*/

	$("#masthead #video").css({'display':'none'});
	/* scaffold scroll up hide intro splash movie 
	setTimeout(function() {
		$('#content').css({height:"+=525"});
		$('#scaffold').animate({top: "80px"},1500,'easeInOutSine', function () {
			$("#masthead #video").css({'display':'none'});
		});
	},1);
	*/
	
	
	
	/* team filtering page */
	$('#filterlist a').click(function(){
		var selector = $(this).attr('rel');
		$('#teamlist').isotope({ filter: selector });
		return false;
	});
	// activates
	var selector = $(this).attr('rel');
	$('#teamlist').isotope({ filter: '*' });
	
	$("#mySlider").royalSlider({
        captionShowEffects:["moveleft", "fade"],
        directionNavAutoHide: true,
		slideTransitionSpeed:400,              
		slideTransitionEasing:"easeInOutCubic",
		controlNavEnabled:false,
		slideshowEnabled: true,           
		slideshowDelay:7000
        /* other options go here, view javascript options to learn more */
					
    });
	
	// ticker animation
	// setInterval(removeFirst,7500);
	
	
	/* corporate citizenship page content switcher */
	$(".tab_content").hide(); // hide all content
	// $("ul.tabs li:first").addClass("active").show(); // activate first tab
	$(".tab_content:first").show(); // show first tab content

	$("ul#tabs li").click(function() { // onclick event

		// $("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 href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); // fade in the active ID content
		return false;
	});

});

/*
function expand() {
	$("#menu1 > li > a[class=]").find("+ ul").slideToggle("medium");
}
		
function collapse() {
	$("#menu1 > li > a[class=]").find("+ ul").slideToggle("medium");
}

$(document).ready(
	function () {
		// the following show the menu and highlight the active link when the page is active
		$("#menu2 > li[class=page_item page-item-931 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
		$("#menu2 > li[class=page_item page-item-14 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
		$("#menu2 > li[class=page_item page-item-1194 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
		$("#menu2 > li[class=page_item page-item-1116 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
		$("#menu2 > li[class=page_item page-item-2 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
		$("#menu2 > li[class=page_item page-item-2 current_page_ancestor ] > a").find("+ ul").show();
		
		// deactivates click functionality for main navigation items
		$(".menu > .page_item > a").click(function() { return false; });
			
		// Toggle the selected menu's class and expand or collapse the menu
		$("#menu1 > li > a").click(function() {
			$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("fast");
		});
	
		// Toggle the selected menu's class and expand or collapse the menu
		$("#menu2 > li > a").click(function() {
			$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("fast");
		});
		
		// time-based events
		setTimeout("menu()",300);
		setTimeout("expand()",1200);
		setTimeout("collapse()",2300); 
		setTimeout("logo()",2500);
		
		// filterable
		if ($("#teamlist").length) {
			$("#teamlist").filterable();
		}
	}
);
*/
