$(function(){
		
	/////////////LOGO///////////////////////
	$('#logo').click(function(){
		window.location = "index.php?setLang=21";
	});
	
	/////////////LOGIN///////////////////////
	$('#login').click(function(){
		$('#loginOverlay').fadeIn();
	});
	
	$('#loginOverlay, #closeLogin').click(function(e){
		if (this == e.target) {
			$('#loginOverlay').fadeOut();
		}
	});
	
	$('#register').click(function(){
		$('#registerOverlay').fadeIn();
	});
	
	$('#registerOverlay, #closeRegister').click(function(e){
		if (this == e.target) {
			$('#registerOverlay').fadeOut();
		}
	});
	
	/////////////NAVIGATION DROPDOWN/////////
	$("#menu li").stop().hover(function(){
		$(this).find('ul:first').stop(true, true).fadeIn();
	},function(){
		$(this).find('ul:first').stop(true, true).fadeOut();
	});
			
	$(".ValidateForm").validate();
	$(".loginForm").validate();
	$(".registerForm").validate();
	
	///////////LOCKED PAGES///////
	$('.locked').click(function(e){
		e.preventDefault();
		$('#login').trigger('click');
	});
	
	////////////FANCYBOX/////////////
	$('.fancybox').fancybox({
		overlayColor	: '#000',
		overlayOpacity	: '0.6',
		opacity			: true,
		titlePosition : 'outside',
		titleFormat   : function(title, currentArray, currentIndex, currentOpts) {
			return '<span class="floatRight">'+(currentIndex + 1) + ' / ' + currentArray.length+'</span>';
		}
	});
	
	
	////////////ICONS///////////
	$('.icon').hover(function(){
		$(this).stop().fadeTo('100','0.6');
	}, function(){
		$(this).stop().fadeTo('100','1');
	});
	
	////////////FLAGS///////////
	$('.flag').hover(function(){
		$(this).stop().fadeTo('100','0.6');
	}, function(){
		$(this).stop().fadeTo('100','1');
	});
	
	var startMonth = new Array();
	startMonth[1] = 0;
	startMonth[2] = 0;
	startMonth[3] = 0;
	startMonth[4] = 1;
	startMonth[5] = 1;
	startMonth[6] = 1;
	startMonth[7] = 2;
	startMonth[8] = 2;
	startMonth[9] = 2;
	startMonth[10] = 3;
	startMonth[11] = 3;
	startMonth[12] = 3;
	$('#agendaCycle').cycle({
		fx: "scrollHorz",
		timeout: 0,
		startingSlide:   startMonth[currentMonth],
		pager:  '.pager',
		pagerAnchorBuilder: function(idx, slide) {
			return '<a href="#">&nbsp;&bull;&nbsp;</a>';
		},

		before: function(slide,next){
				$('#agendaCycle').animate({
				'height' :  $(next).height()
				}, 1000);
		}
	});
	
	//CYCLE NEWS
	$('.newsArchive').cycle({
		fx: "scrollVert",
		timeout: 0,
		startingSlide:   0,
		pager:  '.pagerNum',
		activePagerClass: 'pagerNumActive'
	});
	
	
	////////EQUAL HEIGHTS
	if ($('.subs').height() > $('.subnavigation').height()) {
		$('.subnavigation').height($('.subs').height());
	} else {
		$('.subs').height($('.subnavigation').height());
	}
});

