$(document).ready(function () {
	$("#toggle_movie_container a").click(function() {
	  $this = $(this);
	  if ($this.html() == 'SHOW MOVIE') {
		  $("#movie_swf").show("slow");
		  $("#toggle_movie_container").removeClass('show');
		  $this.html('<img src="images/hide_movie.png" alt="" />');
	  } else {
		  $("#movie_swf").hide("slow");
		  $("#toggle_movie_container").addClass('show');
		  $this.html('SHOW MOVIE');
	  }
	});
	$.Lightbox.construct({
		download_link: false,
		ie6_upgrade: false,
		show_linkback: false,
		show_info: true
	});
	$('form.client_validate').validate({meta: 'rules'});
	$('#flash_messagescontainer').hide().slideDown('slow');
	$('input.date_picker').datepicker({dateFormat: 'dd.mm.yy', showWeekNumbers: true});
	$('textarea.fck').fck({path: '/js/fckeditor/', height:500, width: 600, toolbar: 'Default'});
	$('div.news_item img, img.rounded_corners').each(function() {
		$this = $(this);
		$this.load(function() {
			$this = $(this);
			$this.wrap('<div class="fit_div"></div>');
			var w = $this.parent('div.fit_div');
			w.width($this.width());
			w.height($this.height());
			w.corner("10px");
		});
		if (this.complete && this.naturalWidth !== 0 ) {
			$this.trigger('load');
		}
	});
});
