function toggleBadge(badgeType) {

    $('#badges textarea').hide();

    switch (badgeType) {

        case 'chain':

            $('#badges #chain_code').show();

            $('#badges #chain_code').select();

            break;

        case 'horiz':

            $('#badges #horiz_code').show();

            $('#badges #horiz_code').select();

            break;

        case 'vert':

            $('#badges #vert_code').show();

            $('#badges #vert_code').select();

            break;

    }

}

/****  LISTENERS  ****/

$zt((function() {

    $('.carousel').jcarousel({
        scroll: 1,
        visible: 1,
        auto: 5,
        wrap: 'last',
        buttonNextHTML: '<div class="next"><a href="#" onclick="return false;"><img src="/media/images/carousel_next.gif" alt="next" /></a></div>',
        buttonPrevHTML: '<div class="previous"><a href="#" onclick="return false;"><img src="/media/images/carousel_prev.gif" alt="next" /></a></div>'
    });

/*
	// get the initial width and height
	// for product images
	var width = $('.img-wrapper img').width();
	var height = $('.img-wrapper img').height();

	// is it too narrow?
	if (width < 175) {

		// set the width to the correct value
		$('.img-wrapper img').width(175);

		// find out what percentage increase we just made
		var percentage_increase = 175/width;

		// set the height to be height * percentage increase
		$('.img-wrapper img').height(height * percentage_increase);
	}

	// overwrite the height variable and check again
	var height = $('.img-wrapper img').height();

	// is it too tall?
	if (height > 175) {

		// we need to get the width again, in case the above
		// condition was met
		var width = $('.img-wrapper img').width();

		// set the height to the correct value
		$('.img-wrapper img').height(175);

		// find out what percentage decrease we need
		var percentage_decrease = 175/height;

		// set the width to width * percentage decrease
		$('.img-wrapper img').width(width * percentage_decrease);

	}*/

    //rating
    $('form.rateabledisplay').rateabledisplay();

}));