
$(document).ready(function(){


	/*-----------------------------------------------
					TOP MENU - DROP DOWN MENU
	------------------------------------------------*/

	$('ul#topmenu ul').animate({'margin-left': '-8px'}, 100); // fix child position
	
	$('ul#topmenu li.parent').hover(
		function () {
			$('ul#topmenu ul').slideDown();
		},
		function () {
			$('ul#topmenu ul').slideUp();
		}
	);


	/*-----------------------------------------------
		GALLERIES - initialize the script for zooming the images in galeries
	------------------------------------------------*/
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'fast', /* fast/slow/normal */
		slideshow: false, /* false OR interval time in ms */
		autoplay_slideshow: false, /* true/false */
		opacity: 0.80, /* Value between 0 and 1 */
		show_title: true, /* true/false */
		allow_resize: true, /* Resize the photos bigger than viewport. true/false */
		default_width: 500,
		default_height: 344,
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		overlay_gallery: true,
		theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
		gallery_markup: '<div class="pp_gallery"> \
                                <a href="#" class="pp_arrow_previous">Previous</a> \
                                <ul> \
                                    {gallery} \
                                </ul> \
                                <a href="#" class="pp_arrow_next">Next</a> \
                            </div>'
	});

	

	/*-----------------------------------------------
					TEAM PAGE MAP 
	------------------------------------------------*/
	
	// first of all, hide all details about counties
	$('.hidden-elem').hide();

	// switch the county
	$('area').click(function() {
		var areaId = $(this).attr('id'); 

		$('#jud-choose').hide();
		$('.hidden-elem').hide();
		
		$('#jud #jud-'+areaId).fadeIn('slow');
		
		return false; // Prevent browser to follow the "link"
	});
	
	
	

	/*-----------------------------------------------
					PRODUCTS PAGE 
	------------------------------------------------*/
	
	// hide details about products and show only for first prod.
	$('.product-details').hide();
	$('#prod_details .pr1-det').show();
	
	// switch the product
	$('#prod_list li a').click(function() {
		var prodId = $(this).attr('id'); 
		
		$('#prod_list li a').css('font-weight', 'normal');
		$('.product-details').hide();	
		
		$(this).css('font-weight', 'bold');
		$('#prod_details .'+prodId+'-det').fadeIn('slow');
		
		return false; // Prevent browser to follow the "link"
	});


	
	

});
