
	// TABS

	function init_tabs() {
		if (!$('.tabMe').length) {
			return;
		}
		$('div.tab_content_wrap').each(function() {
			$(this).find('div.tab_content:first').fadeIn('fast');
		});
		$('ul.tabMe a').click(function() {
			if (!$(this).hasClass('active')) {
				$(this).addClass('active').parent('li').siblings('li').find('a.active').removeClass('active');
				$($(this).attr('href')).fadeIn('fast').siblings('div.tab_content').hide();	
			}
			this.blur();
			return false;
		});
	}
	
	
	
	
	


$(document).ready(function() {
	
	init_tabs();
	
	$('ul li:first-child').addClass('first-child');
	$('ul li:last-child').addClass('last-child');
	
	// TOP NAV DROP DOWN
	$('.dropDown').hover(function () {$('div', this).slideDown(150); $('a', this).addClass('dropDown');}, function () {$('div', this).slideUp(150); $('a', this).removeClass('dropDown');});
	
	
	// SLIDESHOWS
	
    $('#slideshow')
		.before('<div id="heroNav">') 
		.cycle({fx: 'fade',
			speed:   600, 
			timeout: 7000,
			pager:  '#heroNav' 
	});
	

	$('#factSlides')
		.cycle({fx: 'scrollHorz',
			speed:   600, 
			timeout: 0,
			next:   '#factNav .next', 
			prev:   '#factNav .prev'
	});






	// LOGO INTERFACE

	$('#licensedBrands').each(function() {
		var p = this.parentNode;
		$(this).cycle({
			fx: 'scrollHorz',
			speed: 600,
			timeout: 0,
			prev: '#licensedBrandsNav .prev',
			next: '#licensedBrandsNav .next',
			after: onAfter 
		});
		function onAfter(curr,next,opts) {
			var caption = (opts.currSlide + 1) + ' of ' + opts.slideCount;
			$('.counter').html(caption);
			}	
	});


	$('#komarBrands').each(function() {
		var p = this.parentNode;
		$(this).cycle({
			fx: 'scrollHorz',
			speed: 600,
			timeout: 0,
			prev: '#komarBrandsNav .prev',
			next: '#komarBrandsNav .next',
			after: onAfter 
		});
		function onAfter(curr,next,opts) {
			var caption2 = (opts.currSlide + 1) + ' of ' + opts.slideCount;
			$('.counter2').html(caption2);
			}	
	});


// SHOW BACKGROUND IF LESS THAN 9 ITEMS
/*if ( $('#licensedBrands .frame1').children().size() < 9) {$('#licensedBrands .frame1').addClass('showBG');}
if ( $('#licensedBrands .frame2').children().size() < 9) {$('#licensedBrands .frame2').addClass('showBG');}
if ( $('#licensedBrands .frame3').children().size() < 9) {$('#licensedBrands .frame3').addClass('showBG');}
if ( $('#licensedBrands .frame4').children().size() < 9) {$('#licensedBrands .frame4').addClass('showBG');}
if ( $('#komarBrands .frame1').children().size() < 9) {$('#komarBrands .frame1').addClass('showBG');}
if ( $('#komarBrands .frame2').children().size() < 9) {$('#komarBrands .frame2').addClass('showBG');}
if ( $('#komarBrands .frame3').children().size() < 9) {$('#komarBrands .frame3').addClass('showBG');}
if ( $('#komarBrands .frame4').children().size() < 9) {$('#komarBrands .frame4').addClass('showBG');}*/

$('#licensedBrandsBtn .showCounter').show();

if ( $('#licensedBrands').children().size() > 1) {$('#licensedBrandsNav').show();}
	
if ( $('#licensedBrands').children().size() < 2) {$('#licensedBrandsBtn .showCounter').hide();}
		
	
		
	$('#komarBrandsBtn').click(function() {$('#licensedBrandsNav').hide(); $('#komarBrandsBtn .showCounter').show(); $('#licensedBrandsBtn .showCounter').hide(); if ( $('#komarBrands').children().size() > 1) {$('#komarBrandsNav').show();} else {$('#komarBrandsBtn .showCounter').hide(); };} );
		
	$('#licensedBrandsBtn').click(function() {$('#komarBrandsNav').hide(); $('#licensedBrandsBtn .showCounter').show(); $('#komarBrandsBtn .showCounter').hide(); if ( $('#licensedBrands').children().size() > 1) {$('#licensedBrandsNav').show();} else {$('#licensedBrandsBtn .showCounter').hide(); };} );
	
		
		
		
// LOGO ROLLOVERS

	$("#logoHero .slide li").hover(function() {
		$('#logoHero .tab_content').css({'z-index' : '13'});
//		$('#logoHeroNav').css({'z-index' : '11'});
		$(this).css({'z-index' : '445'});
		} , function() {
		$('#logoHero .tab_content').css({'z-index' : '0'});
//		$('#logoHeroNav').css({'z-index' : '999'});
		$(this).css({'z-index' : '1'});
	});
		
	$("#logoHero .slide li.slot04").hover(function() {
	
		$('.borderMask.bottom2').css({'background-color' : '#666'});
		
		} , function() {
			$('.borderMask.bottom2').css({'background-color' : '#cbcbcb'});
	});

// LOGO CAPTIONS
	
$("#logoHero .slide li").hover(function() {

	$(this).find('div.caption').fadeIn(400);
	
	} , function() {
		$(this).find('div.caption').fadeOut(400);
});
	


	
});




/// PORTFOLIO LOGO FUN


