;	(function($){ 

$.logic = {

	go:
		function() {

			$("#text table tr:odd").addClass("odd")
		;	$("#text table tr td:odd").addClass("alright")

		;	$("h1").css({cursor:"pointer"}).bind("click", $.logic.goHome)
		;	$("#event > h3").css({cursor:"pointer"}).bind("click", $.logic.goSeason)
		;	$.logic.slide.set()
		;	$.logic.blur()
		;	$.logic.selectCurrent()
/*
		;	$.getScript(
				'http://volux.ru/js/plugin/pngfix.js'
			,	function(){
					$(document).pngFix({blankgif:'/style/i/x.gif'})
				}
			)
 */
		}

,	blur:
		function() {
			$("a").bind("focus", function() {
				this.blur()
			})
		}

,	goHome:
		function() {
			location.href = "/"
		}

,	goSeason:
		function() {
			location.href = $(this).find("a").attr("href")
		}

,	makeCurrent:
		function(el, first) {
			if (first == 'fn') {
				$(el).parent().parent().parent().addClass("current");
			} else {
				$(el).parent().parent().addClass("current");
			}
		}

,	selectCurrent:
		function() {
			currentDate = new Date()
		;	var active = {
				day: currentDate.getDate()
			,	month: currentDate.getMonth()+1
			,	year:
					function() {
						currYear = currentDate.getYear()
					;	if (currYear < 1900) {
							return currYear+1900
						}
						return currYear
					}
			}
			$("#year"+active.year()+" span[class*='-']").each(function(){
				classes = $(this).attr('class').split(' ')
			;	var cell = {
					first: classes[0]
				,	date: classes[1].replace('d', '').split('-')
				}
			;	if (active.month == cell.date[0]) {
					if (active.day <= cell.date[1]) {
						$.logic.makeCurrent(this, cell.first)
					;	return false
					}
				}
			;	if (active.month < cell.date[0]) {
					$.logic.makeCurrent(this, cell.first)
				;	return false
				}
			;	return true
			})
		}

,	items: {
		slides: {}
	}

,	data: {
		slideSec: 5
	}

,	slide: {
		current: 0

	,	set:
			function(){
				$.logic.items.slides = $("#slide img")
			;	if ($.logic.items.slides.length>1) {
					$.logic.slide.show()
				}
			}

	,	show:
			function(){
				setTimeout("$.logic.slide.timeOut()", $.logic.data.slideSec*1000)
			}

	,	timeOut:
			function(){
				$.logic.items.slides.eq($.logic.slide.current).fadeOut()
			;	$.logic.slide.current++
			;	if ($.logic.slide.current == $.logic.items.slides.length) {
					$.logic.slide.current = 0
				}
			;	$.logic.items.slides.eq($.logic.slide.current).fadeIn()
			;	$.logic.slide.show()
			}
	}

}
})(jQuery)

;	jQuery(document).ready(jQuery.logic.go);
