﻿// Functions specific to a site.




(function ($) {
	$(document).ready(function () {
		// Place document manipulation code here

		//	 $('#mainnavigation ul.L1').superfish({
		//        delay: 500,                            // one second delay on mouseout 
		//        animation: { opacity: 'show' },  // fade-in and slide-down animation 
		//        speed: 'fast',                          // faster animation speed 
		//        autoArrows: false,
		//        dropShadows: false
		//    });

		Cufon.replace('h1, #content h2, h3, h4, .subnav-title, .overview-title, #socialHome p', { fontFamily: 'Helvetica Neue 500' });
		Cufon.replace('#home-content-header h2,#home-content-header h3,#home-content-header h4, .subnav-title, .overview-title, .news-title', { fontFamily: 'Helvetica Neue 400' });
		
		$('#ctas .latest-news li:last-child').addClass('last-child');

		$('#content ol li').wrapInner('<span></span>');

		$(".ob-trigger1").tooltip({
			tip: '.ob-tip1',
			offset: [216, 402],
			position: 'center left',
			effect: 'toggle',
			relative: true,
			delay: 1
		});

		$(".ob-trigger8").tooltip({
			tip: '.ob-tip8',
			offset: [136, 402],
			position: 'center left',
			effect: 'toggle',
			relative: true,
			delay: 1
		});

		for (var i = 2; i <= 7; i++) {
			$(".ob-trigger" + i).tooltip({
				tip: '.ob-tip' + i,
				offset: [176, 402],
				position: 'center left',
				effect: 'toggle',
				relative: true,
				delay: 1
			});
		}
		
		$('.overview-thumb .overview-box').mouseover(function () {
			$(this).siblings('.thumb').animate({ 'opacity': '0' }, 500);
		});

		$('.overview-thumb .overview-box').mouseout(function () {
			$(this).siblings('.thumb').animate({ 'opacity': '1' }, 500);
		});

		$('#our-brands').click(function () {
			$('#brands-wrapper').animate({ 'width': '463' }, 500,
				function () {
					$('#brands-wrapper').addClass('active');
					$('#rollover-block').hide();
				}
			);
		});

		$('#close-brands').click(function () {
			$('#brands-wrapper').animate({ 'width': '60' }, 500,
				function () {
					$('#brands-wrapper').removeClass('active');
					$('#rollover-block').show();
				}
			);
		});
		$('.overview-cell').wrapAll('<div class="overview" />');
		$('.overview .overview-cell:nth-child(4)').css('clear', 'both');
		$('#brands-container ul li:last-child a').addClass('last');

		$('.shuffle').randomImage({ path: '/images/home/banner/' });
		$('#sliders').cycle({
			fx: 'fade',
			speed: 'fast',
			timeout: 0,
			prev: '#prev2',
			next: '#next2'

		});
		
		$('#sliders ul').css({ background: 'none' });
		Shadowbox.init({
			handleOversize: "drag",
			animate: false
		});

		//	Superfish drop-down menus
		//		$('.main-nav ul.L1').superfish({
		//			delay: 500, // one second delay on mouseout
		//			animation: { opacity: 'show' }, // fade-in and slide-down animation
		//			speed: 'fast', // faster animation speed
		//			autoArrows: false,
		//			dropShadows: false
		//		}); 		
	});
})(jQuery);


