$(document).ready(function() {	
	
	$('#main-fotorep').cycle({ 
			fx:      'fade', 
			speed:    1000, 
			timeout:  5000
	}); 
	
	karusel($('#mycarousel'));
	karusel($('#mycarousel2'));
	
	function karusel(name){
		name.jcarousel({
			wrap: 'circular'
		});
	}
	
	//comments
	var commentLink = $('#add-comment-link > div.add-comment-link_title');
	var commentBlock = $('#add-comment-link > div.add-comment-link_form');

	commentLink.click(function(){
		commentBlock.toggle();
	});
	
	var site = function() {
		this.navLi = $('#top-nav-first-menu li').children('ul').hide().end();
		this.init();
	};

	site.prototype = {
		
		init : function() {
			this.setMenu();
		},
		
		// Enables the slidedown menu, and adds support for IE6
		
		setMenu : function() {
		
			$.each(this.navLi, function() {
				if ( $(this).children('ul')[0] ) {
					$(this)
						.append('<span />')
						.children('span')
						.addClass('hasChildren')
				}
			});
		
			this.navLi.hover(function() {
				// mouseover
				$(this).find('> ul').stop(true, true).slideDown(300);
			}, function() {
				// mouseout
				$(this).find('> ul').stop(true, true).hide(); 		
			});
			
		}
	 
	}

	new site();
	
});