var design = {
	init : function() {
		$('#up').click(function(){
			$.scrollTo( 0, {speed:700} );
			return false;
		});	

		$("#latest_forum").accordion({ 
			event: "mouseover" 
		});		

		$("#latest_soft").accordion({ 
			event: "mouseover" 
		});	
		
		$(".popup").fancybox({ 'hideOnContentClick': true }); 
		
		if ($('#d_box1').height() > $('#d_box3').height()) {
			$('#d_box3').height($('#d_box1').height())
		} else {
			$('#d_box1').height($('#d_box3').height())
		}
		
	}
}



var action = {	
	init : function() {
		$(".font_up").click(function(el) {
			if (action.font_size < 130) {
				action.font_size += 10;
				$('#content').animate({fontSize: action.font_size+'%'},50);	
			}
		});

		$(".font_down").click(function(el) {
			if (action.font_size > 70) {	
				action.font_size -= 10;
				$('#content').animate({fontSize: action.font_size+'%'},50);	
			}
		});				
	},
	font_size : 100	
}


var search = {
	init : function() {
		$('#szukaj').keyup(function() {			
			if ( ($(this).val() != '') && (search.visable == 'off') ) {
				search.visable = 'on';
				$("#search_options").slideDown("normal");
			} 

			if ( ($(this).val() == '') && (search.visable == 'on') ) {
				search.visable = 'off';
				$("#search_options").slideUp("normal");				
			}	
		}).click(function() {
			$(this).val('');
		});
		
		$('#close a').click(function() {
			$("#search_options").slideUp("normal");
			search.visable = 'off';
		}); 
	},
	visable : 'off'

}
