Cufon.replace('.side-box-top h3, .promo-cnt p, .promo-cnt h3, .info-cnt .row h3, .sticky .entry h3, .small-box h4', { fontFamily: 'helvetica_neue_bold' });
Cufon.replace('.cart-items p span, .cart-items p strong, .currency-form label, .best-list li a, p.footer-nav a', { fontFamily: 'helvetica_neue_bold' });
Cufon.replace('#top-nav p.nav a, #navigation ul li a', { fontFamily: 'helvetica_neue_bold', textShadow: '1px 1px #fff', hover: {textShadow: false}});
Cufon.replace('#top-nav p.nav span, .language-menu p span', { fontFamily: 'helvetica_neue_bold', textShadow: '1px 1px #fff' });
Cufon.replace('ul.side-links li a, .promo-cnt a.more-link', { fontFamily: 'helvetica_neue_bold', hover: true });
Cufon.replace('.promo h2', { fontFamily: 'helvetica_neue_bold', color: '-linear-gradient(#e18f16, #d70d01)' });

Cufon.replace('#slider ul li .item-info .info-cnt .row p em, #slider ul li .item-info .info-cnt .row p span', { fontFamily: 'helvetica_neue' });
Cufon.replace('.sticky .entry p, .small-box p, .small-box a.more', { fontFamily: 'helvetica_neue' });

Cufon.replace('.rounded, .sticky h2 ', { fontFamily: 'vag_rounded_bt', color: '-linear-gradient(#e18f16, #d70d01)'  });

$j(document).ready(function(){ 
	$j('#slider').jcarousel({
		auto: 1,
		scroll: 1,
		wrap: 'both',
		initCallback:  mycarousel_initCallback,
		itemVisibleInCallback: mycarousel_itemVisibleInCallback
	});
	
	if ($j.browser.msie && $j.browser.version.substr(0,1)<7) {
		DD_belatedPNG.fix('h1#logo a, .side-box-top, .side-box-bottom, #navigation, #navigation ul li.first a:hover, #navigation ul li.first a.active, #navigation ul li.last a:hover, #navigation ul li.last a.active, #slider ul li h2.rounded, #slider-nav-holder, .small-box-top, .small-box-bottom, a.footer-logo');
	};	
	
	center_slider_nav();
	
	$j('.boxes-row').each(function() {
		var blocks = $j(this).find('.small-box-holder .small-box');
		var max_height = 0;
		blocks.each(function() {
			var this_height = $j(this).height();
			if (this_height > max_height) {
				max_height = this_height;
			}
		});
		$j(this).find('.small-box-holder .small-box').css('height', max_height);
	});			
});
function mycarousel_initCallback(carousel) {
	$j("#slider-nav ul li a").bind("click", function() {
		var index = $j(this).attr("id").split("_");
		carousel.scroll(jQuery.jcarousel.intval($j(this).text()));
		$j("#slider-nav ul li a").removeClass("active"); //Remove any "active" class
		$j(this).addClass("active");
        return false;	
	});
	$j('#mycarousel-next').bind('click', function() {
		carousel.next();
		return false;
	});

	$j('#mycarousel-prev').bind('click', function() {
		carousel.prev();
		return false;
	}); 
	Cufon.refresh();
};
function mycarousel_itemVisibleInCallback(carousel, item, index, state) { 
	$j('#slider-nav ul li a').removeClass('active');
	$j('#slider-nav ul li a').each(function() {
		var rel = $j(this).text();
		if (rel == index) {
			$j(this).addClass('active');
		};
	})
}

function center_slider_nav() {
	var nav = $j('#slider-nav');
	var holder_width = $j('#slider-nav-holder').width();
	var nav_width = nav.width();
	var space_left = holder_width - nav_width;
	space_left = space_left/2;
	nav.css('padding-left', space_left)
}
