function showContactDetail(id) {
	$('#contact-detail-' + id).toggle(200);
}

/*$(function(){
    $("ul.main-menu li").hover(function(){    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");
});*/

$(document).ready(function(){
	var loginBubble = false;
	
	$("a[rel='gallery-image']").colorbox({
		opacity: 0.7,
		slideshow: true,
		slideshowAuto: false,
		slideshowStart: 'Přehrát',
		slideshowStop: 'Zastavit',
		previous: 'Zpět',
		next: 'Dál',
		close: 'Zavřít'
	});
	
	$(".bazaar-item-top-right a").colorbox({
		opacity: 0.7,
		previous: 'Zpět',
		next: 'Dál',
		close: 'Zavřít'
	});
	
	$('body').click(function(event) {
	    if (!$(event.target).closest('#bubble-login').length) {
	        $('#bubble-login').hide();
	    };
	    if (!$(event.target).closest('#bubble-search').length) {
	        $('#bubble-search').hide();
	    };
	    if (!$(event.target).closest('#bubble-menu').length) {
	        $('#bubble-menu').hide();
	    };
	});
	
	$('.classes-li').mouseenter(function(){
		$(this).find('.classes-pointer').show(0);
	});	
	
	$('.classes-li').mouseleave(function(){
		$(this).find('.classes-pointer').hide(0);
	});	
	
	$('#shortcut-login').click(function(){
		$('#bubble-login').toggle(200);
	});
		
	$('#shortcut-search').click(function(){
		$('#bubble-search').toggle(200);
	});
	
	$('#shortcut-menu').click(function(){
		$('#bubble-menu').toggle(200);
	});
			
	$('.homepage-post').mouseenter(function(){
		$(this).find('.homepage-post-hover').show(0);
	});	
	
	$('.homepage-post').mouseleave(function(){
		$(this).find('.homepage-post-hover').hide(0);
	});
		
	$('.contact-detail').click(function(){
		$(this).hide(200);
	});
	
	$('.answer-vote').click(function(){
		var id;
		id = $(this).attr('id');
		$.get('/ajax/ajax.php', {request: 'inquiries/vote', id: id}, function(data){
			$('#inquiries-big-answers').html(data);
		});
	});
	
	$('.answer-vote-home-page').click(function(){
		var id;
		id = $(this).attr('id');
		$.get('/ajax/ajax.php', {request: 'inquiries/voteHomePage', id: id}, function(data){
			$('#inquiries-home-page-answers').html(data);
		});
	});
	
});
