jQuery(document).ready(function(){
 
	$('span.absoluteBrombal').parent().addClass('relative');
	
	$("a.fancybox, .zoom").fancybox();

	$("a.fancyboxvideo").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
	});
	
	//display text
	$(".text").fancybox({
		'titlePosition'     : 'inside',
		'transitionIn'      : 'elastic',
		'transitionOut'     : 'elastic',
		'padding'           : 0
	});	
 

	$('p.backTop a').click(function(){
     $('html, body').animate({scrollTop: '0px'}, 700);
     return false;
	});

	$('#productSidebar h4').filter(':first').addClass('first');
	
	// adds Parent class to every list item that have subNav
	$('ul.subNav').parent('li').addClass('subNavParent');
	
	//add class=last to each last child of each subNav
	$('ul.subNav li').filter(':last-child').addClass('last');
	
	// add class last to every last footer list item
	$('#footer #links .col ul li').filter(':last-child').addClass('last');	
	
	// Fade in and Fade out Drop down
	$('.subNavParent').hover(function(){
		$(this).addClass('hoverParent').find('ul.subNav').fadeIn(500);
	}, function(){
		$(this).removeClass('hoverParent').find('ul.subNav').fadeOut(100);
	});
	
	
		
	// tabs function
	$(function(){
	var tabPanel = $('div.tabPanel'); // Sidebar Tab content
 	tabPanel.hide().filter(':first').show();
 	
	$(".tabs ul li:first").addClass("active");	
	
	$('.tabs ul li  a').click(function(){
			var Clicked = tabPanel.filter(this.hash); // gets the target id of the clicked link
						
			tabPanel.filter(':visible').fadeOut(200, function() { // slides up the content tab being shown, time = 0.7 seconds
			Clicked.fadeIn(100);			
			});

		$('.tabs ul li').removeClass('active');
		$(this).parent().addClass('active');
	
	return false;
	
	});
 
	});     

	/* equal height columns. they should be wrapped by a div with a class="equalHeights"
	function setEqualHeight(columns)  {  
 	var tallestcolumn = 0;  
 
 	columns.each(function()	{  
 		currentHeight = $(this).height();  
	 if(currentHeight > tallestcolumn)  {  
 		tallestcolumn  = currentHeight;  
 	}  
 	});  
	 columns.height(tallestcolumn);  
 	}  
 
	setEqualHeight($(".sameHeight"));  */
	
});

/* 1 *** IMAGE ZOOM */
/*jQuery(document).ready(function() {
	$("a.zoom img").mouseover(function(){
		$(this).stop(true,true);
		$(this).fadeTo(300, 0.6);
	});
	
	$("a.zoom img").mouseout(function(){
		$(this).fadeTo(400, 1.0);
	});
 
});*/
