$('#footer_extras_text').hide();

if(router.module=='') router.module='home';

$('#head_photos').cycle();

$('.cycler').cycle();


$('#langs .lang_'+router.language).addClass('active');
$('#menu .menu_'+router.module).addClass('active');

$('#menu li').mouseover(function() {
	$('a:first', this).addClass('active_js');
	$('.submenu', this).show();
});

$('#menu li').mouseleave(function() {
	$('a:first', this).removeClass('active_js');
	$('.submenu', this).hide();
});

checkFormExtras = function($form) {
	if($('input[name=first_visit]:checked').val()=='1' && $('input[name=doctor_name]').val()=='')
	elementError($('input[name=doctor_name]'), true);
	else
	elementError($('input[name=doctor_name]'), false);
}

$('input[name=date]').date_input();

$('.submenu').each(function() { 
	$('li:last', this).addClass('last');  
	$('li:first', this).addClass('first'); 
	$('li', this).css('width', $(this).width()).prepend('<div class="bleft"></div><div class="bright" style="margin-left: '+($(this).width()-3)+'px"></div>');
})

$('#home_news .home_news').slice(1, 4).hide();
$('#home_news .btn').click(function() {
	$('#home_news .btn').removeClass('active');
	$(this).addClass('active');

	$('#home_news .home_news').hide();
	$('#home_news .home_news').eq($(this).index()).show();
	return false;
});

$('.submenu li').mouseover(function() {
	$('*', this).addClass('active');
})

$('.submenu li').mouseout(function() {
	$('*', this).removeClass('active');
})

$('.map').click(function() {
	$container = overlay();
	loadShowData('<div id="map"></div>');
 
	$('#map').DeseoMap(50.322443472703036, 18.701868653297424, 14);
		
	return false;
});
 
$('.map_close').click(function() {
	$('.overlay').fadeOut();
	$('.map_handler').css('left', '-50%');
	return false;
});

$('#gallery').paginate({size: 3, children: '.resize_photo'});
$('#news').paginate({size: 5, children: '.news'});

$('#menu .submenu .menu_'+router.action+' *').addClass('active');

