// JavaScript Document

function toggleActive(tempid){
	$("#navWrapper ." + tempid + " a").addClass("activate"); //add class activate on the anchor tag
}

$(function(){ //smoothscroll

	$('a[href*=#]').click(function() {
	
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
		&& location.hostname == this.hostname) {
		
			var $target = $(this.hash);
			
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			
			if ($target.length) {
			
				var targetOffset = $target.offset().top;
				
				$('html,body').animate({scrollTop: targetOffset}, 1000);
					
				return false;
				
			}
			
		}
		
	});
	
});

$(document).ready(function(){
						   
	switch ($("#navWrapper").attr("class")) //get the class value of the navigation wrapper
	{
	case "menu1":
		toggleActive("menu1");
		break;
	case "menu2":
		toggleActive("menu2");
		break;
	}
	
	$('tbody tr:nth-child(odd)').addClass("odd"); // zebra table
	
	$('#bannerSlideWrapper').cycle({ 
		fx:    'fade',
		timeout: 2500,
		speed: 2500
	});

});
