Cufon.replace('#navigation > ul > li > a', { fontFamily : 'Impact', hover : { color: '#b50144' } });

Cufon.replace('.box-nav ul li a', { fontFamily : 'Impact', hover : { color: '#b50144' } });
Cufon.replace('.dropdown a', { fontFamily : 'Impact', hover : { color: '#999999' } });

Cufon.replace('#footer .col h3, .contacts h3, .contacts h4', { fontFamily : 'Impact' });
Cufon.replace('.box-head h2, .box-head2 h2', { fontFamily : 'Impact' });
Cufon.replace('.box-countdown h2, .box-featured h3', { fontFamily : 'Impact' });
Cufon.replace('.box-nav ul li a, .box-facebook h3', { fontFamily : 'Impact' });
Cufon.replace('.box-news h3', { fontFamily : 'Impact' });
Cufon.replace('.box-video-player .title span', { fontFamily : 'Impact' });
Cufon.replace('.box-video-cat .info h2', { fontFamily : 'Impact' });
Cufon.replace('.request-form h3, .tabs ul li a', { fontFamily : 'Impact' });
Cufon.replace('.news-holder h2, .some-info h2, .tab-body h4', { fontFamily : 'Impact' });

jQuery(document).ready(function($) {
	$('.socials > ul li:last-child').addClass('last');
	$('.box-bor .latest ul li:last-child').addClass('last');
	$('.box-upcoming .entries .event:last-child').addClass('last');

	$.each($('div.archive-navigation a'), function(index, link) {
		if ($(link).html() == 'Previous') {
			link = $(link);
			link.addClass('btn-post-prev left');
			link.html('<em>Previous</em>');
		} else if ($(link).html() == 'Next') {
			link = $(link);
			link.addClass('btn-post-next right');
			link.html('<em>Next</em>');
		}
	});
	
	$('.shr-bookmarks-expand').wrap('<div class="social-links" />');
	
	var last_footer_li = $('#menu-footer-menu li:last-child');
	var last_footer_li_text = last_footer_li.html();
	last_footer_li.html(last_footer_li_text.substr(0, last_footer_li_text.lastIndexOf('|')));
});

jQuery(function($) {
	// nav
	$(".sub-nav ul li").hover(function() {
		$(this).css({ 'z-index' : 100 });
		$(this).find(".dd").show();
		$(this).find("a:eq(0)").addClass('hover');
	}, function() {
		$(this).css({ 'z-index' : 1 });
		$(this).find(".dd").hide();
		$(this).find("a:eq(0)").removeClass('hover');
		Cufon.replace('.sub-nav > ul > li > a', { fontFamily : 'Impact', hover : { color: '#b50144' } });
	});
	// focus
	$('.blink')
		.focus(function(){
			if( $(this).val() == $(this).attr('title') ) {
				$(this).val('');
			}
		})
		.blur(function(){
			if( $(this).val() == '' ) {
				$(this).val( $(this).attr('title') );
			}
		});
	
	// btn hover
	$('.submit-form .button, .box-newsletter .button, .request-form .button, .homepage-widgets .button').hover(function () {
		$(this).addClass('hover');
	}, function () {
		$(this).removeClass('hover');
	});
		
	slider = $('.slider');
	ul = $(slider).find('> ul');
	lis = $(ul).find('> li');
	current = 1;
	duration = 300;
	pause = 5000;
	
	ul.addClass('list');
	lis.addClass('item');
	
	var current_slider_position = 0;
	var num_all_slides = lis.length;
	
	function move_slider_to(index, stopAnimation) {
		if (stopAnimation === null) { stopAnimation = false; }
		current_slider_position = index;
		ul.animate({left: '-' + $(slider).width() * current_slider_position + 'px'}, duration);
		links = $('.slider-nav-holder ul li a');
		links.removeClass('active');
		$(links[current_slider_position]).addClass('active');
		clearTimeout(slide_change_timeout);
		if (!stopAnimation) {
			slide_change_timeout = setTimeout(function() {
				slider_next();
			}, pause);
		};
	}
	
	function slider_next() {
		if (current_slider_position == (num_all_slides-1)) {
			move_slider_to(0);
		} else {
			move_slider_to(current_slider_position + 1);
		};
	}
	
	function slider_previous() {
		if (current_slider_position == 0) {
			move_slider_to(num_all_slides-1);
		} else {
			move_slider_to(current_slider_position - 1);
		}
	}
	
	var slide_change_timeout = setTimeout(function() {
		slider_next();
	}, pause);
	
	$('.slider-nav-holder ul li a').click(function() {
		move_slider_to($('.slider-nav-holder ul li a').index(this), true);
		return false;
	});
	
	move_slider_to(0);
	
	// dropdown
	$('.dropdown .head').click(function () {
		$('.dropdown').css('z-index', '10');
		$(this).parents('.dropdown').css('z-index', '100');
		$(this).parent().find('ul').slideToggle();
		return false;
	});
	$('.dropdown ul a').click(function () {
		$(this).parents('.dropdown').find('.head').text($(this).text());
		$(this).parents('ul').css('z-index', '1').slideToggle();
		Cufon.replace('.dropdown a', { fontFamily : 'Impact', hover : { color: '#999999' } });
		return false;
	});
	
	// tabs
	$('.tab-body').hide();
	$('.tab-body:eq(0)').show();
	$('.tabs ul li a').click(function () {
		$('.tab-body').hide();
		var index = $('.tabs ul li a').index($(this));
		$('.tab-body').eq(index).show();
		
		$('.tabs ul li a').removeClass('active');
		$(this).addClass('active');
		
		return false;
	});
	
	// enjoy socials
	$('.enjoy ul li').hover(function () {
		$(this).stop().animate({
			top: '-8px'
		}, { duration: 150 });
	}, function () {
		$(this).stop().animate({
			top: '0'
		}, { duration: 150 });
	});
});

function slider_initCallback (carousel) {
	jQuery(".prev").click(function () {
		carousel.prev();
		return false;
	});
	
	jQuery(".next").click(function () {
		carousel.next();
		return false;
	});
	
	jQuery('.slider-nav a').bind('click', function() {
		carousel.scroll($.jcarousel.intval($(this).text()));
		return false;
	});
}

// function slider_firstInCallback(carousel, item, idx, state) {
// 	jQuery('.slider-nav a').removeClass('active');
// 	jQuery('.slider-nav a').eq(idx-1).addClass('active');
// };


