	    hs.graphicsDir = '/template/common/css/graphics/';
	    hs.outlineType = 'rounded-white';
		hs.showCredits = false;
		hs.allowSizeReduction = false;
		hs.wrapperClassName = 'draggable-header';
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
		hs.outlineType = 'rounded-white';
		hs.fadeInOut = true;
		hs.dimmingOpacity = 0.75;
		hs.dragByHeading = false;

		// define the restraining box
		hs.useBox = false;
		hs.width = 640;
		hs.height = 480;

		// Add the controlbar
		hs.addSlideshow({
			//slideshowGroup: 'group1',
			interval: 5000,
			repeat: false,
			useControls: false,
			fixedControls: 'fit',
			overlayOptions: {
				opacity: 1,
				position: 'top center',
				hideOnMouseOut: true
			}
		});

$(document).ready(function(){
	var total_width = 0;
	var max_width = 0;
	max_width = $('.gallery_img').parent().width();
	$('.gallery_img').each(function(){
		temp = $(this).width();
		temp += parseInt($(this).css('margin-left'));
		temp += parseInt($(this).css('margin-right'));
		temp += parseInt($(this).css('padding-left'));
		temp += parseInt($(this).css('padding-right'));
		total_width += temp;
		if (total_width > max_width) {
			$(this).before('<div class="clear"></div>');
			total_width = temp;
		}
	});
});
