$(document).ready(function(){

	/* MENU */
	$('li.category').hover(function(){
		$('ul.subcategories').removeClass('curent');
		$(this).addClass('curent');
	},function(){
		$(this).removeClass('curent');
	});
	/* // MENU */


	$('#searchform #s').attr('value','cauta');
	$('#searchform #s').focus(function(){
		if ($(this).attr('value') == 'cauta')
		{
			$(this).attr('value','');
		} else {
		
		}
	});
	$('#searchform #s').blur(function(){
		if ($(this).attr('value') == '')
		{
			$(this).attr('value','cauta');
		} else {
			
		}
	});

	/* GALLERY */
	$('#gallery div.ngg-galleryoverview div.ngg-gallery-thumbnail-box').each(function(i){
		if (i == 0)
		{
			$link = $(this).children('div.ngg-gallery-thumbnail').children('a').attr('href');
			$('p.visual').html('<img src="'+$link+'" alt="" />');
			$('p.visual').fadeIn(1000);
		}
	});



	$('#gallery div.ngg-gallery-thumbnail a').click(function(){
		$link = $(this).attr('href');
		$('p.visual').fadeOut(500, function(){
				$('p.visual').html('<img src="'+$link+'" alt="" />');
		});
		$('p.visual').fadeIn(1000);
		return false;
	});

	$('#gallery').scrollable({ 
		items: '.ngg-galleryoverview',
		next: '#gallery div.next', 
		prev: '#gallery div.prev' 
	});
	/* // GALLERY */

	$('div.content_news div.ngg-gallery-thumbnail a').lightBox();

	$('div.content_news p:contains(pdf)').addClass('pdf');
	$('#entry div.body p:contains(pdf)').addClass('pdf');

	$('p.close_map').click(function(){
		$('#map_cnt').css({'display':'none'});
	});

	$('p.open_map').click(function(){
		$('#map_cnt').css({'display':'block'});
	});
});


function getCoordinates(lat,lon) {
	$('p.coords span').text(lat+' , '+lon);
}
