$(document).ready(function() {

	$('div.buttonSearch a').live('click', function(){
		$('form#searchForm').submit();
		return false;
	})
	
	$('div.subsection').hide();
	$('div.section[id=active]').next('div.subsection').show();
	$('div.item[id=active]').next('div.subsection').show();
	
	$('div.section > img.section').click(function(){
		if ($(this).parent().next('div.subsection').is(':hidden')) {
			/*$.ajax({  
				type: "GET",  
				url: $('div#site_name').html() + "include/ajax/katalog_list.php",  
				data: 'katalog=' + $(this).next().attr('href').replace('katalog/', ''),
				dataType: "html",
				success: function(html){
					$('div.centerSide').html(html);
				}
			});*/
			$(this).attr('src', 'images/minus.png');
			$(this).parent().attr('id', 'active');
			$(this).parent().next('div.subsection').slideDown('normal');
			$('div.section[id=active]').not( $(this).parent() ).find('img.section').attr('src', 'images/plus.png');
			$('div.section[id=active]').not( $(this).parent() ).next('div.subsection').slideUp('normal');
			$('div.section[id=active]').not( $(this).parent() ).removeAttr('id');
		}
		else {
			$(this).attr('src', 'images/plus.png');
			$(this).parent().removeAttr('id');
			$(this).parent().next('div.subsection').slideUp('normal');
		}
		return false;
	});
	
	$('div.item > img.item').click(function(){
		if ($(this).parent().next('div.subsection').is(':hidden')) {
			$(this).attr('src', 'images/minus.png');
			$(this).parent().attr('id', 'active');
			$(this).parent().next('div.subsection').slideDown('normal');
		}
		else {
			$(this).attr('src', 'images/plus.png');
			$(this).parent().removeAttr('id');
			$(this).parent().next('div.subsection').slideUp('normal');
		}
		return false;
	});

});
