$(document).ready( function() {

	var date = new Date();

	var months_ru = ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь']
	var months_en = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'Oktober', 'November', 'December']
	
	var day = date.getDate();
	var month = date.getMonth();
	var month_next = ( month == 11 ) ? 0 : month + 1;
	var year = date.getFullYear();
	var year_next = ( month == 11 ) ? year + 1 : year;

	var next = 0;

	$('option').each( function() {
		
		if ( next ) {
			
			next = 0;
		}
	
		else if ( $(this).val() == months_ru[month] || $(this).val() == months_en[month] ) {

			$(this).attr('selected', 'selected');

			if ( month == date.getMonth() )
				month = month_next;
			else
				month = date.getMonth();
			
			next = 1;
		}
		
		else if ( $(this).val() == year ) {
		
			$(this).attr('selected', 'selected');
			
			if ( year == date.getFullYear() )
				year = year_next;
			else 
				year = date.getFullYear();
			
			next = 1;
		}
		
		else if ( $(this).val() == day ) {
		
			$(this).attr('selected', 'selected');
		}
	});

	if ( screen.width < 1024 ) {
	
		$('#content').css( 'overflow', 'hidden' );
	}
	
	var i = 0;
	$('#main form').each( function() {
	
		$(this).parent().attr( 'id', 'form' + i );
		++i;
	});
	
	$('#form1').css({display:'none'});
	
	$('.4form').click( function() {
	
		if ( $(this).hasClass('active') )
			return false;

		$('#form0').slideToggle({queue:false,duration:700});
		$('#form1').slideToggle({queue:true,duration:700});
		
		$('.4form').each( function() {
			
			$(this).toggleClass('active');
		});
		
		return false;
	});
})

