// JavaScript Document
//alert('this is the homepage');

jQuery(document).ready(function(){
	
	//Cycle for product views		
	jQuery('#slider').cycle({ 
		fx: 'scrollLeft', 
		timeout:  0,
		next: "#next",
		speed:300
	});
		

	//Tabbed navigation (left column)
	jQuery(function () {
		
		/*
		//Get all of the tab content containers
		tabContainers = jQuery('#info_slider_hold > div');

		//Hide everything except for the first tab
		tabContainers.hide();

		//Show the first tab
		tabContainers.filter(':first').slideDown(200);	
		
		*/

		//Add click event for tabs
		jQuery('#info_slider_nav ul li a').click(function () {
														   
			var tabContainers = jQuery('#info_slider_hold > div');														   
			
			//Hide all tabs
			tabContainers.slideUp(200);

			//Add the active class to this tab (use a different class if first item)
			var thisli = jQuery(this).parent();
			var thisindex = jQuery('#info_slider_nav ul li').index(thisli);
			
			//Show corresponding tab
			tabContainers.filter(':eq('+thisindex+')').slideDown(200);
			//console.log(thisindex);
			//console.log(tabContainers.filter(':eq('+thisindex+')').text());
			
			//Remove the active class from all the tabs
			jQuery('#info_slider_nav ul li').removeClass('active');
			jQuery('#info_slider_nav ul li').removeClass('active_left');
			
			if(thisindex == 0){
				jQuery(this).parent().addClass('active_left');
			} else {
				jQuery(this).parent().addClass('active');					
			}		
			return false;
			
		}).filter(':first').click();
	});
		
});
