﻿$(document).ready(function() {
	$('input[type=text]').focusin(function(){
		$(this).parent('span.field').addClass('focus');
	})
	$('input[type=text]').focusout(function(){
		$(this).parent('span.field').removeClass('focus');
	})
	
	$('select').focusin(function(){
		$(this).parent('span.select').addClass('focus');
	})
	$('select').focusout(function(){
		$(this).parent('span.select').removeClass('focus');
	})
	
	$('textarea').focusin(function(){
		$(this).parent('span.textarea').addClass('focus');
	})
	$('textarea').focusout(function(){
		$(this).parent('span.textarea').removeClass('focus');
	})
	
	$('input[type=file]').focusin(function(){
		$(this).parent('span.file').addClass('focus');
	})
	$('input[type=file]').focusout(function(){
		$(this).parent('span.file').removeClass('focus');
	})

	$('input[type=checkbox]').click(function(){
		if ($(this).attr('checked')) {
			$(this).next('.txt').css('color', '#2c2b26');
		} else {
			$(this).next('.txt').css('color', '#85867d');
		}
	});
	$('input[type=radio]').click(function(){
		if ($(this).attr('checked')) {
			var n=$(this).attr('name');
			$('input[name='+ n +']').each(function(){
				$(this).next('.txt').css('color', '#85867d');
			});
			$(this).next('.txt').css('color', '#2c2b26');
		}
	});
	
	$('.table-programs input[type=checkbox], .table-programs input[type=radio]').uniform();

	$('div.block h2').parent().css('border-top', '0 none');
});
