function resizeContent()
{
	$('.sub_content').each(function() {
		hei = $(this).height();
		$(this).parent().height(hei-12);
	});
}

select_color_error = '#b01f40';
select_color = '#baca9b';



$(document).ready(function() {
	$('.sub_box').each(function() {
		hei = $(this).height();
		$(this).parent().height(hei-12);
	});


	$('a[rel=external]').click(function() {
		$(this).attr('target', '_blank');
	});

	resizeContent();
	setInterval(resizeContent, 500);

	$('#slogan').flash({
		src: '/upload/'+router.language+'/slogan2.swf',
		width: 660,
		height: 200,
		wmode: 'transparent'
	});

	

	$navi = $('#navigation');
	$tabs = $('#tabs');

	if($navi.length>0)
	$navi.css('marginLeft', Math.round($navi.width()/-2));

	if($tabs.length>0)
	{
		function tabClick(el)
		{
			$el = $(el);
			$el.parent().children().removeClass('active');
			$el.addClass('active');
			$('.tab_container').hide().eq($el.index()).show();
			resizeContent();
		}

		$('.pdf', $tabs).click(function() {
			$tabs.css('backgroundPosition', '0px 0px');
			tabClick(this);
			return false;
		});
		$('.video', $tabs).click(function() {
			$tabs.css('backgroundPosition', '0px -44px');
			tabClick(this);
			return false;
		});
		$('.gallery', $tabs).click(function() {
			$tabs.css('backgroundPosition', '0px -88px');
			tabClick(this);
			return false;
		});
		$('.links', $tabs).click(function() {
			$tabs.css('backgroundPosition', '0px -132px');
			tabClick(this);
			return false;
		});
	}



});
