/**
 * @author Marcin
 */



$(document).ready(function() {
	$('a.spamemail').nospam();
	form_validation();
	validate_all();
	
	$('.tmenu li:last').addClass('last');
	$('.tmenu ul a').each(function(){
		$this = $(this);
		$thisHref = $this.attr('href');
		$thisHref = $thisHref + '#flashcontent';
		$this.attr('href', $thisHref);
	});
	$('#footer ul li:last a').addClass('last');
	
	$('#rotator').cycle({
		fx:		'fade',
		height:	'608px'
	});
	
	$('.hpcontent').hide();
	$('#hp').append('<div class="hpcontentsw"><a class="off"></a></div>')
	
	$('.hpcontentsw').hover(
		 function () {
    		$(this).addClass('hover');
 		},
  		function () {
    		$(this).removeClass('hover');
  		});
	$('.hpcontentsw').bind("click", function(){ 
		$this = $(this);
		$thisa = $this.find('a');
		if ($thisa.attr('class') == 'off') {
			$('.hpcontent').slideDown('slow');
			$thisa.attr('class', 'on');
		}
		else if ($thisa.attr('class') == 'on') {
			$('.hpcontent').slideUp('slow');
			$thisa.attr('class', 'off');
		}
	});
	
	$(".post:not(.single) img").lazyload({
		effect : "fadeIn"
	});
	$('.post a:has(img), .post img')
		.css('cursor', 'default')
		.click(function(){return false;})
		.bind('contextmenu', function(){return false;}
	);
	
	$("div#gallery a").slowfade({use_span_class:"slowfade",use_class:"slowfade_mod", add_inner_html:true, ie6comp:"ie6fix"});
	
});

